From c61ed972172cd77608648cb415d0a4ee0638d9d7 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Tue, 18 Feb 2020 10:11:28 +0300 Subject: pam rules; forgot to add lid close/open script --- laptop/lid-button.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'laptop') 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 -- cgit v1.2.3