bin: sway tools

This commit is contained in:
xeruf 2024-06-28 22:34:35 +03:00
parent 0871ab52c7
commit b73b3b32cd
2 changed files with 13 additions and 7 deletions

View File

@ -1,8 +1,13 @@
#!/bin/sh
#!/bin/sh -e
# Suspend screen until enter is pressed
test "$1" && sleep $1
xset dpms force off
swaymsg "output * dpms off"
read
xset dpms force on
swaymsg "output * dpms on"
dpms() {
if test $XDG_SESSION_TYPE = wayland
then swaymsg "output * dpms $*"
else xset dpms force "$@"
fi
}
dpms off
trap 'dpms on' INT
sleep 99999
dpms on

View File

@ -8,4 +8,5 @@ case $1 in
(col) way-displays -s ARRANGE_ALIGN COLUMN MIDDLE; exit $?;;
esac
shift $shift
way-displays -s SCALE '' $scale "$@" || swaymsg output \* scale $scale
way-displays -s SCALE '' $scale "$@" ||
swaymsg output \* scale $scale