Skip to content

Commit

Permalink
add more config
Browse files Browse the repository at this point in the history
  • Loading branch information
Ergotu committed May 26, 2024
1 parent 555d00c commit 44d3352
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
3 changes: 1 addition & 2 deletions config/files/usr/share/hyprland/configs/exec.conf
Original file line number Diff line number Diff line change
@@ -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"
exec-once = hypridle -c /usr/share/hyprland/hypridle.conf
36 changes: 20 additions & 16 deletions config/files/usr/share/hyprland/hypridle.conf
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 44d3352

Please sign in to comment.