mayushii: Add hack for better DPMS

This commit is contained in:
Simon Bruder 2023-06-29 17:51:38 +02:00
parent 472ff64011
commit a59f595562
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -279,11 +279,14 @@ in
Service = {
# swayidle requires sh and swaymsg to be in path
Environment = "PATH=${pkgs.bash}/bin:${config.wayland.windowManager.sway.package}/bin";
# FIXME HACK This includes special code to hopefully make waking up on mayushii more reliable
# It is based on the observation that wlr-randr --on often works,
# when swaymsg output … dpms on does not (but the output alredy exists!).
ExecStart = ''
${pkgs.swayidle}/bin/swayidle -w \
timeout 300 "${pkgs.swaylock}/bin/swaylock -f -i ${wallpaper}" \
timeout 300 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
resume 'swaymsg "output * dpms on"'' + lib.optionalString (nixosConfig.networking.hostName == "mayushii") " && ${pkgs.wlr-randr}/bin/wlr-randr --output DP-6 --on" + ''' \
before-sleep "${pkgs.swaylock}/bin/swaylock -f -i ${wallpaper}"
'';
Restart = "on-failure";
@ -344,5 +347,6 @@ in
wev # wayland event monitor
wl-clipboard # cli tool to manage wayland clipboard
wl-mirror # emulation for “mirror display” mode
wlr-randr # output management that actually works
];
})