From 93d2743e3864e9eab0699b1bb1ea5f01c10bdbc1 Mon Sep 17 00:00:00 2001 From: Yaroslav Date: Mon, 23 Sep 2019 06:32:38 +0300 Subject: initial commit --- laptop/lid-button.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 laptop/lid-button.sh (limited to 'laptop/lid-button.sh') diff --git a/laptop/lid-button.sh b/laptop/lid-button.sh new file mode 100755 index 0000000..601af5a --- /dev/null +++ b/laptop/lid-button.sh @@ -0,0 +1,15 @@ +#!/bin/sh +case "$3" in + close) + logger "LID close on custom"; + if [ "$(ps cax | grep i3)" ]; then + su yaroslav -c "DISPLAY=:0 i3 exec 'i3session suspend'" + else + systemctl suspend + fi + ;; + open) + logger "LID open on custom" ;; + *) + logger "LID undefined action $1" ;; +esac -- cgit v1.2.3