From 217e0d882688d46b3b88e2684b34ef36f19a2cdf Mon Sep 17 00:00:00 2001 From: Chris Cochrun Date: Thu, 20 Feb 2025 12:27:52 -0600 Subject: [PATCH] adding better zoom --- home/modules/hyprland.nix | 3 +++ scripts/zoomin | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/home/modules/hyprland.nix b/home/modules/hyprland.nix index e35fd22..08c02bb 100644 --- a/home/modules/hyprland.nix +++ b/home/modules/hyprland.nix @@ -263,6 +263,9 @@ in ",Print,exec,screenshot" "SUPERSHIFT,mouse_down,exec,zoomin in" "SUPERSHIFT,mouse_up,exec,zoomin out" + "SUPERALT,r,exec,zoomin in" + "SUPERALT,m,exec,zoomin out" + "SUPERALT,f,exec,hyprctl keyword cursor:zoom_factor 1.0" "SUPER,P,exec,/home/chris/bin/rbw.sh" "SUPER,M,fullscreen,1" diff --git a/scripts/zoomin b/scripts/zoomin index 34ce74d..71779b3 100755 --- a/scripts/zoomin +++ b/scripts/zoomin @@ -4,7 +4,7 @@ (defparameter output (with-output-to-string (out) (run-program "hyprctl" - '("getoption" "misc:cursor_zoom_factor") + '("getoption" "cursor:zoom_factor") :search "/run/current-system/sw/bin/" :output out) out)) @@ -19,14 +19,14 @@ (car (parse-string-to-float (subseq output (+ (search "float: " output) 7) (+ (search "float: " output) 13))))) -(defparameter increment (+ zoom 0.1)) -(defparameter decrement (- zoom 0.1)) +(defparameter increment (+ zoom 0.3)) +(defparameter decrement (- zoom 0.3)) (if (member "in" (uiop:command-line-arguments) :test #'string=) - (run-program "hyprctl" `("keyword" "misc:cursor_zoom_factor" ,(write-to-string increment)) + (run-program "hyprctl" `("keyword" "cursor:zoom_factor" ,(write-to-string increment)) :search "/run/current-system/sw/bin/" :output *standard-output*) (if (member "out" (uiop:command-line-arguments) :test #'string=) - (run-program "hyprctl" `("keyword" "misc:cursor_zoom_factor" ,(write-to-string decrement)) + (run-program "hyprctl" `("keyword" "cursor:zoom_factor" ,(write-to-string decrement)) :search "/run/current-system/sw/bin/" :output *standard-output*)))