From 545bcfd86305f6c328415e17035af9f60847b769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Sat, 28 Aug 2021 11:44:28 -0500 Subject: fix i3lock extension file --- config | 2 +- scripts/i3lock.bash | 34 ++++++++++++++++++++++++++++++++++ scripts/i3lock.sh | 34 ---------------------------------- 3 files changed, 35 insertions(+), 35 deletions(-) create mode 100644 scripts/i3lock.bash delete mode 100644 scripts/i3lock.sh diff --git a/config b/config index 7ff575b..d9a109d 100644 --- a/config +++ b/config @@ -255,7 +255,7 @@ mode "$mode_mount" { bindsym $mod+m mode "$mode_mount" # i3lock -bindsym Pause exec "sh $HOME/.config/i3/scripts/i3lock.sh" +bindsym Pause exec "bash $HOME/.config/i3/scripts/i3lock.bash" ## Manual management of external displays # Set the shortcuts and what they do diff --git a/scripts/i3lock.bash b/scripts/i3lock.bash new file mode 100644 index 0000000..caddf1c --- /dev/null +++ b/scripts/i3lock.bash @@ -0,0 +1,34 @@ +#!/bin/bash +revert() { + rm /tmp/*screen*.png + xset dpms 0 0 0 +} + +trap revert HUP INT TERM + +if [[ $(command -v xset) ]]; then + xset +dpms dpms 0 0 5 +else + echo 'xset command not found' >> "$HOME/.config/i3/logs/xset-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug +fi + +if [[ $(command -v scrot) ]]; then + scrot -d 1 /tmp/locking_screen.png +else + echo 'scrot is not installed' >> "$HOME/.config/i3/logs/scrot-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug +fi + +if [[ $(command -v convert) ]]; then + convert -blur 0x8 /tmp/locking_screen.png /tmp/screen_blur.png + convert -composite /tmp/screen_blur.png "$HOME/.config/i3/images/imagelock.png" -gravity South -geometry -20x1200 /tmp/screen.png +else + echo 'convert command not found' >> "$HOME/.config/i3/logs/convert-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug +fi + +if [[ $(command -v i3lock) ]]; then + i3lock -i /tmp/screen.png +else + echo 'i3lock is not installed' >> "$HOME/.config/i3/logs/i3lock-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug +fi + +revert "$@" diff --git a/scripts/i3lock.sh b/scripts/i3lock.sh deleted file mode 100644 index caddf1c..0000000 --- a/scripts/i3lock.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -revert() { - rm /tmp/*screen*.png - xset dpms 0 0 0 -} - -trap revert HUP INT TERM - -if [[ $(command -v xset) ]]; then - xset +dpms dpms 0 0 5 -else - echo 'xset command not found' >> "$HOME/.config/i3/logs/xset-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug -fi - -if [[ $(command -v scrot) ]]; then - scrot -d 1 /tmp/locking_screen.png -else - echo 'scrot is not installed' >> "$HOME/.config/i3/logs/scrot-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug -fi - -if [[ $(command -v convert) ]]; then - convert -blur 0x8 /tmp/locking_screen.png /tmp/screen_blur.png - convert -composite /tmp/screen_blur.png "$HOME/.config/i3/images/imagelock.png" -gravity South -geometry -20x1200 /tmp/screen.png -else - echo 'convert command not found' >> "$HOME/.config/i3/logs/convert-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug -fi - -if [[ $(command -v i3lock) ]]; then - i3lock -i /tmp/screen.png -else - echo 'i3lock is not installed' >> "$HOME/.config/i3/logs/i3lock-log-$(date +'%F-%k-%M-%S').log" 2>&1 # debug -fi - -revert "$@" -- cgit v1.2.3