diff --git a/bin/omarchy-system-idle b/bin/omarchy-system-idle new file mode 100755 index 00000000..1ea458ea --- /dev/null +++ b/bin/omarchy-system-idle @@ -0,0 +1,17 @@ +#!/bin/bash + +# omarchy:summary=Lock the screen from idle and turn the display off after a delay +# omarchy:group=system +# omarchy:name=idle +# omarchy:examples=omarchy system idle + +if ! loginctl lock-session; then + omarchy-system-lock +fi + +( + sleep 10 + pidof hyprlock >/dev/null || exit 0 + brightnessctl -sd '*::kbd_backlight' set 0 >/dev/null 2>&1 + hyprctl dispatch dpms off >/dev/null 2>&1 +) & diff --git a/bin/omarchy-system-idle-resume b/bin/omarchy-system-idle-resume new file mode 100755 index 00000000..d1ce990f --- /dev/null +++ b/bin/omarchy-system-idle-resume @@ -0,0 +1,10 @@ +#!/bin/bash + +# omarchy:summary=Resume displays and brightness after idle +# omarchy:group=system +# omarchy:name=idle resume +# omarchy:examples=omarchy system idle resume + +hyprctl dispatch dpms on >/dev/null 2>&1 +brightnessctl -r >/dev/null 2>&1 +brightnessctl -rd '*::kbd_backlight' >/dev/null 2>&1 diff --git a/config/hypr/hypridle.conf b/config/hypr/hypridle.conf index 7d003275..fab950a4 100644 --- a/config/hypr/hypridle.conf +++ b/config/hypr/hypridle.conf @@ -5,24 +5,15 @@ general { inhibit_sleep = 3 # wait until screen is locked } +# Start screensaver after 2.5 minutes listener { - timeout = 150 # 2.5min - on-timeout = pidof hyprlock || omarchy-launch-screensaver # start screensaver (if we haven't locked already) + timeout = 150 + on-timeout = pidof hyprlock || omarchy-launch-screensaver } +# Idle system after 5 minutes listener { - timeout = 151 # 5min - on-timeout = loginctl lock-session # lock screen when timeout has passed -} - -listener { - timeout = 330 # 5.5min - on-timeout = brightnessctl -sd '*::kbd_backlight' set 0 # save state and turn off keyboard backlight - on-resume = brightnessctl -rd '*::kbd_backlight' # restore keyboard backlight -} - -listener { - timeout = 330 # 5.5min - on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed - on-resume = hyprctl dispatch dpms on && brightnessctl -r # screen on when activity is detected + timeout = 152 + on-timeout = omarchy-system-idle + on-resume = omarchy-system-idle-resume } diff --git a/migrations/1778054328.sh b/migrations/1778054328.sh new file mode 100644 index 00000000..b7b15fd3 --- /dev/null +++ b/migrations/1778054328.sh @@ -0,0 +1,3 @@ +echo "Use omarchy-system-idle and omarchy-system-idle-resume in hypridle" + +omarchy-refresh-hypridle