mirror of
https://github.com/arthur-pbty/arthur-os.git
synced 2026-08-01 20:28:16 +02:00
Some users may choose to disable notification timeout for normal-level notifications to ensure no notifications are missed when the user is away from the screen. However, there are several Omarchy notifications that only serve as an immediate feedback for a user action, such as "Screensaver enabled" or "Editing config file foo.conf", for which disabling the timeout is not desirable. This commit drops the urgency level for such notification to low, allowing configuring a different timeout value for them. Notifications with an explicitly set timeout are excluded from this commit.
31 lines
828 B
Bash
Executable File
31 lines
828 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Default temperature values
|
|
ON_TEMP=4000
|
|
OFF_TEMP=6000
|
|
|
|
# Ensure hyprsunset is running
|
|
if ! pgrep -x hyprsunset; then
|
|
setsid uwsm-app -- hyprsunset &
|
|
sleep 1 # Give it time to register
|
|
fi
|
|
|
|
# Query the current temperature
|
|
CURRENT_TEMP=$(hyprctl hyprsunset temperature 2>/dev/null | grep -oE '[0-9]+')
|
|
|
|
restart_nightlighted_waybar() {
|
|
if grep -q "custom/nightlight" ~/.config/waybar/config.jsonc; then
|
|
omarchy-restart-waybar # restart waybar in case user has waybar module for hyprsunset
|
|
fi
|
|
}
|
|
|
|
if [[ $CURRENT_TEMP == $OFF_TEMP ]]; then
|
|
hyprctl hyprsunset temperature $ON_TEMP
|
|
notify-send -u low " Nightlight screen temperature"
|
|
restart_nightlighted_waybar
|
|
else
|
|
hyprctl hyprsunset temperature $OFF_TEMP
|
|
notify-send -u low " Daylight screen temperature"
|
|
restart_nightlighted_waybar
|
|
fi
|