1
1
Fork 0
nixos/options/custom/scripts/zoom.sh
Myned 2baa20b478
zoom: initial script
Signed-off-by: Myned <dev@bjork.tech>
2024-09-24 11:01:49 -05:00

22 lines
618 B
Bash

#! /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"