From ec6558a6eeda6fc60fe1c341c0ed568054828e82 Mon Sep 17 00:00:00 2001 From: Sweetbread Date: Sun, 22 Mar 2026 05:30:17 +0300 Subject: [PATCH] hyprland: add zoom --- host/Rias/modules/hyprland.nix | 5 +++++ modules/user/hyprland.nix | 4 +++- modules/user/hyprland/zoom.nix | 21 +++++++++++++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 modules/user/hyprland/zoom.nix diff --git a/host/Rias/modules/hyprland.nix b/host/Rias/modules/hyprland.nix index 0f272b7..d6ff8b0 100644 --- a/host/Rias/modules/hyprland.nix +++ b/host/Rias/modules/hyprland.nix @@ -39,6 +39,11 @@ ''$mainMod, F2, exec, ${lib.getExe monitor-switcher} mirror'' ''$mainMod, F3, exec, ${lib.getExe monitor-switcher}'' ]; + + workspace = [ + "2, layout:scrolling" + "4, layout:monocle" + ]; }; }; } \ No newline at end of file diff --git a/modules/user/hyprland.nix b/modules/user/hyprland.nix index a759558..87b8d32 100644 --- a/modules/user/hyprland.nix +++ b/modules/user/hyprland.nix @@ -2,7 +2,9 @@ optImport = path: lib.optional (builtins.pathExists path) path; hostname = osConfig.networking.hostName; in { - imports = + imports = [ + ./hyprland/zoom.nix + ] ++ optImport ../../host/${hostname}/modules/hyprland.nix ++ optImport ../../user/${username}/modules/hyprland.nix; diff --git a/modules/user/hyprland/zoom.nix b/modules/user/hyprland/zoom.nix new file mode 100644 index 0000000..5bb95aa --- /dev/null +++ b/modules/user/hyprland/zoom.nix @@ -0,0 +1,21 @@ +{ + 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')" + + "$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" + ]; + + 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