diff options
| author | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-06-09 16:13:45 +0300 |
|---|---|---|
| committer | Syndamia <kamen.d.mladenov@protonmail.com> | 2021-06-09 16:13:45 +0300 |
| commit | 1b569cdbfca6e7cb27c2b2e50062ae69778f69b7 (patch) | |
| tree | 4d604ecc0befcd3fd3d8707f01fd7cbdd8a71490 | |
| parent | c8c7a741e2a9d1bdcdedb94e0f04d9656b2f21b6 (diff) | |
| download | dotfiles-1b569cdbfca6e7cb27c2b2e50062ae69778f69b7.tar dotfiles-1b569cdbfca6e7cb27c2b2e50062ae69778f69b7.tar.gz dotfiles-1b569cdbfca6e7cb27c2b2e50062ae69778f69b7.zip | |
Updated i3lock script to be able to suspend the system
| -rw-r--r-- | .config/jgmenu/append.csv | 2 | ||||
| -rwxr-xr-x | .i3lock/lock.sh | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/.config/jgmenu/append.csv b/.config/jgmenu/append.csv index e3065bf..8e850b5 100644 --- a/.config/jgmenu/append.csv +++ b/.config/jgmenu/append.csv @@ -2,6 +2,6 @@ Log Out,openbox --exit,system-log-out Lock Now,/home/kamen/.i3lock/lock.sh now,system-lock-screen ^sep() -Suspend,~/.i3lock/lock.sh now && systemctl -i suspend,system-suspend +Suspend,~/.i3lock/lock.sh suspend,system-suspend Reboot,systemctl -i reboot,system-reboot Shutdown,systemctl -i poweroff,system-shutdown diff --git a/.i3lock/lock.sh b/.i3lock/lock.sh index 62e3925..7131e1e 100755 --- a/.i3lock/lock.sh +++ b/.i3lock/lock.sh @@ -6,6 +6,16 @@ if [ $(grep -r "RUNNING" /proc/asound | wc -l) -eq 0 ] || [[ $# -ne 0 ]]; then # https://wiki.archlinux.org/title/Dunst#Disable_dunst_temporarily killall -SIGUSR1 dunst + if [[ "$1" == "suspend" ]]; then + systemctl -i suspend + # Audio could get messed up if something is playing while trying to suspend + # By restarting pulseaudio, all playback gets "stopped", which should prevent any audio issues post-suspend + pulseaudio -k + fi + i3lock -f -c d49408 -i /home/kamen/.i3lock/lockscreen.png -n + killall -SIGUSR2 dunst + killall lwa-hot-corners; lwa-hot-corners ~/.lwarc & + killall tint2; tint2 & fi |
