From fac73d85089d79aab29d6ea3ed7ce0258d8e4378 Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Sat, 5 Sep 2026 19:45:18 +0300 Subject: [PATCH] hyprland: to lua --- flake.lock | 103 ++++----- flake.nix | 2 +- host/Eclipse/modules/hyprland.nix | 57 +++-- host/Impreza/modules/hyprland.nix | 28 +-- host/Inaho/modules/hyprland.nix | 17 +- host/Rias/modules/hyprland.nix | 82 +++---- host/Senko/modules/hyprland.nix | 17 +- modules/user/hyprland.nix | 324 +++++++++++++-------------- modules/user/hyprland/lua.nix | 35 +++ modules/user/hyprland/zoom.nix | 49 ++-- modules/user/hyprlock.nix | 8 +- modules/user/walker.nix | 7 +- modules/user/wob.nix | 33 ++- modules/user/yazi.nix | 20 +- user/chest/modules/hyprland.nix | 70 +++--- user/sweetbread/modules/hyprland.nix | 117 +++++----- user/sweetbread/modules/waybar.nix | 7 +- 17 files changed, 527 insertions(+), 449 deletions(-) create mode 100644 modules/user/hyprland/lua.nix diff --git a/flake.lock b/flake.lock index bc3657e..d57ae3e 100644 --- a/flake.lock +++ b/flake.lock @@ -60,11 +60,11 @@ ] }, "locked": { - "lastModified": 1772460678, - "narHash": "sha256-NYaWs8fYJ38IgFld0hGSdT2LEVhrgO8SiRReBjIH7YY=", + "lastModified": 1784368054, + "narHash": "sha256-zF1iJkBQSDWmRO4/LEeHR1SpKY0lqZaxkoQJpPS9K9U=", "owner": "hyprwm", "repo": "aquamarine", - "rev": "5d2cb726b16ee349df443f84b64cff53221b6983", + "rev": "9b5f14d9483445e766294eb8fbe0b8f370269ed0", "type": "github" }, "original": { @@ -285,28 +285,6 @@ "type": "github" } }, - "gitignore": { - "inputs": { - "nixpkgs": [ - "hyprland", - "pre-commit-hooks", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1709087332, - "narHash": "sha256-HG2cCnktfHsKV0s4XW83gU3F57gaTljL9KNSuG6bnQs=", - "owner": "hercules-ci", - "repo": "gitignore.nix", - "rev": "637db329424fd7e46cf4185293b9cc8c88c95394", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "gitignore.nix", - "type": "github" - } - }, "gnome-shell": { "flake": false, "locked": { @@ -384,11 +362,11 @@ ] }, "locked": { - "lastModified": 1772461003, - "narHash": "sha256-pVICsV7FtcEeVwg5y/LFh3XFUkVJninm/P1j/JHzEbM=", + "lastModified": 1776511930, + "narHash": "sha256-fCpwFiTW0rT7oKJqr3cqHMnkwypSwQKpbtUEtxdkgrM=", "owner": "hyprwm", "repo": "hyprcursor", - "rev": "b62396457b9cfe2ebf24fe05404b09d2a40f8ed7", + "rev": "39435900785d0c560c6ae8777d29f28617d031ef", "type": "github" }, "original": { @@ -413,11 +391,11 @@ ] }, "locked": { - "lastModified": 1772461523, - "narHash": "sha256-mI6A51do+hEUzeJKk9YSWfVHdI/SEEIBi2tp5Whq5mI=", + "lastModified": 1782566056, + "narHash": "sha256-haEZcHzYrePnjFOYSWTbxm/Nrla0aPslJfmvdCvqtVc=", "owner": "hyprwm", "repo": "hyprgraphics", - "rev": "7d63c04b4a2dd5e59ef943b4b143f46e713df804", + "rev": "c6e7b9f673f4360bc813d3dc75028f75ee88d3f8", "type": "github" }, "original": { @@ -443,16 +421,16 @@ "xdph": "xdph" }, "locked": { - "lastModified": 1773149218, - "narHash": "sha256-m5Ewi+rgn18qPP54Um4O2zwZ02oiomlZssHvXYEUv3U=", + "lastModified": 1785170029, + "narHash": "sha256-8CKDx282HhxlD1pwXPnC4uK29Abn1Jsnh7LgPzeIXxI=", "owner": "hyprwm", "repo": "Hyprland", - "rev": "59f9f2688ac508a0584d1462151195a6c4992f99", + "rev": "5c9377c15f85c50648f35ca5a213754f95b93ca0", "type": "github" }, "original": { "owner": "hyprwm", - "ref": "v0.54.2-b", + "ref": "v0.56.1", "repo": "Hyprland", "type": "github" } @@ -490,11 +468,11 @@ ] }, "locked": { - "lastModified": 1772467975, - "narHash": "sha256-kipyuDBxrZq+beYpZqWzGvFWm4QbayW9agAvi94vDXY=", + "lastModified": 1784196523, + "narHash": "sha256-ahtKMGXFJdlQNhatQm1+BBU/pGfGYnAqQt3vWvq4p8s=", "owner": "hyprwm", "repo": "hyprland-guiutils", - "rev": "5e1c6b9025aaf4d578f3eff7c0eb1f0c197a9507", + "rev": "a6ccb6cb112ed5a244c0191fb972347ecfa893e0", "type": "github" }, "original": { @@ -574,11 +552,11 @@ ] }, "locked": { - "lastModified": 1772459629, - "narHash": "sha256-/iwvNUYShmmnwmz/czEUh6+0eF5vCMv0xtDW0STPIuM=", + "lastModified": 1777320127, + "narHash": "sha256-Qu+Wf2Bp5qUjyn2YpZNq8a7JyzTGowhT1knrwE38a9U=", "owner": "hyprwm", "repo": "hyprlang", - "rev": "7615ee388de18239a4ab1400946f3d0e498a8186", + "rev": "090117506ddc3d7f26e650ff344d378c2ec329cc", "type": "github" }, "original": { @@ -626,11 +604,11 @@ ] }, "locked": { - "lastModified": 1772462885, - "narHash": "sha256-5pHXrQK9zasMnIo6yME6EOXmWGFMSnCITcfKshhKJ9I=", + "lastModified": 1782554491, + "narHash": "sha256-+p3MlyN/nqRefcf2IckPlGRUn9+hielqpS9XClbLleM=", "owner": "hyprwm", "repo": "hyprtoolkit", - "rev": "9af245a69fa6b286b88ddfc340afd288e00a6998", + "rev": "bdba25ced39ea39ab004a8f31593ba0b0ff1ca35", "type": "github" }, "original": { @@ -651,11 +629,11 @@ ] }, "locked": { - "lastModified": 1772459870, - "narHash": "sha256-xxkK2Cvqxpf/4UGcJ/TyCwrvmiNWsKsJfFzHMp2bxis=", + "lastModified": 1784323413, + "narHash": "sha256-XnAVV+H4f8Xdv0yZcSwJ5kCjLyE8fHxPeLX6a3HSrAU=", "owner": "hyprwm", "repo": "hyprutils", - "rev": "e63f3a79334dec49f8eb1691f66f18115df04085", + "rev": "5f03477ab3a005ff27c527486f551883535aea2f", "type": "github" }, "original": { @@ -676,11 +654,11 @@ ] }, "locked": { - "lastModified": 1772459835, - "narHash": "sha256-978jRz/y/9TKmZb/qD4lEYHCQGHpEXGqy+8X2lFZsak=", + "lastModified": 1777159683, + "narHash": "sha256-Jxixw6wZphUp+nHYxOKUYSckL17QMBx2d5Zp0rJHr1g=", "owner": "hyprwm", "repo": "hyprwayland-scanner", - "rev": "0a692d4a645165eebd65f109146b8861e3a925e7", + "rev": "b8632713a6beaf28b56f2a7b0ab2fb7088dbb404", "type": "github" }, "original": { @@ -705,11 +683,11 @@ ] }, "locked": { - "lastModified": 1772463520, - "narHash": "sha256-GIjASzYnV4fK19HnyJKmHyqyxHxIpjusK9foEA4Yo+4=", + "lastModified": 1778410714, + "narHash": "sha256-o6RzFj4nJXaPRY7EM01siuCQeT41RfwwmcmFQqwFJJg=", "owner": "hyprwm", "repo": "hyprwire", - "rev": "4e1933ae5602b350c5b6633f5c932549c9b8aca2", + "rev": "85148a8e612808cf5ddb25d0b3c5840f3498a7dc", "type": "github" }, "original": { @@ -784,11 +762,11 @@ }, "nixpkgs_3": { "locked": { - "lastModified": 1772542754, - "narHash": "sha256-WGV2hy+VIeQsYXpsLjdr4GvHv5eECMISX1zKLTedhdg=", + "lastModified": 1784356753, + "narHash": "sha256-12KrbMiWLcf8m7pCvAtZh1ZrgF85ZXDXvfR/fWTKy84=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "8c809a146a140c5c8806f13399592dbcb1bb5dc4", + "rev": "61b7c44c4073f0b827768aff0049561b5110ea5a", "type": "github" }, "original": { @@ -890,18 +868,17 @@ "pre-commit-hooks": { "inputs": { "flake-compat": "flake-compat_2", - "gitignore": "gitignore", "nixpkgs": [ "hyprland", "nixpkgs" ] }, "locked": { - "lastModified": 1772024342, - "narHash": "sha256-+eXlIc4/7dE6EcPs9a2DaSY3fTA9AE526hGqkNID3Wg=", + "lastModified": 1784288435, + "narHash": "sha256-ReRHaLgr/uVqdD8afFSn+myXIfpHeOhP0yYe0TJqAA8=", "owner": "cachix", "repo": "git-hooks.nix", - "rev": "6e34e97ed9788b17796ee43ccdbaf871a5c2b476", + "rev": "43b3c1ab9d40fb1dbb008f451988a91e375825e9", "type": "github" }, "original": { @@ -1178,11 +1155,11 @@ ] }, "locked": { - "lastModified": 1772476586, - "narHash": "sha256-N/ZwsRLULLpBP5ecvAUzNq8E/CgLRwPwSrHyY3xB5KM=", + "lastModified": 1784371182, + "narHash": "sha256-S8A1lezEalltWcCp3gAic5lssS0xTSISK6fKODefhOk=", "owner": "hyprwm", "repo": "xdg-desktop-portal-hyprland", - "rev": "eb6c02a2ead882f3474f3d7f2fbe966b64ed5110", + "rev": "08d99f727944dd15e4740090305e31c5fb92a50a", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 2be42cf..00547a2 100644 --- a/flake.nix +++ b/flake.nix @@ -42,7 +42,7 @@ flake = false; }; - hyprland.url = "github:hyprwm/Hyprland/v0.54.2-b"; + hyprland.url = "github:hyprwm/Hyprland/v0.56.1"; hyprland-plugins = { url = "github:hyprwm/hyprland-plugins"; inputs.hyprland.follows = "hyprland"; diff --git a/host/Eclipse/modules/hyprland.nix b/host/Eclipse/modules/hyprland.nix index 989229b..7d14a5a 100644 --- a/host/Eclipse/modules/hyprland.nix +++ b/host/Eclipse/modules/hyprland.nix @@ -1,27 +1,40 @@ -{ pkgs, lib, ... }: { - wayland.windowManager.hyprland = let - wallpaper = pkgs.fetchurl { - name = "miku_wallpaper.jpg"; - url = "https://c.lair.moe/pub/miku_wallpaper.jpeg?raw"; - hash = "sha256-inK4X5KzQk5FHwDw2DYy43nm7XtXlC6I0S1PkYUv+3w="; - }; - in { - settings = { - monitor = [ - "DP-3 , 1920x1080@165, 0x0 , 1" - "HDMI-A-1, preferred , -1080x0, 1, transform, 1" - ]; +{ pkgs, lib, ... }: +let + hyprLua = import ../../../modules/user/hyprland/lua.nix { inherit lib; }; + wallpaper = pkgs.fetchurl { + name = "miku_wallpaper.jpg"; + url = "https://c.lair.moe/pub/miku_wallpaper.jpeg?raw"; + hash = "sha256-inK4X5KzQk5FHwDw2DYy43nm7XtXlC6I0S1PkYUv+3w="; + }; +in { + wayland.windowManager.hyprland.settings = { + monitor = [ + { + output = "DP-3"; + mode = "1920x1080@165"; + position = "0x0"; + scale = 1; + } + { + output = "HDMI-A-1"; + mode = "preferred"; + position = "-1080x0"; + scale = 1; + transform = 1; + } + ]; - workspace = [ - "1, monitor:DP-3, default:true" - "10, monitor:HDMI-A-1, default:true" - ]; + workspace_rule = [ + { workspace = "1"; monitor = "DP-3"; default = true; } + { workspace = "10"; monitor = "HDMI-A-1"; default = true; } + ]; - exec-once = [ - "hyprctl dispatch workspace 1" + on = [ + (hyprLua.onStart [ + "hyprctl dispatch 'hl.dsp.focus({ workspace = 1 })'" "${lib.getExe pkgs.swww} img -o HDMI-A-1 ${wallpaper}" "${lib.getExe pkgs.linux-wallpaperengine} ~/.local/share/wpe/wallpaper --assets-dir ~/.local/share/wpe/assets --screen-root DP-3 --noautomute" - ]; - }; + ]) + ]; }; -} \ No newline at end of file +} diff --git a/host/Impreza/modules/hyprland.nix b/host/Impreza/modules/hyprland.nix index 4ab5c9f..f551227 100644 --- a/host/Impreza/modules/hyprland.nix +++ b/host/Impreza/modules/hyprland.nix @@ -1,15 +1,15 @@ -{ pkgs, lib, ... }: { - wayland.windowManager.hyprland = let - wallpaper = pkgs.fetchurl { - name = "miku_wallpaper.jpg"; - url = "https://c.lair.moe/pub/miku_wallpaper.jpeg?raw"; - hash = "sha256-inK4X5KzQk5FHwDw2DYy43nm7XtXlC6I0S1PkYUv+3w="; - }; - in { - settings = { - exec-once = [ - "${lib.getExe pkgs.swww} img -o eDP-1 ${wallpaper}" - ]; - }; +{ pkgs, lib, ... }: +let + hyprLua = import ../../../modules/user/hyprland/lua.nix { inherit lib; }; + wallpaper = pkgs.fetchurl { + name = "miku_wallpaper.jpg"; + url = "https://c.lair.moe/pub/miku_wallpaper.jpeg?raw"; + hash = "sha256-inK4X5KzQk5FHwDw2DYy43nm7XtXlC6I0S1PkYUv+3w="; }; -} \ No newline at end of file +in { + wayland.windowManager.hyprland.settings.on = [ + (hyprLua.onStart [ + "${lib.getExe pkgs.swww} img -o eDP-1 ${wallpaper}" + ]) + ]; +} diff --git a/host/Inaho/modules/hyprland.nix b/host/Inaho/modules/hyprland.nix index a74ec69..be3b9e2 100644 --- a/host/Inaho/modules/hyprland.nix +++ b/host/Inaho/modules/hyprland.nix @@ -1,9 +1,10 @@ { - wayland.windowManager.hyprland = { - settings = { - monitor = [ - "eDP-1, 1920x1080@60, 0x0, 1" - ]; - }; - }; -} \ No newline at end of file + wayland.windowManager.hyprland.settings.monitor = [ + { + output = "eDP-1"; + mode = "1920x1080@60"; + position = "0x0"; + scale = 1; + } + ]; +} diff --git a/host/Rias/modules/hyprland.nix b/host/Rias/modules/hyprland.nix index 0f272b7..8f44983 100644 --- a/host/Rias/modules/hyprland.nix +++ b/host/Rias/modules/hyprland.nix @@ -1,44 +1,50 @@ -{ pkgs, lib, ...}: { - wayland.windowManager.hyprland = let - monitor-switcher = pkgs.writers.writeBashBin "monitor_switcher" /*bash*/ '' - MODE=$1 +{ pkgs, lib, ... }: +let + hyprLua = import ../../../modules/user/hyprland/lua.nix { inherit lib; }; - case $MODE in - "tv") - hyprctl keyword monitor "DP-3, 1920x1080@60, 3840x0, 1" - hyprctl keyword monitor "HDMI-A-1, 3840x2160@60, 0x0, 1" - notify-send "TV mode" - ;; + monitor-switcher = pkgs.writers.writeBashBin "monitor_switcher" /*bash*/ '' + MODE=$1 - "mirror") - hyprctl keyword monitor "HDMI-A-1, 3840x2160@60, 0x0, 1" - hyprctl keyword monitor "DP-3, preferred, auto, 1, mirror, HDMI-A-1" - notify-send "TV-only mode" - ;; + case $MODE in + "tv") + hyprctl eval 'hl.monitor({ output = "DP-3", mode = "1920x1080@60", position = "3840x0", scale = 1 })' + hyprctl eval 'hl.monitor({ output = "HDMI-A-1", mode = "3840x2160@60", position = "0x0", scale = 1 })' + notify-send "TV mode" + ;; - "display"|*) - hyprctl keyword monitor "HDMI-A-1, disable" - hyprctl keyword monitor "DP-3, 3440x1440@165, 0x0, 1" - notify-send "Display mode" - ;; + "mirror") + hyprctl eval 'hl.monitor({ output = "HDMI-A-1", mode = "3840x2160@60", position = "0x0", scale = 1 })' + hyprctl eval 'hl.monitor({ output = "DP-3", mode = "preferred", position = "auto", scale = 1, mirror = "HDMI-A-1" })' + notify-send "TV-only mode" + ;; - esac - ''; - in { - settings = { - monitor = [ - "DP-3, 3440x1440@165, auto-right, 1" - # "HDMI-A-1, 3840x2160@60, auto-left, 2" - "HDMI-A-1, disabled" - ]; + "display"|*) + hyprctl eval 'hl.monitor({ output = "HDMI-A-1", disabled = true })' + hyprctl eval 'hl.monitor({ output = "DP-3", mode = "3440x1440@165", position = "0x0", scale = 1 })' + notify-send "Display mode" + ;; + esac + ''; +in { + wayland.windowManager.hyprland.settings = { + monitor = [ + { + output = "DP-3"; + mode = "3440x1440@165"; + position = "auto-right"; + scale = 1; + } + { + output = "HDMI-A-1"; + disabled = true; + } + ]; - bind = [ - '', XF86Calculator, exec, ghostty --title=pulsemixer -e pulsemixer'' - - ''$mainMod, F1, exec, ${lib.getExe monitor-switcher} tv'' - ''$mainMod, F2, exec, ${lib.getExe monitor-switcher} mirror'' - ''$mainMod, F3, exec, ${lib.getExe monitor-switcher}'' - ]; - }; + bind = [ + (hyprLua.bind "XF86Calculator" (hyprLua.exec "ghostty --title=pulsemixer -e pulsemixer")) + (hyprLua.bind "SUPER + F1" (hyprLua.exec "${lib.getExe monitor-switcher} tv")) + (hyprLua.bind "SUPER + F2" (hyprLua.exec "${lib.getExe monitor-switcher} mirror")) + (hyprLua.bind "SUPER + F3" (hyprLua.exec "${lib.getExe monitor-switcher}")) + ]; }; -} \ No newline at end of file +} diff --git a/host/Senko/modules/hyprland.nix b/host/Senko/modules/hyprland.nix index a74ec69..be3b9e2 100644 --- a/host/Senko/modules/hyprland.nix +++ b/host/Senko/modules/hyprland.nix @@ -1,9 +1,10 @@ { - wayland.windowManager.hyprland = { - settings = { - monitor = [ - "eDP-1, 1920x1080@60, 0x0, 1" - ]; - }; - }; -} \ No newline at end of file + wayland.windowManager.hyprland.settings.monitor = [ + { + output = "eDP-1"; + mode = "1920x1080@60"; + position = "0x0"; + scale = 1; + } + ]; +} diff --git a/modules/user/hyprland.nix b/modules/user/hyprland.nix index fe16d88..434df97 100644 --- a/modules/user/hyprland.nix +++ b/modules/user/hyprland.nix @@ -1,6 +1,26 @@ -{ pkgs, lib, config, osConfig, inputs, username, ... }: let +{ pkgs, lib, config, osConfig, inputs, username, ... }: +let optImport = path: lib.optional (builtins.pathExists path) path; hostname = osConfig.networking.hostName; + hyprLua = import ./hyprland/lua.nix { inherit lib; }; + inherit (hyprLua) bind bindWithFlags exec onStart; + + direction = { + left = "l"; + right = "r"; + up = "u"; + down = "d"; + }; + + workspaceBinds = lib.concatMap (workspace: + let + key = if workspace == 10 then "0" else toString workspace; + workspaceValue = toString workspace; + in [ + (bind "SUPER + ${key}" "hl.dsp.focus({ workspace = ${workspaceValue} })") + (bind "SUPER + SHIFT + ${key}" "hl.dsp.window.move({ workspace = ${workspaceValue}, follow = false })") + ] + ) (lib.range 1 10); in { imports = [ ./hyprland/zoom.nix @@ -19,11 +39,9 @@ in { wifitui ]; - wayland.windowManager.hyprland = let - colors = config.lib.stylix.colors; - in { + wayland.windowManager.hyprland = { enable = true; - configType = "hyprlang"; + configType = "lua"; xwayland.enable = true; package = inputs.hyprland.packages.${pkgs.stdenv.hostPlatform.system}.hyprland; @@ -32,200 +50,158 @@ in { ]; settings = { - "$mainMod" = "SUPER"; + config = { + ecosystem = { + no_donation_nag = true; + no_update_news = true; + }; - ecosystem = { - no_donation_nag = true; - no_update_news = true; + cursor.no_hardware_cursors = 1; + + debug = { + disable_logs = false; + enable_stdout_logs = true; + }; + + general."col.inactive_border" = lib.mkForce "rgba(00000000)"; + + decoration = { + inactive_opacity = lib.mkDefault 0.95; + border_part_of_window = false; + }; + + misc.focus_on_activate = true; + + input = { + kb_layout = "us,ru"; + kb_options = "grp:caps_toggle"; + numlock_by_default = true; + follow_mouse = 1; + touchpad.natural_scroll = false; + sensitivity = 0; + }; + + gestures = { + workspace_swipe_invert = true; + workspace_swipe_distance = 200; + workspace_swipe_forever = true; + }; }; env = [ - "XDG_SESSION_TYPE,wayland" - "QT_QPA_PLATFORM,wayland" - "QT_QPA_PLATFORMTHEME,xdgdesktopportal" - "GTK_USE_PORTAL,1" - "TDESKTOP_USE_GTK_FILE_DIALOG,1" - "NIXOS_OZONE_WL,1" - "ELECTRON_OZONE_PLATFORM_HINT,auto" - - "XDG_CURRENT_DESKTOP,Hyprland" - "XDG_SESSION_DESKTOP,Hyprland" - - "XCURSOR_SIZE, ${toString config.stylix.cursor.size}" - "XCURSOR_THEME, ${config.stylix.cursor.name}" - - "XDG_SCREENSHOTS_DIR,~/screens" + { _args = [ "XDG_SESSION_TYPE" "wayland" ]; } + { _args = [ "QT_QPA_PLATFORM" "wayland" ]; } + { _args = [ "QT_QPA_PLATFORMTHEME" "xdgdesktopportal" ]; } + { _args = [ "GTK_USE_PORTAL" "1" ]; } + { _args = [ "TDESKTOP_USE_GTK_FILE_DIALOG" "1" ]; } + { _args = [ "NIXOS_OZONE_WL" "1" ]; } + { _args = [ "ELECTRON_OZONE_PLATFORM_HINT" "auto" ]; } + { _args = [ "XDG_CURRENT_DESKTOP" "Hyprland" ]; } + { _args = [ "XDG_SESSION_DESKTOP" "Hyprland" ]; } + { _args = [ "XCURSOR_SIZE" (toString config.stylix.cursor.size) ]; } + { _args = [ "XCURSOR_THEME" config.stylix.cursor.name ]; } + { _args = [ "XDG_SCREENSHOTS_DIR" "~/screens" ]; } ]; - cursor.no_hardware_cursors = true; - - debug = { - disable_logs = false; - enable_stdout_logs = true; - }; - - general = { - "col.inactive_border" = lib.mkForce "rgba(00000000)"; - }; - - decoration.inactive_opacity = lib.mkDefault .95; - decoration.border_part_of_window = false; - - misc = { - focus_on_activate = true; - }; - - input = { - kb_layout = "us,ru"; - kb_options = "grp:caps_toggle"; - numlock_by_default = true; - - follow_mouse = 1; - - touchpad = { - natural_scroll = false; - }; - - sensitivity = 0; - }; - - gestures = { - workspace_swipe_invert = true; - workspace_swipe_distance = 200; - workspace_swipe_forever = true; - }; - gesture = [ - "3, horizontal, workspace" + { + fingers = 3; + direction = "horizontal"; + action = "workspace"; + } ]; - workspace = [ - "w[t1], gapsout:0" + workspace_rule = [ + { + workspace = "w[t1]"; + gaps_out = 0; + } ]; - windowrule = [ - "match:class imv, float 1" - "match:class feh, float 1" - "match:class mpv, float 1" - - "match:title Список друзей, float 1" - "match:title wifitui, float 1" - "match:title pulsemixer, float 1" - - "match:title clipse, float 1" - "match:title clipse, size 622 652" - - "match:focus 1, rounding 0" - "match:float 0, match:workspace w[t1], border_size 0" + window_rule = [ + { match.class = "imv"; float = true; } + { match.class = "feh"; float = true; } + { match.class = "mpv"; float = true; } + { match.title = "Список друзей"; float = true; } + { match.title = "wifitui"; float = true; } + { match.title = "pulsemixer"; float = true; } + { match.title = "clipse"; float = true; } + { match.title = "clipse"; size = [ 622 652 ]; } + { match.focus = true; rounding = 0; } + { + match = { + float = false; + workspace = "w[t1]"; + }; + border_size = 0; + } ]; - exec-once = lib.mkBefore [ - "systemctl --user start plasma-polkit-agent" - "${lib.getExe' pkgs.dbus "dbus-update-activation-environment"} --systemd --all" - "systemctl --user import-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE WAYLAND_DISPLAY DISPLAY GTK_USE_PORTAL QT_QPA_PLATFORMTHEME TDESKTOP_USE_GTK_FILE_DIALOG NIXOS_OZONE_WL ELECTRON_OZONE_PLATFORM_HINT" - "awww-daemon" - "wl-clip-persist --clipboard both" - "clipse -listen" - "${lib.getExe' pkgs.udiskie "udiskie"}" + on = lib.mkBefore [ + (onStart [ + "systemctl --user start plasma-polkit-agent" + "${lib.getExe' pkgs.dbus "dbus-update-activation-environment"} --systemd --all" + "systemctl --user import-environment XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE WAYLAND_DISPLAY DISPLAY GTK_USE_PORTAL QT_QPA_PLATFORMTHEME TDESKTOP_USE_GTK_FILE_DIALOG NIXOS_OZONE_WL ELECTRON_OZONE_PLATFORM_HINT" + "awww-daemon" + "wl-clip-persist --clipboard both" + "clipse -listen" + "${lib.getExe' pkgs.udiskie "udiskie"}" + ]) ]; bind = [ - "$mainMod, V, exec, ghostty --title=clipse -e clipse" + (bind "SUPER + V" (exec "ghostty --title=clipse -e clipse")) + (bind "SUPER + RETURN" (exec "ghostty")) + (bind "SUPER + Q" "hl.dsp.window.close()") + (bind "SUPER + M" "hl.dsp.exit()") + (bind "SUPER + E" (exec "ghostty -e sh -c yazi")) + (bind "SUPER + F" "hl.dsp.window.float({ action = \"toggle\" })") + (bind "SUPER + P" "hl.dsp.window.pseudo({ action = \"toggle\" })") + (bind "SUPER + J" "hl.dsp.layout(\"togglesplit\")") + (bind "SUPER + K" "hl.dsp.layout(\"swapsplit\")") - "$mainMod, Return, exec, ghostty" - "$mainMod, Q, killactive," - "$mainMod, M, exit," - "$mainMod, E, exec, ghostty -e sh -c yazi" - "$mainMod, F, togglefloating," - "$mainMod, P, pseudo, # dwindle" - "$mainMod, J, layoutmsg, togglesplit" - "$mainMod, K, layoutmsg, swapsplit" + (bind "SUPER + LEFT" "hl.dsp.focus({ direction = \"${direction.left}\" })") + (bind "SUPER + RIGHT" "hl.dsp.focus({ direction = \"${direction.right}\" })") + (bind "SUPER + UP" "hl.dsp.focus({ direction = \"${direction.up}\" })") + (bind "SUPER + DOWN" "hl.dsp.focus({ direction = \"${direction.down}\" })") - # Move focus with mainMod + arrow keys - "$mainMod, left, movefocus, l" - "$mainMod, right, movefocus, r" - "$mainMod, up, movefocus, u" - "$mainMod, down, movefocus, d" + (bind "SUPER + SHIFT + LEFT" "hl.dsp.window.swap({ direction = \"${direction.left}\" })") + (bind "SUPER + SHIFT + RIGHT" "hl.dsp.window.swap({ direction = \"${direction.right}\" })") + (bind "SUPER + SHIFT + UP" "hl.dsp.window.swap({ direction = \"${direction.up}\" })") + (bind "SUPER + SHIFT + DOWN" "hl.dsp.window.swap({ direction = \"${direction.down}\" })") - # Moving windows - "$mainMod SHIFT, left, swapwindow, l" - "$mainMod SHIFT, right, swapwindow, r" - "$mainMod SHIFT, up, swapwindow, u" - "$mainMod SHIFT, down, swapwindow, d" + (bind "SUPER + CTRL + LEFT" "hl.dsp.window.resize({ x = -60, y = 0, relative = true })") + (bind "SUPER + CTRL + RIGHT" "hl.dsp.window.resize({ x = 60, y = 0, relative = true })") + (bind "SUPER + CTRL + UP" "hl.dsp.window.resize({ x = 0, y = -60, relative = true })") + (bind "SUPER + CTRL + DOWN" "hl.dsp.window.resize({ x = 0, y = 60, relative = true })") + ] ++ workspaceBinds ++ [ + (bind "SUPER + SHIFT + F" "hl.dsp.window.fullscreen({ action = \"toggle\", mode = \"fullscreen\" })") + (bind "SUPER + mouse_down" "hl.dsp.focus({ workspace = \"e-1\" })") + (bind "SUPER + mouse_up" "hl.dsp.focus({ workspace = \"e+1\" })") - # Window resizing X Y - "$mainMod CTRL, left, resizeactive, -60 0" - "$mainMod CTRL, right, resizeactive, 60 0" - "$mainMod CTRL, up, resizeactive, 0 -60" - "$mainMod CTRL, down, resizeactive, 0 60" + (bind "SUPER + F3" (exec "${lib.getExe pkgs.brightnessctl} -d *::kbd_backlight set +33%")) + (bind "SUPER + F2" (exec "${lib.getExe pkgs.brightnessctl} -d *::kbd_backlight set 33%-")) - # Switch workspaces with mainMod + [0-9] - "$mainMod, 1, workspace, 1" - "$mainMod, 2, workspace, 2" - "$mainMod, 3, workspace, 3" - "$mainMod, 4, workspace, 4" - "$mainMod, 5, workspace, 5" - "$mainMod, 6, workspace, 6" - "$mainMod, 7, workspace, 7" - "$mainMod, 8, workspace, 8" - "$mainMod, 9, workspace, 9" - "$mainMod, 0, workspace, 10" + (bind "XF86AudioMute" (exec "pamixer -t")) + (bind "XF86AudioMicMute" (exec "pamixer --default-source -m")) + (bind "XF86AudioPlay" (exec "${lib.getExe pkgs.playerctl} play-pause")) + (bind "XF86Explorer" (exec "ghostty -e sh -c yazi")) + (bind "XF86Mail" (exec "thunderbird")) + (bind "XF86WWW" (exec "google-chrome-stable")) - # Move active window to a workspace with mainMod + SHIFT + [0-9] - "$mainMod SHIFT, 1, movetoworkspacesilent, 1" - "$mainMod SHIFT, 2, movetoworkspacesilent, 2" - "$mainMod SHIFT, 3, movetoworkspacesilent, 3" - "$mainMod SHIFT, 4, movetoworkspacesilent, 4" - "$mainMod SHIFT, 5, movetoworkspacesilent, 5" - "$mainMod SHIFT, 6, movetoworkspacesilent, 6" - "$mainMod SHIFT, 7, movetoworkspacesilent, 7" - "$mainMod SHIFT, 8, movetoworkspacesilent, 8" - "$mainMod SHIFT, 9, movetoworkspacesilent, 9" - "$mainMod SHIFT, 0, movetoworkspacesilent, 10" + (bind "XF86MonBrightnessDown" (exec "${lib.getExe pkgs.brightnessctl} set 5%-")) + (bind "XF86MonBrightnessUp" (exec "${lib.getExe pkgs.brightnessctl} set +5%")) - "$mainMod SHIFT, F, fullscreen" + (bindWithFlags "XF86AudioRaiseVolume" (exec "pamixer -i 5") { repeating = true; }) + (bindWithFlags "XF86AudioLowerVolume" (exec "pamixer -d 5") { repeating = true; }) - # Scroll through existing workspaces with mainMod + scroll - "$mainMod, mouse_down, workspace, e-1" - "$mainMod, mouse_up, workspace, e+1" + (bindWithFlags "XF86AudioPrev" (exec "${lib.getExe pkgs.playerctl} position 5-") { click = true; }) + (bindWithFlags "XF86AudioNext" (exec "${lib.getExe pkgs.playerctl} position 5+") { click = true; }) + (bindWithFlags "XF86AudioPrev" (exec "${lib.getExe pkgs.playerctl} previous") { long_press = true; }) + (bindWithFlags "XF86AudioNext" (exec "${lib.getExe pkgs.playerctl} next") { long_press = true; }) - # Keyboard backlight - "$mainMod, F3, exec, ${lib.getExe pkgs.brightnessctl} -d *::kbd_backlight set +33%" - "$mainMod, F2, exec, ${lib.getExe pkgs.brightnessctl} -d *::kbd_backlight set 33%-" - - # Volume and Media Control - ", XF86AudioMute, exec, pamixer -t" - ", XF86AudioMicMute, exec, pamixer --default-source -m" - ", XF86AudioPlay, exec, ${lib.getExe pkgs.playerctl} play-pause" - - ", XF86Explorer, exec, ghostty -e sh -c yazi" - ", XF86Mail, exec, thunderbird" - ", XF86WWW, exec, google-chrome-stable" # TODO: Replace hard-code to some variable - - # Brightness control - ", XF86MonBrightnessDown, exec, ${lib.getExe pkgs.brightnessctl} set 5%- " - ", XF86MonBrightnessUp, exec, ${lib.getExe pkgs.brightnessctl} set +5% " - ]; - - binde = [ - ", XF86AudioRaiseVolume, exec, pamixer -i 5 " - ", XF86AudioLowerVolume, exec, pamixer -d 5 " - ]; - - bindc = [ - ", XF86AudioPrev, exec, ${lib.getExe pkgs.playerctl} position 5-" - ", XF86AudioNext, exec, ${lib.getExe pkgs.playerctl} position 5+" - ]; - - bindo = [ - ", XF86AudioPrev, exec, ${lib.getExe pkgs.playerctl} previous" - ", XF86AudioNext, exec, ${lib.getExe pkgs.playerctl} next" - ]; - - # Move/resize windows with mainMod + LMB/RMB and dragging - bindm = [ - "$mainMod, mouse:272, movewindow" - "$mainMod, mouse:273, resizewindow" + (bindWithFlags "SUPER + mouse:272" "hl.dsp.window.drag()" { mouse = true; }) + (bindWithFlags "SUPER + mouse:273" "hl.dsp.window.resize()" { mouse = true; }) ]; }; }; diff --git a/modules/user/hyprland/lua.nix b/modules/user/hyprland/lua.nix new file mode 100644 index 0000000..b704222 --- /dev/null +++ b/modules/user/hyprland/lua.nix @@ -0,0 +1,35 @@ +{ lib }: +let + inline = lib.generators.mkLuaInline; + quote = builtins.toJSON; +in rec { + inherit inline; + + exec = command: "hl.dsp.exec_cmd(${quote command})"; + + bind = keys: dispatcher: { + _args = [ + keys + (inline dispatcher) + ]; + }; + + bindWithFlags = keys: dispatcher: flags: { + _args = [ + keys + (inline dispatcher) + flags + ]; + }; + + onStart = commands: { + _args = [ + "hyprland.start" + (inline ( + "function()\n" + + lib.concatMapStringsSep "\n" (command: " hl.exec_cmd(${quote command})") commands + + "\nend" + )) + ]; + }; +} diff --git a/modules/user/hyprland/zoom.nix b/modules/user/hyprland/zoom.nix index 5bb95aa..99f8deb 100644 --- a/modules/user/hyprland/zoom.nix +++ b/modules/user/hyprland/zoom.nix @@ -1,21 +1,32 @@ -{ - wayland.windowManager.hyprland.settings = { - bind = [ - # "$mainMod, mouse_down, exec, hyprctl -q keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor -j | jq '.float * 1.1')" - # "$mainMod, mouse_up , exec, hyprctl -q keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor -j | jq '(.float * 0.9) | if . < 1 then 1 else . end')" +{ lib, ... }: +let + hyprLua = import ./lua.nix { inherit lib; }; + inherit (hyprLua) bind bindWithFlags; - "$mainMod SHIFT, mouse_up , exec, hyprctl -q keyword cursor:zoom_factor 1" - "$mainMod SHIFT, mouse_down , exec, hyprctl -q keyword cursor:zoom_factor 1" - "$mainMod SHIFT, minus , exec, hyprctl -q keyword cursor:zoom_factor 1" - "$mainMod SHIFT, KP_SUBTRACT, exec, hyprctl -q keyword cursor:zoom_factor 1" - "$mainMod SHIFT, 0 , exec, hyprctl -q keyword cursor:zoom_factor 1" - ]; + resetZoom = ''function() + hl.config({ cursor = { zoom_factor = 1 } }) + end''; - binde = [ - "$mainMod, equal , exec, hyprctl -q keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor -j | jq '.float * 1.1')" - "$mainMod, minus , exec, hyprctl -q keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor -j | jq '(.float * 0.9) | if . < 1 then 1 else . end')" - "$mainMod, KP_ADD , exec, hyprctl -q keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor -j | jq '.float * 1.1')" - "$mainMod, KP_SUBTRACT, exec, hyprctl -q keyword cursor:zoom_factor $(hyprctl getoption cursor:zoom_factor -j | jq '(.float * 0.9) | if . < 1 then 1 else . end')" - ]; - }; -} \ No newline at end of file + zoomIn = ''function() + local current = hl.get_config("cursor.zoom_factor") + hl.config({ cursor = { zoom_factor = current * 1.1 } }) + end''; + + zoomOut = ''function() + local current = hl.get_config("cursor.zoom_factor") + hl.config({ cursor = { zoom_factor = math.max(1, current * 0.9) } }) + end''; +in { + wayland.windowManager.hyprland.settings.bind = [ + (bind "SUPER + SHIFT + mouse_up" resetZoom) + (bind "SUPER + SHIFT + mouse_down" resetZoom) + (bind "SUPER + SHIFT + minus" resetZoom) + (bind "SUPER + SHIFT + KP_SUBTRACT" resetZoom) + (bind "SUPER + SHIFT + 0" resetZoom) + + (bindWithFlags "SUPER + equal" zoomIn { repeating = true; }) + (bindWithFlags "SUPER + minus" zoomOut { repeating = true; }) + (bindWithFlags "SUPER + KP_ADD" zoomIn { repeating = true; }) + (bindWithFlags "SUPER + KP_SUBTRACT" zoomOut { repeating = true; }) + ]; +} diff --git a/modules/user/hyprlock.nix b/modules/user/hyprlock.nix index 3a86119..6a39ecd 100644 --- a/modules/user/hyprlock.nix +++ b/modules/user/hyprlock.nix @@ -1,7 +1,11 @@ { config, pkgs, lib, ... }: - +let + hyprLua = import ./hyprland/lua.nix { inherit lib; }; +in lib.mkIf config.programs.hyprlock.enable { - wayland.windowManager.hyprland.settings.exec-once = [ "hyprlock" ]; + wayland.windowManager.hyprland.settings.on = [ + (hyprLua.onStart [ "hyprlock" ]) + ]; programs.hyprlock = let image = pkgs.fetchurl { diff --git a/modules/user/walker.nix b/modules/user/walker.nix index 542d9c3..48d7614 100644 --- a/modules/user/walker.nix +++ b/modules/user/walker.nix @@ -1,4 +1,7 @@ -{ +{ lib, ... }: +let + hyprLua = import ./hyprland/lua.nix { inherit lib; }; +in { services = { walker = { enable = true; @@ -9,6 +12,6 @@ }; wayland.windowManager.hyprland.settings.bind = [ - "$mainMod, D, exec, walker" + (hyprLua.bind "SUPER + D" (hyprLua.exec "walker")) ]; } diff --git a/modules/user/wob.nix b/modules/user/wob.nix index 55ce7ad..157d0dd 100644 --- a/modules/user/wob.nix +++ b/modules/user/wob.nix @@ -18,6 +18,8 @@ percent="$(${lib.getExe pkgs.brightnessctl} -m | ${lib.getExe' pkgs.coreutils "cut"} -d, -f4 | ${lib.getExe' pkgs.coreutils "tr"} -d '%')" printf '%s brightness\n' "$percent" > ${wobSocket} ''; + + hyprLua = import ./hyprland/lua.nix { inherit lib; }; in { systemd.user = { services.wob.Install.WantedBy = lib.mkForce [ ]; @@ -53,16 +55,23 @@ in { }; }; - wayland.windowManager.hyprland.settings = { - bindel = [ - ", XF86AudioRaiseVolume, exec, ${lib.getExe volumeStep}" - ", XF86AudioLowerVolume, exec, ${lib.getExe volumeStep}" - ", XF86MonBrightnessUp, exec, ${lib.getExe brightnessStep}" - ", XF86MonBrightnessDown, exec, ${lib.getExe brightnessStep}" - ]; - - bind = [ - ", XF86AudioMute, exec, ${lib.getExe volumeStep} mute" - ]; - }; + wayland.windowManager.hyprland.settings.bind = [ + (hyprLua.bindWithFlags "XF86AudioRaiseVolume" (hyprLua.exec "${lib.getExe volumeStep}") { + repeating = true; + locked = true; + }) + (hyprLua.bindWithFlags "XF86AudioLowerVolume" (hyprLua.exec "${lib.getExe volumeStep}") { + repeating = true; + locked = true; + }) + (hyprLua.bindWithFlags "XF86MonBrightnessUp" (hyprLua.exec "${lib.getExe brightnessStep}") { + repeating = true; + locked = true; + }) + (hyprLua.bindWithFlags "XF86MonBrightnessDown" (hyprLua.exec "${lib.getExe brightnessStep}") { + repeating = true; + locked = true; + }) + (hyprLua.bind "XF86AudioMute" (hyprLua.exec "${lib.getExe volumeStep} mute")) + ]; } diff --git a/modules/user/yazi.nix b/modules/user/yazi.nix index df81ad4..ff74bc3 100644 --- a/modules/user/yazi.nix +++ b/modules/user/yazi.nix @@ -188,10 +188,22 @@ in { Exec=${lib.getExe fileManager1} ''; - wayland.windowManager.hyprland.settings.windowrule = [ - "match:class dragon-drop, move cursor_x-window_w/2 cursor_y-window_h/2" - "match:title Yazi File Picker, float 1" - "match:title Yazi File Picker, size 1200 800" + wayland.windowManager.hyprland.settings.window_rule = [ + { + match.class = "dragon-drop"; + move = [ + "(cursor_x-(window_w*0.5))" + "(cursor_y-(window_h*0.5))" + ]; + } + { + match.title = "Yazi File Picker"; + float = true; + } + { + match.title = "Yazi File Picker"; + size = [ 1200 800 ]; + } ]; programs.yazi = { diff --git a/user/chest/modules/hyprland.nix b/user/chest/modules/hyprland.nix index 5ee382c..239e0ee 100644 --- a/user/chest/modules/hyprland.nix +++ b/user/chest/modules/hyprland.nix @@ -1,16 +1,22 @@ -{ pkgs, lib, config, inputs, ... }: { - wayland.windowManager.hyprland = let - colors = config.lib.stylix.colors; - accent = colors.${config.stylix.accent}; - in { - settings = { +{ pkgs, lib, config, ... }: +let + colors = config.lib.stylix.colors; + accent = colors.${config.stylix.accent}; + hyprLua = import ../../../modules/user/hyprland/lua.nix { inherit lib; }; +in { + wayland.windowManager.hyprland.settings = { + config = { general = { gaps_in = 5; gaps_out = 5; border_size = 2; - "col.active_border" = "rgba(${accent}ee) rgba(${colors.base0C}ee) 45deg"; - "col.inactive_border" = "rgba(${colors.base05}aa)"; - + "col.active_border" = lib.mkForce { + colors = [ + "rgba(${accent}ee)" + "rgba(${colors.base0C}ee)" + ]; + angle = 45; + }; layout = "dwindle"; }; @@ -32,25 +38,9 @@ }; }; - animations = { - enabled = true; - - bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; - - animation = [ - "windows, 1, 7, myBezier" - "windowsOut, 1, 7, default, popin 80%" - "border, 1, 10, default" - "borderangle, 1, 8, default" - "fade, 1, 7, default" - "workspaces, 1, 6, default" - ]; - }; - - dwindle = { - smart_split = true; - }; + animations.enabled = true; + dwindle.smart_split = true; master.new_status = "master"; misc = { @@ -58,10 +48,32 @@ animate_mouse_windowdragging = true; enable_swallow = true; }; + }; - bind = [ - ''$mainMod Shift, S, exec, ${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp})" - | ${lib.getExe pkgs.swappy} -f -'' + curve = { + _args = [ + "myBezier" + { + type = "bezier"; + points = [ + [ 0.05 0.9 ] + [ 0.1 1.05 ] + ]; + } ]; }; + + animation = [ + { leaf = "windows"; enabled = true; speed = 7; bezier = "myBezier"; } + { leaf = "windowsOut"; enabled = true; speed = 7; bezier = "default"; style = "popin 80%"; } + { leaf = "border"; enabled = true; speed = 10; bezier = "default"; } + { leaf = "borderangle"; enabled = true; speed = 8; bezier = "default"; } + { leaf = "fade"; enabled = true; speed = 7; bezier = "default"; } + { leaf = "workspaces"; enabled = true; speed = 6; bezier = "default"; } + ]; + + bind = [ + (hyprLua.bind "SUPER + SHIFT + S" (hyprLua.exec ''${lib.getExe pkgs.grim} -g "$(${lib.getExe pkgs.slurp})" - | ${lib.getExe pkgs.swappy} -f -'')) + ]; }; } diff --git a/user/sweetbread/modules/hyprland.nix b/user/sweetbread/modules/hyprland.nix index a9e64bb..04d76d8 100644 --- a/user/sweetbread/modules/hyprland.nix +++ b/user/sweetbread/modules/hyprland.nix @@ -2,6 +2,7 @@ wayland.windowManager.hyprland = let colors = config.lib.stylix.colors; accent = colors.${config.stylix.accent}; + hyprLua = import ../../../modules/user/hyprland/lua.nix { inherit lib; }; wallpaper_changer = pkgs.writers.writePython3Bin "wallpaper_changer" { libraries = [ pkgs.python3Packages.requests ]; @@ -126,69 +127,83 @@ ''; in { settings = { - general = { - gaps_in = 2; - gaps_out = 10; - border_size = 3; - "col.active_border" = lib.mkForce "rgba(${colors.base0C}aa) rgba(${accent}aa) 45deg"; - - layout = "dwindle"; - }; - - decoration = { - rounding = 10; - - blur = { - enabled = true; - size = 16; - passes = 2; - new_optimizations = true; + config = { + general = { + gaps_in = 2; + gaps_out = 10; + border_size = 3; + "col.active_border" = lib.mkForce { + colors = [ + "rgba(${colors.base0C}aa)" + "rgba(${accent}aa)" + ]; + angle = 45; + }; + layout = "dwindle"; }; - shadow.enabled = false; + decoration = { + rounding = 10; + + blur = { + enabled = true; + size = 16; + passes = 2; + new_optimizations = true; + }; + + shadow.enabled = false; + }; + + animations.enabled = true; + dwindle.smart_split = true; + master.new_status = "master"; + + misc = { + animate_manual_resizes = true; + animate_mouse_windowdragging = true; + enable_swallow = true; + }; }; - animations = { - enabled = true; - - bezier = "myBezier, 0.05, 0.9, 0.1, 1.05"; - - animation = [ - "windows, 1, 7, myBezier" - "windowsOut, 1, 7, default, popin 80%" - "border, 1, 10, default" - "borderangle, 1, 8, default" - "fade, 1, 7, default" - "workspaces, 1, 6, default" + curve = { + _args = [ + "myBezier" + { + type = "bezier"; + points = [ + [ 0.05 0.9 ] + [ 0.1 1.05 ] + ]; + } ]; }; - dwindle = { - smart_split = true; - }; - - master.new_status = "master"; - - misc = { - animate_manual_resizes = true; - animate_mouse_windowdragging = true; - enable_swallow = true; - }; - - exec-once = [ - "${lib.getExe wallpaper_changer}" + animation = [ + { leaf = "windows"; enabled = true; speed = 7; bezier = "myBezier"; } + { leaf = "windowsOut"; enabled = true; speed = 7; bezier = "default"; style = "popin 80%"; } + { leaf = "border"; enabled = true; speed = 10; bezier = "default"; } + { leaf = "borderangle"; enabled = true; speed = 8; bezier = "default"; } + { leaf = "fade"; enabled = true; speed = 7; bezier = "default"; } + { leaf = "workspaces"; enabled = true; speed = 6; bezier = "default"; } ]; - workspace = [ - "2, layout:scrolling" + on = [ + (hyprLua.onStart [ "${lib.getExe wallpaper_changer}" ]) + ]; + + workspace_rule = [ + { + workspace = "2"; + layout = "scrolling"; + } ]; bind = [ - " , Print, exec, ${lib.getExe pkgs.hyprshot} -z -o ~/Screenshots -m active -m output" - "CTRL, Print, exec, ${lib.getExe pkgs.hyprshot} -z -o ~/Screenshots -m region" - "ALT , Print, exec, ${lib.getExe pkgs.hyprshot} -z -o ~/Screenshots -m active -m window" - - "$mainMod, W, exec, ${lib.getExe wallpaper_changer}" + (hyprLua.bind "Print" (hyprLua.exec "${lib.getExe pkgs.hyprshot} -z -o ~/Screenshots -m active -m output")) + (hyprLua.bind "CTRL + Print" (hyprLua.exec "${lib.getExe pkgs.hyprshot} -z -o ~/Screenshots -m region")) + (hyprLua.bind "ALT + Print" (hyprLua.exec "${lib.getExe pkgs.hyprshot} -z -o ~/Screenshots -m active -m window")) + (hyprLua.bind "SUPER + W" (hyprLua.exec "${lib.getExe wallpaper_changer}")) ]; }; }; diff --git a/user/sweetbread/modules/waybar.nix b/user/sweetbread/modules/waybar.nix index 189f50c..8e85421 100644 --- a/user/sweetbread/modules/waybar.nix +++ b/user/sweetbread/modules/waybar.nix @@ -343,7 +343,10 @@ in builtins.readFile cssFile; }; - wayland.windowManager.hyprland.settings.layerrule = [ - "blur on, match:namespace waybar" + wayland.windowManager.hyprland.settings.layer_rule = [ + { + match.namespace = "waybar"; + blur = true; + } ]; }