mirror of
https://github.com/librephoenix/nixos-config
synced 2025-01-19 07:05:51 +05:30
Fixed my usb hub crashing systemctl suspend
This commit is contained in:
parent
b6a9b4e11f
commit
f93d400ad9
|
@ -19,6 +19,35 @@
|
||||||
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
|
"L+ /opt/rocm/hip - - - - ${pkgs.rocmPackages.clr}"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
# my stupid usb hub crashes systemct suspend half of the time now
|
||||||
|
# https://wiki.archlinux.org/title/Power_management/Suspend_and_hibernate#Sleep_hooks
|
||||||
|
systemd.services.root-suspend = {
|
||||||
|
enable = true;
|
||||||
|
description = "Root systemd suspend prehook";
|
||||||
|
unitConfig = {
|
||||||
|
Description = "Root systemd suspend prehook";
|
||||||
|
Before = "sleep.target";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${pkgs.uhubctl}/bin/uhubctl -a off";
|
||||||
|
};
|
||||||
|
wantedBy = [ "sleep.target" ];
|
||||||
|
};
|
||||||
|
systemd.services.root-resume = {
|
||||||
|
enable = true;
|
||||||
|
description = "Root systemd suspend posthook";
|
||||||
|
unitConfig = {
|
||||||
|
Description = "Root systemd suspend posthook";
|
||||||
|
After = "suspend.target";
|
||||||
|
};
|
||||||
|
serviceConfig = {
|
||||||
|
Type = "simple";
|
||||||
|
ExecStart = "${pkgs.uhubctl}/bin/uhubctl -a on";
|
||||||
|
};
|
||||||
|
wantedBy = [ "suspend.target" ];
|
||||||
|
};
|
||||||
|
|
||||||
services.btrfs.autoScrub = {
|
services.btrfs.autoScrub = {
|
||||||
enable = true;
|
enable = true;
|
||||||
interval = "weekly";
|
interval = "weekly";
|
||||||
|
|
|
@ -136,7 +136,7 @@
|
||||||
bind=,code:255,exec,airplane-mode
|
bind=,code:255,exec,airplane-mode
|
||||||
bind=SUPER,C,exec,wl-copy $(hyprpicker)
|
bind=SUPER,C,exec,wl-copy $(hyprpicker)
|
||||||
|
|
||||||
bind=SUPERSHIFT,S,exec,hyprlock & sleep 1 && systemctl suspend
|
bind=SUPERSHIFT,S,exec,systemctl suspend
|
||||||
bind=SUPERCTRL,L,exec,hyprlock
|
bind=SUPERCTRL,L,exec,hyprlock
|
||||||
|
|
||||||
bind=SUPER,H,movefocus,l
|
bind=SUPER,H,movefocus,l
|
||||||
|
@ -380,20 +380,14 @@
|
||||||
];
|
];
|
||||||
home.file.".config/hypr/hypridle.conf".text = ''
|
home.file.".config/hypr/hypridle.conf".text = ''
|
||||||
general {
|
general {
|
||||||
lock_cmd = hyprlock
|
lock_cmd = pgrep hyprlock || hyprlock
|
||||||
unlock_cmd =
|
before_sleep_cmd = loginctl lock-session
|
||||||
before_sleep_cmd = hyprlock
|
|
||||||
after_sleep_cmd =
|
|
||||||
ignore_dbus_inhibit = false
|
ignore_dbus_inhibit = false
|
||||||
}
|
}
|
||||||
|
|
||||||
listener {
|
listener {
|
||||||
timeout = 360 # in seconds
|
timeout = 600 # in seconds
|
||||||
on-timeout = hyprlock
|
on-timeout = loginctl lock-session
|
||||||
on-resume =
|
|
||||||
timeout = 720 # in seconds
|
|
||||||
on-timeout = systemctl suspend
|
|
||||||
on-resume =
|
|
||||||
}
|
}
|
||||||
'';
|
'';
|
||||||
home.file.".config/hypr/hyprlock.conf".text = ''
|
home.file.".config/hypr/hyprlock.conf".text = ''
|
||||||
|
|
Loading…
Reference in a new issue