updates to tiling

This commit is contained in:
Sean Kovacs 2025-12-13 12:09:17 -05:00
commit 53973bbfb1
Signed by: sckova
GPG key ID: 00F325187C68651A
8 changed files with 122 additions and 13 deletions

View file

@ -0,0 +1,29 @@
#!/usr/bin/env bash
WAYBAR_SIGNAL=8 # SIGRTMIN+8
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <integer -100..100>" >&2
exit 1
fi
value="$1"
# Validate integer range
if ! [[ "$value" =~ ^-?[0-9]+$ ]] || [ "$value" -lt -100 ] || [ "$value" -gt 100 ]; then
echo "Error: argument must be an integer between -100 and 100" >&2
exit 1
fi
# Apply brightness change with correct syntax
if [ "$value" -gt 0 ]; then
brightnessctl s "+${value}%" >/dev/null
elif [ "$value" -lt 0 ]; then
brightnessctl s "${value#-}%-" >/dev/null
else
: # no-op for 0
fi
# Notify Waybar to refresh
pkill -RTMIN+"$WAYBAR_SIGNAL" waybar