sway: use output power instead of deprecated dpms

BREAKING: this change requires Sway >= 1.8.

Fixes: #3
This commit is contained in:
Aleksei Bavshin 2023-03-22 21:34:37 -07:00
commit a3ccaebd56
No known key found for this signature in database
GPG key ID: 4F071603387A382A
4 changed files with 10 additions and 10 deletions

View file

@ -10,8 +10,8 @@ bindsym Mod4+shift+e exec swaynag \
# Disable displays on idle
exec command -v swayidle >/dev/null && swayidle -w \
timeout 300 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"'
timeout 300 'swaymsg "output * power off"' \
resume 'swaymsg "output * power on"'
# Apply system keyboard configuration
exec /usr/libexec/sway-systemd/locale1-xkb-config

View file

@ -1,6 +1,6 @@
# vim: ft=spec
%bcond_without sddm
%global sway_ver 1.7
%global sway_ver 1.8
Name: {{{ git_name }}}
Version: {{{ git_version }}}
@ -60,7 +60,7 @@ Conflicts: sddm-greeter-displayserver
Requires: lxqt-themes-fedora
Requires: sddm >= 0.19.0^git20221123.3e48649
Requires: sway
Requires: sway >= %{sway_ver}
%description -n sddm-wayland-sway
This package contains configuration and dependencies for SDDM

View file

@ -21,10 +21,10 @@
exec LT="$lock_timeout" ST="$screen_timeout" LT=${LT:-300} ST=${ST:-60} && \
swayidle -w \
timeout $LT 'swaylock -f' \
timeout $((LT + ST)) 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
timeout $ST 'pgrep -xu "$USER" swaylock >/dev/null && swaymsg "output * dpms off"' \
resume 'pgrep -xu "$USER" swaylock >/dev/null && swaymsg "output * dpms on"' \
timeout $((LT + ST)) 'swaymsg "output * power off"' \
resume 'swaymsg "output * power on"' \
timeout $ST 'pgrep -xu "$USER" swaylock >/dev/null && swaymsg "output * power off"' \
resume 'pgrep -xu "$USER" swaylock >/dev/null && swaymsg "output * power on"' \
before-sleep 'swaylock -f' \
lock 'swaylock -f' \
unlock 'pkill -xu "$USER" -SIGUSR1 swaylock'

View file

@ -11,5 +11,5 @@
exec LT="$lock_timeout" ST="$screen_timeout" LT=${LT:-300} ST=${ST:-60} && \
swayidle -w \
timeout $((LT + ST)) 'swaymsg "output * dpms off"' \
resume 'swaymsg "output * dpms on"' \
timeout $((LT + ST)) 'swaymsg "output * power off"' \
resume 'swaymsg "output * power on"' \