🦥 Hypridle suspend and refactor
This commit is contained in:
parent
7b3a5b13ea
commit
a5da3d0924
@ -1,25 +1,36 @@
|
|||||||
{ ... }:
|
{ ... }:
|
||||||
|
let
|
||||||
|
# Time in seconds
|
||||||
|
lockAfter = 1200;
|
||||||
|
suspendAfter = 7200;
|
||||||
|
in
|
||||||
{
|
{
|
||||||
services.hypridle = {
|
services.hypridle = {
|
||||||
enable = true;
|
enable = true;
|
||||||
settings = {
|
settings = {
|
||||||
general = {
|
general = {
|
||||||
|
before_sleep_cmd = "loginctl lock-session";
|
||||||
after_sleep_cmd = "hyprctl dispatch dpms on";
|
after_sleep_cmd = "hyprctl dispatch dpms on";
|
||||||
ignore_dbus_inhibit = false;
|
|
||||||
lock_cmd = "pidof hyprlock || hyprlock"; # Avoid running multiple instances of hyprlock
|
lock_cmd = "pidof hyprlock || hyprlock"; # Avoid running multiple instances of hyprlock
|
||||||
};
|
};
|
||||||
|
|
||||||
listener = [
|
listener = [
|
||||||
|
# Lock
|
||||||
{
|
{
|
||||||
timeout = 900; # 15 min
|
timeout = lockAfter;
|
||||||
on-timeout = "hyprlock";
|
on-timeout = "loginctl lock-session";
|
||||||
}
|
}
|
||||||
|
# Turn off screens TODO buggy main monitor, turns off and on after resume
|
||||||
# {
|
# {
|
||||||
# timeout = 1200;
|
# timeout = 120;
|
||||||
# on-timeout = "hyprctl dispatch dpms off";
|
# on-timeout = "hyprctl dispatch dpms off";
|
||||||
# on-resume = "hyprctl dispatch dpms on";
|
# on-resume = "hyprctl dispatch dpms on";
|
||||||
# }
|
# }
|
||||||
|
# Suspend
|
||||||
|
{
|
||||||
|
timeout = suspendAfter;
|
||||||
|
on-timeout = "systemctl suspend"; # suspend pc
|
||||||
|
}
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -392,3 +392,8 @@ windowrulev2 = suppressevent maximize, class:.*
|
|||||||
|
|
||||||
# Fix some dragging issues with XWayland
|
# Fix some dragging issues with XWayland
|
||||||
windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
|
windowrulev2 = nofocus,class:^$,title:^$,xwayland:1,floating:1,fullscreen:0,pinned:0
|
||||||
|
|
||||||
|
# Avoid locking in fullscreen
|
||||||
|
windowrulev2 = idleinhibit fullscreen, class:^(*)$
|
||||||
|
windowrulev2 = idleinhibit fullscreen, title:^(*)$
|
||||||
|
windowrulev2 = idleinhibit fullscreen, fullscreen:1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user