hyprland: fixed swayidle dpms calling waymsg instead of hyprctl

This commit is contained in:
Aly Raffauf 2024-04-24 18:35:22 -04:00
parent dab2d33585
commit fe52832fab
2 changed files with 5 additions and 5 deletions

View file

@ -93,10 +93,10 @@
lock = pkgs.swaylock + ''/bin/swaylock -l -f -c 303446 --indicator-idle-visible --font "Noto SansM Nerd Font Regular" --ring-color ca9ee6 --inside-color 303446''; lock = pkgs.swaylock + ''/bin/swaylock -l -f -c 303446 --indicator-idle-visible --font "Noto SansM Nerd Font Regular" --ring-color ca9ee6 --inside-color 303446'';
idled = idled =
if osConfig.networking.hostName == "mauville" if osConfig.networking.hostName == "mauville"
then ''${pkgs.swayidle}/bin/swayidle -w timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' resume '${pkgs.brightnessctl}/bin/brightnessctl -r' timeout 300 '${lock}' timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' before-sleep '${lock}' then ''${pkgs.swayidle}/bin/swayidle -w timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' resume '${pkgs.brightnessctl}/bin/brightnessctl -r' timeout 300 '${lock}' timeout 330 '${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off' resume '${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off' before-sleep '${lock}'
'' ''
else '' else ''
${pkgs.swayidle}/bin/swayidle -w timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' resume '${pkgs.brightnessctl}/bin/brightnessctl -r' timeout 300 '${lock}' timeout 330 '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms off"' resume '${config.wayland.windowManager.sway.package}/bin/swaymsg "output * dpms on"' timeout 900 '${pkgs.systemd}/bin/systemctl suspend' before-sleep '${lock}' ${pkgs.swayidle}/bin/swayidle -w timeout 240 '${pkgs.brightnessctl}/bin/brightnessctl -s set 10' resume '${pkgs.brightnessctl}/bin/brightnessctl -r' timeout 300 '${lock}' timeout 330 '${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off' resume '${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off' timeout 900 '${pkgs.systemd}/bin/systemctl suspend' before-sleep '${lock}'
''; '';
hyprnome = pkgs.hyprnome + "/bin/hyprnome"; hyprnome = pkgs.hyprnome + "/bin/hyprnome";

View file

@ -18,7 +18,7 @@
general { general {
lock_cmd = pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock # avoid starting multiple hyprlock instances. lock_cmd = pidof hyprlock || ${pkgs.hyprlock}/bin/hyprlock # avoid starting multiple hyprlock instances.
before_sleep_cmd = ${pkgs.systemd}/bin/loginctl lock-session # lock before suspend. before_sleep_cmd = ${pkgs.systemd}/bin/loginctl lock-session # lock before suspend.
after_sleep_cmd = ${pkgs.hyprland}/bin/hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display. after_sleep_cmd = ${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on # to avoid having to press a key twice to turn on the display.
} }
listener { listener {
@ -41,8 +41,8 @@
listener { listener {
timeout = 330 # 5.5min timeout = 330 # 5.5min
on-timeout = ${pkgs.hyprland}/bin/hyprctl dispatch dpms off # screen off when timeout has passed on-timeout = ${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms off # screen off when timeout has passed
on-resume = ${pkgs.hyprland}/bin/hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired. on-resume = ${config.wayland.windowManager.hyprland.package}/bin/hyprctl dispatch dpms on # screen on when activity is detected after timeout has fired.
} }
listener { listener {