zoom: initial script
Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
parent
9c23eb9460
commit
2baa20b478
2 changed files with 28 additions and 0 deletions
|
@ -166,6 +166,12 @@ in {
|
||||||
swww
|
swww
|
||||||
tailscale
|
tailscale
|
||||||
])
|
])
|
||||||
|
(bash "zoom" [
|
||||||
|
argc
|
||||||
|
bc
|
||||||
|
hyprland
|
||||||
|
jq
|
||||||
|
])
|
||||||
]
|
]
|
||||||
++ (with pkgs.python3Packages; [
|
++ (with pkgs.python3Packages; [
|
||||||
# Python files with extension .py
|
# Python files with extension .py
|
||||||
|
|
22
options/custom/scripts/zoom.sh
Normal file
22
options/custom/scripts/zoom.sh
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#! /usr/bin/env bash
|
||||||
|
|
||||||
|
# @describe Wrapper for zooming display
|
||||||
|
#
|
||||||
|
# https://github.com/sigoden/argc
|
||||||
|
|
||||||
|
# @arg factor=1 Absolute or relative factor to zoom to, empty to reset
|
||||||
|
|
||||||
|
eval "$(argc --argc-eval "$0" "$@")"
|
||||||
|
|
||||||
|
factor="$(hyprctl -j getoption cursor:zoom_factor | jq -r .float)" # Current factor
|
||||||
|
|
||||||
|
if [[ "${argc_factor:-}" =~ ^[+|-][1-9]\.*[0-9]*$ ]]; then
|
||||||
|
factor="$(bc <<< "$factor ${argc_factor}")"
|
||||||
|
elif [[ "${argc_factor:-}" =~ ^[1-9]\.*[0-9]*$ ]]; then
|
||||||
|
factor="${argc_factor:-}"
|
||||||
|
else
|
||||||
|
echo "Factor must be an absolute or relative decimal between 1 and 9"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
hyprctl keyword cursor:zoom_factor "$factor"
|
Loading…
Reference in a new issue