adding zoomin into scripts
This commit is contained in:
parent
8b481e4109
commit
b34c81f801
|
@ -158,6 +158,7 @@ in
|
||||||
bind = SUPER,A,exec,alacritty --class pulsemixer -e pulsemixer
|
bind = SUPER,A,exec,alacritty --class pulsemixer -e pulsemixer
|
||||||
bind = SUPERCTRL,i,exec,alacritty --class btop -e btm
|
bind = SUPERCTRL,i,exec,alacritty --class btop -e btm
|
||||||
bind = ,Print,exec,screenshot
|
bind = ,Print,exec,screenshot
|
||||||
|
bind = SUPERSHIFT,mouse_down,exec,zoomin
|
||||||
|
|
||||||
bind = SUPER,P,exec,/home/chris/bin/rbw.sh
|
bind = SUPER,P,exec,/home/chris/bin/rbw.sh
|
||||||
bind = SUPER,M,fullscreen,1
|
bind = SUPER,M,fullscreen,1
|
||||||
|
|
32
scripts/zoomin
Executable file
32
scripts/zoomin
Executable file
|
@ -0,0 +1,32 @@
|
||||||
|
#!/usr/bin/env -S sbcl --script
|
||||||
|
(require "uiop")
|
||||||
|
(defparameter output
|
||||||
|
(with-output-to-string (out)
|
||||||
|
(run-program "hyprctl"
|
||||||
|
'("getoption" "misc:cursor_zoom_factor")
|
||||||
|
:search "/run/current-system/sw/bin/"
|
||||||
|
:output out)
|
||||||
|
out))
|
||||||
|
|
||||||
|
(defun parse-string-to-float (string)
|
||||||
|
(let ((*read-eval* nil))
|
||||||
|
(with-input-from-string (stream string)
|
||||||
|
(loop for number = (read stream nil nil)
|
||||||
|
while number collect number))))
|
||||||
|
|
||||||
|
(defparameter zoom
|
||||||
|
(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))
|
||||||
|
|
||||||
|
(if (member "in" (uiop:command-line-arguments) :test #'string=)
|
||||||
|
(run-program "hyprctl" `("keyword" "misc: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))
|
||||||
|
:search "/run/current-system/sw/bin/"
|
||||||
|
:output *standard-output*)))
|
||||||
|
;; -*-lisp-*-
|
Loading…
Reference in a new issue