From 48fe9977f8193e6323f6fafca26fab029816be97 Mon Sep 17 00:00:00 2001 From: Syndamia Date: Fri, 11 Jun 2021 08:24:20 +0300 Subject: Improved jgmenu commands for logout and lock now, updated lock script with more information and better sleeping, fixed some configs --- .i3lock/lock.sh | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to '.i3lock') diff --git a/.i3lock/lock.sh b/.i3lock/lock.sh index 7131e1e..4dc5357 100755 --- a/.i3lock/lock.sh +++ b/.i3lock/lock.sh @@ -1,13 +1,23 @@ #!/bin/bash if [ $(grep -r "RUNNING" /proc/asound | wc -l) -eq 0 ] || [[ $# -ne 0 ]]; then - # Also disables and enables dunst, my notification daemon + # Disables dunst, my notification daemon, so I don't see notification on lock screen # https://github.com/dunst-project/dunst/issues/697 # https://wiki.archlinux.org/title/Dunst#Disable_dunst_temporarily - killall -SIGUSR1 dunst + if [[ "$1" == "suspend" ]]; then - systemctl -i suspend + # Usually suspending should be done with "systemctl suspend", but I've had issues with that so I directly tell the kernel to sleep the system + # For that I have a script in /usr/loca/sbin that just continains: + # + # #!/bin/bash + # echo -n mem>/sys/power/state + # + # And I've added the following to /etc/sudoers (where kamen is my username), so I don't need to put in my password: + # + # kamen ALL = (root) NOPASSWD: /usr/local/sbin/sleep.sh + sudo -u root /usr/local/sbin/sleep.sh + # 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 @@ -15,7 +25,8 @@ if [ $(grep -r "RUNNING" /proc/asound | wc -l) -eq 0 ] || [[ $# -ne 0 ]]; then i3lock -f -c d49408 -i /home/kamen/.i3lock/lockscreen.png -n - killall -SIGUSR2 dunst + killall -SIGUSR2 dunst # Enables my notification daemon killall lwa-hot-corners; lwa-hot-corners ~/.lwarc & killall tint2; tint2 & + picom --experimental-backends & # Sometimes my compositor crashes or smth, so I try to launch it, just in case it stopped working fi -- cgit v1.2.3