From 44d33527ed8025448f71c5c6781910df5097a7e0 Mon Sep 17 00:00:00 2001 From: Ergotu Date: Sun, 26 May 2024 19:58:32 +0200 Subject: [PATCH] add more config --- .../usr/share/hyprland/configs/exec.conf | 3 +- config/files/usr/share/hyprland/hypridle.conf | 36 ++++++++++--------- 2 files changed, 21 insertions(+), 18 deletions(-) diff --git a/config/files/usr/share/hyprland/configs/exec.conf b/config/files/usr/share/hyprland/configs/exec.conf index 532ba8e..c045c82 100644 --- a/config/files/usr/share/hyprland/configs/exec.conf +++ b/config/files/usr/share/hyprland/configs/exec.conf @@ -1,6 +1,5 @@ - exec-once = waybar exec-once = /usr/lib/lxpolkit exec-once = dunst exec-once = nm-applet -exec-once = swayidle -w timeout 600 "$lockCommand" \ No newline at end of file +exec-once = hypridle -c /usr/share/hyprland/hypridle.conf \ No newline at end of file diff --git a/config/files/usr/share/hyprland/hypridle.conf b/config/files/usr/share/hyprland/hypridle.conf index cbc9552..d430ada 100644 --- a/config/files/usr/share/hyprland/hypridle.conf +++ b/config/files/usr/share/hyprland/hypridle.conf @@ -1,30 +1,34 @@ general { - lock_cmd=hyprlock - before_sleep_cmd=pgrep hyprlock || hyprlock + lock_cmd = pidof hyprlock || hyprlock -c /usr/share/hyprland/hyprlock.conf # avoid starting multiple hyprlock instances. + before_sleep_cmd = loginctl lock-session # lock before suspend. + after_sleep_cmd = hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. } -#Suspend system if running on Battery listener { - timeout=300 - on-timeout = export bat=$(ls /sys/class/power_supply | grep -m 1 "BAT") && if [[ "$(cat /sys/class/power_supply/$bat/status)" == "Discharging" ]]; then systemctl suspend; fi + timeout = 150 # 2.5min. + on-timeout = brightnessctl -s set 10 # set monitor backlight to minimum, avoid 0 on OLED monitor. + on-resume = brightnessctl -r # monitor backlight restore. +} + +# turn off keyboard backlight, comment out this section if you dont have a keyboard backlight. +listener { + timeout = 150 # 2.5min. + on-timeout = brightnessctl -sd rgb:kbd_backlight set 0 # turn off keyboard backlight. + on-resume = brightnessctl -rd rgb:kbd_backlight # turn on keyboard backlight. } -#Lock idle session listener { - timeout = 600 - on-timeout = loginctl lock-session - on-resume = loginctl unlock-session && hyprctl dispatch dpms on + timeout = 300 # 5min + on-timeout = loginctl lock-session # lock screen when timeout has passed } -#Sleep monitors listener { - timeout = 660 - on-timeout = hyprctl dispatch dpms off - on-resume = hyprctl dispatch dpms on + timeout = 330 # 5.5min + on-timeout = hyprctl dispatch dpms off # screen off when timeout has passed + on-resume = hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired. } -#Suspend after extended idle listener { - timeout = 10800 - on-timeout = systemctl suspend + timeout = 1800 # 30min + on-timeout = systemctl suspend # suspend pc } \ No newline at end of file