nixos-configs/config/ags/bin/qs-toggle.sh

38 lines
519 B
Bash
Raw Normal View History

2023-09-05 15:10:25 -04:00
#!/usr/bin/env bash
on () {
eww open quick-settings-reveal;
eww update showqs=true;
}
off () {
eww update showqs=false;
eww close quick-settings-reveal;
}
toggle() {
if [[ $(eww get showqs) == "true" ]]; then
echo "Off"
off > /dev/null
else
echo "On"
on > /dev/null
fi
}
state() {
if [[ $(eww get showqs) == "true" ]]; then
echo "Off"
else
echo "On"
fi
}
[[ "$1" == "toggle" ]] && toggle
if [[ "$1" == "state" ]]; then
while true; do
state
sleep 1
done
fi