diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-04-09 16:30:23 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-04-09 16:30:23 +0200 |
commit | 9bdd35da1236ff8f71418c5f44436180435cdcd1 (patch) | |
tree | b1ecc08e04892f560de9d9fe768202ae0bfafde1 | |
parent | a25681ae9407fa0cac13610eccf54550daf59465 (diff) | |
download | scripts-9bdd35da1236ff8f71418c5f44436180435cdcd1.tar.gz scripts-9bdd35da1236ff8f71418c5f44436180435cdcd1.zip |
Made i3lock.sh more robust when there is no lock image.
-rwxr-xr-x | i3lock.sh | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 |