diff options
author | Yaroslav <contact@yaroslavps.com> | 2020-02-18 10:11:28 +0300 |
---|---|---|
committer | Yaroslav <contact@yaroslavps.com> | 2020-02-18 10:11:28 +0300 |
commit | c61ed972172cd77608648cb415d0a4ee0638d9d7 (patch) | |
tree | e263ab5b332b6558f0f27539fd4100e7be3e1fad /laptop | |
parent | f8caca887f787f52271d9a5d6e06c2bdd6efcb40 (diff) | |
download | swayrice-c61ed972172cd77608648cb415d0a4ee0638d9d7.tar.gz swayrice-c61ed972172cd77608648cb415d0a4ee0638d9d7.zip |
pam rules; forgot to add lid close/open script
Diffstat (limited to 'laptop')
-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 |