Fix night mode signal handling.
Now the script works on both FreeBSD and Linux, and it exits properly so switching between docked and undocked doesn't cause problems for waybar.
This commit is contained in:
@@ -21,7 +21,7 @@ function cleanup {
|
||||
kill "$wlsunset_pid"
|
||||
true
|
||||
}
|
||||
for sig in EXIT INT QUIT HUP TERM; do
|
||||
for sig in EXIT; do
|
||||
trap "set +e; cleanup" "$sig"
|
||||
done
|
||||
|
||||
@@ -85,7 +85,7 @@ function handle_click {
|
||||
log "Setting night mode to force-night."
|
||||
night_mode_mode="on"
|
||||
fi
|
||||
kill -USR1 "$wlsunset_pid"
|
||||
kill -s SIGUSR1 "$wlsunset_pid"
|
||||
}
|
||||
|
||||
trap "handle_click" SIGUSR1
|
||||
|
||||
Reference in New Issue
Block a user