improve eww

This commit is contained in:
2026-09-10 19:54:50 +02:00
parent e551d36e1c
commit 7bb27f9373
46 changed files with 1296 additions and 1092 deletions
@@ -1,13 +1,22 @@
#!/usr/bin/env bash
case "$1" in
status)
pgrep -x wlsunset >/dev/null 2>&1 && echo true || echo false
;;
# Toggle wlsunset. It runs as the transient user unit eww-nightlight, so it
# survives eww restarts and can be stopped by name.
unit=eww-nightlight
active() { systemctl --user is-active --quiet "$unit" || pgrep -x wlsunset >/dev/null; }
case ${1:-} in
status) active && echo true || echo false ;;
*)
if pgrep -x wlsunset >/dev/null 2>&1; then
pkill -x wlsunset && echo false
if active; then
systemctl --user stop "$unit" 2>/dev/null
pkill -x wlsunset
state=false
else
wlsunset -T 4500 -t 3200 & echo true
detach -u "$unit" wlsunset -T 4500 -t 3200
state=true
fi
eww update night-light="$state" 2>/dev/null
echo "$state"
;;
esac