diff --git a/flake.lock b/flake.lock index cb326fd..95bf4b5 100644 --- a/flake.lock +++ b/flake.lock @@ -65,6 +65,68 @@ "type": "github" } }, + "hyprland-protocols_2": { + "inputs": { + "nixpkgs": [ + "xremap", + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1671839510, + "narHash": "sha256-+PY1qqJfmZzzROgcIY4I7AkCwpnC+qBIYk2eFoA9RWc=", + "owner": "hyprwm", + "repo": "hyprland-protocols", + "rev": "b8f55e02a328c47ed373133c52483bbfa20a1b75", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "hyprland-protocols", + "type": "github" + } + }, + "hyprland_2": { + "inputs": { + "hyprland-protocols": "hyprland-protocols_2", + "nixpkgs": "nixpkgs_2", + "wlroots": "wlroots_2", + "xdph": "xdph_2" + }, + "locked": { + "lastModified": 1673526825, + "narHash": "sha256-GukJtWwrkkf3ApkBTc7tW7DcsS1gKHWWs7OJYnv9om8=", + "owner": "hyprwm", + "repo": "Hyprland", + "rev": "cbd31ba481c5be65e015647851eef4b396869073", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "Hyprland", + "type": "github" + } + }, + "naersk": { + "inputs": { + "nixpkgs": "nixpkgs_3" + }, + "locked": { + "lastModified": 1671096816, + "narHash": "sha256-ezQCsNgmpUHdZANDCILm3RvtO1xH8uujk/+EqNvzIOg=", + "owner": "nmattia", + "repo": "naersk", + "rev": "d998160d6a076cfe8f9741e56aeec7e267e3e114", + "type": "github" + }, + "original": { + "owner": "nmattia", + "ref": "master", + "repo": "naersk", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1675942811, @@ -81,6 +143,52 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1672791794, + "narHash": "sha256-mqGPpGmwap0Wfsf3o2b6qHJW1w2kk/I6cGCGIU+3t6o=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "9813adc7f7c0edd738c6bdd8431439688bb0cb3d", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_3": { + "locked": { + "lastModified": 1673525234, + "narHash": "sha256-fMP37VTeqSzC8JYoQJinLOnHfjriE5uKInLWJRz5K3E=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "92f9580a4c369b4b51a7b6a5e77da43720134c9f", + "type": "github" + }, + "original": { + "id": "nixpkgs", + "type": "indirect" + } + }, + "nixpkgs_4": { + "locked": { + "lastModified": 1673525234, + "narHash": "sha256-fMP37VTeqSzC8JYoQJinLOnHfjriE5uKInLWJRz5K3E=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "92f9580a4c369b4b51a7b6a5e77da43720134c9f", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixpkgs-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, "nur": { "locked": { "lastModified": 1676375128, @@ -101,7 +209,8 @@ "home-manager": "home-manager", "hyprland": "hyprland", "nixpkgs": "nixpkgs", - "nur": "nur" + "nur": "nur", + "xremap": "xremap" } }, "utils": { @@ -137,6 +246,24 @@ "type": "gitlab" } }, + "wlroots_2": { + "flake": false, + "locked": { + "host": "gitlab.freedesktop.org", + "lastModified": 1671183014, + "narHash": "sha256-oMWT5Zbe/3HFINAk38jNVxiZ4PCYvPJj2Jo4iiyBtm0=", + "owner": "wlroots", + "repo": "wlroots", + "rev": "dc7cc98cf21a8dc19ab8895505500e3700646af0", + "type": "gitlab" + }, + "original": { + "host": "gitlab.freedesktop.org", + "owner": "wlroots", + "repo": "wlroots", + "type": "gitlab" + } + }, "xdph": { "inputs": { "hyprland-protocols": [ @@ -161,6 +288,71 @@ "repo": "xdg-desktop-portal-hyprland", "type": "github" } + }, + "xdph_2": { + "inputs": { + "hyprland-protocols": [ + "xremap", + "hyprland", + "hyprland-protocols" + ], + "nixpkgs": [ + "xremap", + "hyprland", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1673116118, + "narHash": "sha256-eR0yDSkR2XYMesfdRWJs25kAdXET2mbNNHu5t+KUcKA=", + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "rev": "d479c846531fd0e1d2357c9588b8310a2b859ef2", + "type": "github" + }, + "original": { + "owner": "hyprwm", + "repo": "xdg-desktop-portal-hyprland", + "type": "github" + } + }, + "xremap": { + "inputs": { + "hyprland": "hyprland_2", + "naersk": "naersk", + "nixpkgs": "nixpkgs_4", + "xremap": "xremap_2" + }, + "locked": { + "lastModified": 1673542172, + "narHash": "sha256-UycT73yMNhyvuetDMmEZ47NWLavyDy5MhKjZukrVpWk=", + "owner": "xremap", + "repo": "nix-flake", + "rev": "1212aa09e65f437282456f89ef637c27430dd67d", + "type": "github" + }, + "original": { + "owner": "xremap", + "repo": "nix-flake", + "type": "github" + } + }, + "xremap_2": { + "flake": false, + "locked": { + "lastModified": 1673511384, + "narHash": "sha256-uHLzTXHB8/o/gO/ujWwIM/V5Ob23D2Har9S0o09tApg=", + "owner": "k0kubun", + "repo": "xremap", + "rev": "dac4e87a3c0465d1a17f5699ab30bd31e7fdc4bf", + "type": "github" + }, + "original": { + "owner": "k0kubun", + "ref": "v0.8.0", + "repo": "xremap", + "type": "github" + } } }, "root": "root", diff --git a/flake.nix b/flake.nix index 3c65162..a654ac9 100644 --- a/flake.nix +++ b/flake.nix @@ -12,6 +12,7 @@ inputs.nixpkgs.follows = "nixpkgs"; }; nur.url = "github:nix-community/NUR"; + xremap.url = "github:xremap/nix-flake"; }; outputs = { @@ -19,6 +20,7 @@ home-manager, hyprland, nur, + xremap, ... } @ rawInput: let user = "zoriya"; @@ -52,7 +54,7 @@ networking.hostName = hostname; users.users.${user} = { isNormalUser = true; - extraGroups = ["wheel"]; + extraGroups = ["wheel" "input"]; packages = with pkgs; [ git ]; @@ -82,6 +84,24 @@ # TODO: use a module instead of this. hyprland.nixosModules.default {programs.hyprland.enable = true;} + + xremap.nixosModules.default + { + services.xremap = { + serviceMode = "user"; + userName = user; + config = { + modmap = { + application = "eww"; + remap = { + Esc = { + launch = "eww close pannel-close && eww close pannel"; + }; + }; + }; + }; + }; + } ]; }; in { diff --git a/modules/home/apps/default.nix b/modules/home/apps/default.nix index c92fe41..7375e04 100644 --- a/modules/home/apps/default.nix +++ b/modules/home/apps/default.nix @@ -7,6 +7,11 @@ }: with lib; let cfg = config.modules.apps; + + browser = "google-chrome.desktop"; + editor = "nvim.desktop"; + pdf = "org.pwmt.zathura.desktop"; + player = "mpv.desktop"; in { options.modules.apps = {enable = mkEnableOption "apps";}; @@ -16,6 +21,8 @@ in { kitty google-chrome firefox + mpv + xdg-utils ]; home.sessionVariables = { EDITOR = "nvim"; @@ -23,5 +30,83 @@ in { TERMINAL = "kitty"; BROWSER = "google-chrome-stable"; }; + xdg.mimeApps = { + enable = false; + defaultApplications = { + "x-scheme-handler/http" = browser; + "x-scheme-handler/https" = browser; + "x-scheme-handler/about" = browser; + "x-scheme-handler/unknown" = browser; + "x-scheme-handler/magnet" = browser; + "application/oxps" = pdf; + "application/pdf" = pdf; + "application/epub+zip" = pdf; + "application/x-fictionbook+xml" = pdf; + "text/tcl" = editor; + "text/html" = editor; + "text/x-makefile" = editor; + "text/vbscript" = editor; + "text/spreadsheet" = editor; + "text/x-tex" = editor; + "text/x-c++hdr" = editor; + "text/x-pascal" = editor; + "text/x-moc" = editor; + "text/x-chdr" = editor; + "text/tab-separated-values" = editor; + "text/x-python" = editor; + "text/x-csrc" = editor; + "text/x-c++src" = editor; + "text/x-java" = editor; + "text/plain" = editor; + "text/csv" = editor; + "video/x-flic" = player; + "video/mpeg" = player; + "video/x-ms-wmv" = player; + "video/vnd.rn-realvideo" = player; + "video/x-theora+ogg" = player; + "video/dv" = player; + "video/webm" = player; + "video/ogg" = player; + "video/quicktime" = player; + "video/x-flv" = player; + "video/x-ogm+ogg" = player; + "video/3gpp2" = player; + "video/mp2t" = player; + "video/x-msvideo" = player; + "video/3gpp" = player; + "video/x-matroska" = player; + "video/vnd.mpegurl" = player; + "video/mp4" = player; + "audio/aac" = player; + "audio/ac3" = player; + "audio/x-wavpack" = player; + "audio/webm" = player; + "audio/x-ms-wma" = player; + "audio/flac" = player; + "audio/x-scpls" = player; + "audio/mpeg" = player; + "audio/x-mpegurl" = player; + "audio/x-ms-asx" = player; + "audio/vnd.rn-realaudio" = player; + "audio/x-wav" = player; + "audio/vnd.dts" = player; + "audio/x-adpcm" = player; + "audio/x-vorbis+ogg" = player; + "audio/mp4" = player; + "audio/x-tta" = player; + "audio/x-musepack" = player; + "audio/AMR" = player; + "audio/x-matroska" = player; + "audio/x-ape" = player; + "audio/x-aiff" = player; + "audio/vnd.dts.hd" = player; + "audio/ogg" = player; + "audio/mp2" = player; + }; + }; + xdg.userDirs = { + enable = true; + download = "${config.home.homeDirectory}/downloads"; + }; }; } diff --git a/modules/home/eww/bar/clock.yuck b/modules/home/eww/bar/clock.yuck index d37c8cc..192c3c1 100644 --- a/modules/home/eww/bar/clock.yuck +++ b/modules/home/eww/bar/clock.yuck @@ -1,4 +1,4 @@ -(defpoll time :initial '{}' :interval "5s" `date +'{"date": "%b %m", "hour": "%H", "minute": "%M", "day": "%A"}'`) +(defpoll time :initial '{}' :interval "5s" `date +'{"date": "%a %d %b", "hour": "%H", "minute": "%M", "day": "%A"}'`) (defwidget clock [] (box diff --git a/modules/home/eww/bar/window/eww.yuck b/modules/home/eww/bar/window/eww.yuck index 2e6a2be..9d272b1 100644 --- a/modules/home/eww/bar/window/eww.yuck +++ b/modules/home/eww/bar/window/eww.yuck @@ -1,4 +1,4 @@ -(deflisten title :initial "..." "./bar/window/get-window-title.sh") +(deflisten title :initial "" "./bar/window/get-window-title.sh") (defwidget window [] (box diff --git a/modules/home/eww/default.nix b/modules/home/eww/default.nix index c4a9fbc..99d8b37 100644 --- a/modules/home/eww/default.nix +++ b/modules/home/eww/default.nix @@ -33,11 +33,14 @@ in { wlogout bc tiramisu + fusuma ]; programs.eww = { enable = true; package = pkgs.eww-wayland; configDir = ./.; }; + + xdg.configFile."fusuma/config.yaml".source = ./fusuma.yaml; }; } diff --git a/modules/home/eww/fusuma.yaml b/modules/home/eww/fusuma.yaml new file mode 100644 index 0000000..f5c4f55 --- /dev/null +++ b/modules/home/eww/fusuma.yaml @@ -0,0 +1,15 @@ +swipe: + 3: + down: + command: "hyprctl dispatch fullscreen 1" + up: + command: "hyprctl dispatch fullscreen 1" + 4: + left: + command: "hyprctl dispatch cyclenext prev" + right: + command: "hyprctl dispatch cyclenext" + up: + command: ''bash -c "eww open pannel-closer && eww open pannel"'' + down: + command: ''bash -c "eww close pannel-closer && eww close pannel"'' diff --git a/modules/home/eww/pannel/yuck/_init.yuck b/modules/home/eww/pannel/yuck/_init.yuck index 1b53875..ac4f34b 100644 --- a/modules/home/eww/pannel/yuck/_init.yuck +++ b/modules/home/eww/pannel/yuck/_init.yuck @@ -9,6 +9,16 @@ (include "./pannel/yuck/_music.yuck") (include "./pannel/yuck/_layout.yuck") +(defwidget closer [window] + (eventbox :onclick "eww close ${window} && eww close ${window}-closer")) + +(defwindow pannel-closer + :monitor 0 + :geometry (geometry :width "100%" :height "100%") + :stacking "fg" + :focusable false + (closer :window "pannel")) + (defwindow pannel :stacking "fg" :windowtype "normal" :wm-ignore true diff --git a/modules/home/hyprland/hyprland.conf b/modules/home/hyprland/hyprland.conf index 5cb62ca..e501968 100644 --- a/modules/home/hyprland/hyprland.conf +++ b/modules/home/hyprland/hyprland.conf @@ -1,6 +1,7 @@ exec-once=xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 exec-once=discord exec-once=eww open bar +exec-once=fusuma -c .config/fusuma/config.yaml exec-once=/home/zoriya/.config/hypr/wallpaper.sh init autogenerated = 0 @@ -76,7 +77,15 @@ master { gestures { workspace_swipe = on + workspace_swipe_numbered = true workspace_swipe_distance = 150 + workspace_swipe_min_speed_to_force = 160 +} + +misc { + disable_hyprland_logo = true + disable_splash_rendering = true + focus_on_activate = true } # Example windowrule v1