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:
parent
8175cf443a
commit
20768edcf6
@ -38,6 +38,6 @@ firefox_config:
|
||||
privacy.fingerprintingProtection: true
|
||||
# Allow sending dark mode preference to websites.
|
||||
# Allow sending timezone to websites.
|
||||
privacy.fingerprintingProtection.overrides: "+AllTargets,-CSSPrefersColorScheme,-JSDateTimeUTC"
|
||||
privacy.fingerprintingProtection.overrides: "+AllTargets,-CSSPrefersColorScheme,-JSDateTimeUTC,-CanvasExtractionBeforeUserInputIsBlocked"
|
||||
# Disable weather on new tab page
|
||||
browser.newtabpage.activity-stream.showWeather: false
|
||||
|
@ -1,5 +1,13 @@
|
||||
#options iwlwifi power_save=1
|
||||
# Manually disable power save:
|
||||
# iw wlan0 set power_save off
|
||||
|
||||
#options iwlwifi uapsd_disable=0
|
||||
## High power:
|
||||
options iwlwifi power_save=0
|
||||
# options iwlwifi uapsd_disable=1
|
||||
options iwlmvm power_scheme=1 # 1-active, 2-balanced, 3-low power, default: 2 (int)
|
||||
|
||||
#options iwlmvm power_scheme=3
|
||||
## Low power:
|
||||
# options iwlwifi power_save=1
|
||||
# ? power_level:default power save level (range from 1 - 5, default: 1) (int)
|
||||
# options iwlwifi uapsd_disable=0
|
||||
# options iwlmvm power_scheme=3
|
||||
|
@ -48,6 +48,6 @@
|
||||
"exec": "waybar_night_mode",
|
||||
"return-type": "json",
|
||||
"restart-interval": 30,
|
||||
"on-click": "pkill --signal USR1 -f waybar_night_mode"
|
||||
"on-click": "pkill -USR1 -f waybar_night_mode"
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user