diff options
Diffstat (limited to 'laptop/lid-button.sh')
-rwxr-xr-x | laptop/lid-button.sh | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/laptop/lid-button.sh b/laptop/lid-button.sh index 601af5a..71f67c6 100755 --- a/laptop/lid-button.sh +++ b/laptop/lid-button.sh @@ -1,9 +1,12 @@ #!/bin/sh + +export SWAYSOCK=/run/user/1000/sway-ipc.1000.$(pgrep -x sway).sock + case "$3" in close) logger "LID close on custom"; - if [ "$(ps cax | grep i3)" ]; then - su yaroslav -c "DISPLAY=:0 i3 exec 'i3session suspend'" + if [ "$(ps cax | grep sway)" ]; then + su yaroslav -c "swaymsg exec 'swaysession suspend'" else systemctl suspend fi |