1
1
Fork 0

zoom: initial script

Signed-off-by: Myned <dev@bjork.tech>
This commit is contained in:
Myned 2024-09-24 11:01:49 -05:00
parent 9c23eb9460
commit 2baa20b478
Signed by: myned
GPG key ID: C7224454F7881A34
2 changed files with 28 additions and 0 deletions

View file

@ -166,6 +166,12 @@ in {
swww
tailscale
])
(bash "zoom" [
argc
bc
hyprland
jq
])
]
++ (with pkgs.python3Packages; [
# Python files with extension .py

View 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"