Skip to content

Commit

Permalink
Merge pull request meskarune#78 from meskarune/shellcheck
Browse files Browse the repository at this point in the history
shellcheck fixes
  • Loading branch information
AladW committed May 15, 2017
2 parents 5bdf176 + a3dd35a commit d744180
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Dependencies: imagemagick, i3lock-color-git, scrot, wmctrl (optional)
set -o errexit -o noclobber -o nounset

HUE=(-level 0%,100%,0.6)
EFFECT=(-filter Gaussian -resize 20% -define filter:sigma=1.5 -resize 500.5%)
HUE=(-level "0%,100%,0.6")
EFFECT=(-filter Gaussian -resize 20% -define "filter:sigma=1.5" -resize 500.5%)
# default system sans-serif font
FONT="$(convert -list font | awk "{ a[NR] = \$2 } /family: $(fc-match sans -f "%{family}\n")/ { print a[NR-1]; exit }")"
IMAGE="$(mktemp).png"
Expand Down Expand Up @@ -58,9 +58,9 @@ esac
while true ; do
case "$1" in
-h|--help)
printf "Usage: $(basename $0) [options]\n\n$OPTIONS\n\n" ; exit 1 ;;
printf "Usage: %s [options]\n\n%s\n\n" "${0##*/}" "$OPTIONS"; exit 1 ;;
-d|--desktop) DESKTOP=$(which wmctrl) ; shift ;;
-g|--greyscale) HUE=(-level 0%,100%,0.6 -set colorspace Gray -separate -average) ; shift ;;
-g|--greyscale) HUE=(-level "0%,100%,0.6" -set colorspace Gray -separate -average) ; shift ;;
-p|--pixelate) EFFECT=(-scale 10% -scale 1000%) ; shift ;;
-f|--font)
case "$2" in
Expand Down Expand Up @@ -92,17 +92,17 @@ COLOR=$(convert "$IMAGE" -gravity center -crop 100x100+0+0 +repage -colorspace h
if [ "$COLOR" -gt "$VALUE" ]; then #white background image and black text
BW="black"
ICON="$SCRIPTPATH/icons/lockdark.png"
PARAM=(--textcolor=00000000 --insidecolor=0000001c --ringcolor=0000003e \
--linecolor=00000000 --keyhlcolor=ffffff80 --ringvercolor=ffffff00 \
--separatorcolor=22222260 --insidevercolor=ffffff1c \
--ringwrongcolor=ffffff55 --insidewrongcolor=ffffff1c)
PARAM=("--textcolor=00000000" "--insidecolor=0000001c" "--ringcolor=0000003e" \
"--linecolor=00000000" "--keyhlcolor=ffffff80" "--ringvercolor=ffffff00" \
"--separatorcolor=22222260" "--insidevercolor=ffffff1c" \
"--ringwrongcolor=ffffff55" "--insidewrongcolor=ffffff1c")
else #black
BW="white"
ICON="$SCRIPTPATH/icons/lock.png"
PARAM=(--textcolor=ffffff00 --insidecolor=ffffff1c --ringcolor=ffffff3e \
--linecolor=ffffff00 --keyhlcolor=00000080 --ringvercolor=00000000 \
--separatorcolor=22222260 --insidevercolor=0000001c \
--ringwrongcolor=00000055 --insidewrongcolor=0000001c)
PARAM=("--textcolor=ffffff00" "--insidecolor=ffffff1c" "--ringcolor=ffffff3e" \
"--linecolor=ffffff00" "--keyhlcolor=00000080" "--ringvercolor=00000000" \
"--separatorcolor=22222260" "--insidevercolor=0000001c" \
"--ringwrongcolor=00000055" "--insidewrongcolor=0000001c")
fi

convert "$IMAGE" "${HUE[@]}" "${EFFECT[@]}" -font "$FONT" -pointsize 26 -fill "$BW" -gravity center \
Expand Down

0 comments on commit d744180

Please sign in to comment.