aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2019-04-09 16:30:23 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2019-04-09 16:30:23 +0200
commit9bdd35da1236ff8f71418c5f44436180435cdcd1 (patch)
treeb1ecc08e04892f560de9d9fe768202ae0bfafde1
parenta25681ae9407fa0cac13610eccf54550daf59465 (diff)
downloadscripts-9bdd35da1236ff8f71418c5f44436180435cdcd1.tar.gz
scripts-9bdd35da1236ff8f71418c5f44436180435cdcd1.zip
Made i3lock.sh more robust when there is no lock image.
-rwxr-xr-xi3lock.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/i3lock.sh b/i3lock.sh
index 0b8ad16..2eed74c 100755
--- a/i3lock.sh
+++ b/i3lock.sh
@@ -2,8 +2,9 @@
# Generates an i3lock bg based on a screenshot.
-imgLock="$HOME/images/padlocks.png"
+imgLock="$HOME/images/icons/lock.png"
+imgTemp="/tmp/i3lockss.png"
imgFinal="/tmp/lockFinal$(date +"%H%M%S").png"
-maim /tmp/i3lockss.png
-convert /tmp/i3lockss.png -paint 1 -swirl -120 "$imgLock" -gravity center -composite "$imgFinal"
-i3lock -i "$imgFinal" -f
+maim "$imgTemp"
+[ -e "$imgLock" ] && convert "$imgTemp" -paint 1 -swirl -30 "$imgLock" -gravity center -composite "$imgFinal"
+i3lock -i "$imgFinal" -f || i3lock -i "$imgTemp" -f