aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesús <heckyel@hyperbola.info>2019-09-27 18:21:32 -0500
committerJesús <heckyel@hyperbola.info>2019-09-27 18:21:32 -0500
commit5d0f798109d4ce4f3728c48ce8d34a0bc2e16a7e (patch)
tree70bf40b3baa1fc07ae33fab1a7fd3360e8622f8a
parentb85260739e06b2cf781c3c5b647b00a2e03989ad (diff)
downloadi3-config-5d0f798109d4ce4f3728c48ce8d34a0bc2e16a7e.tar.lz
i3-config-5d0f798109d4ce4f3728c48ce8d34a0bc2e16a7e.tar.xz
i3-config-5d0f798109d4ce4f3728c48ce8d34a0bc2e16a7e.zip
Added logs
-rw-r--r--install.sh3
-rw-r--r--scripts/i3lock.sh32
2 files changed, 30 insertions, 5 deletions
diff --git a/install.sh b/install.sh
index a0b405f..356f833 100644
--- a/install.sh
+++ b/install.sh
@@ -55,6 +55,9 @@ do
install -d -m755 "$HOME/.config/termite"
install -m644 -v /tmp/i3config/tmp/termite "$HOME/.config/termite/config"
+ printf '%b%s%b%s%b\n' '\e[1;32m' '==> ' '\e[0m\033[1m' 'Make log directory...' '\e[m'
+ install -d -m755 "$HOME/.config/i3/logs/"
+
# clean up temp files
rm -rf /tmp/i3config/
}
diff --git a/scripts/i3lock.sh b/scripts/i3lock.sh
index 8fc3d8e..caddf1c 100644
--- a/scripts/i3lock.sh
+++ b/scripts/i3lock.sh
@@ -3,10 +3,32 @@ revert() {
rm /tmp/*screen*.png
xset dpms 0 0 0
}
+
trap revert HUP INT TERM
-xset +dpms dpms 0 0 5
-scrot -d 1 /tmp/locking_screen.png
-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
-i3lock -i /tmp/screen.png
+
+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 "$@"