From 9166534b292b630872df0f2d00a0c64417700574 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 18 Dec 2017 01:12:13 -0500 Subject: [PATCH] binscripts: make indentation consistent --- bin/clip | 40 ++++++++++++++++++++-------------------- bin/gpgzip | 38 +++++++++++++++++++------------------- bin/htmlent | 8 ++++---- bin/rclip | 28 ++++++++++++++-------------- bin/ssclip | 12 ++++++------ 5 files changed, 63 insertions(+), 63 deletions(-) diff --git a/bin/clip b/bin/clip index b05205a2..11fce587 100755 --- a/bin/clip +++ b/bin/clip @@ -4,26 +4,26 @@ # Linux). if [[ -t 0 ]]; then - if command -v xclip >/dev/null; then - xclip -display :0 -selection clipboard -out - elif command -v xsel >/dev/null; then - xsel --clipboard --output - elif command -v pbpaste >/dev/null; then - pbpaste - else - >&2 echo "No clipboard detected. Aborting." - exit 1 - fi + if command -v xclip >/dev/null; then + xclip -display :0 -selection clipboard -out + elif command -v xsel >/dev/null; then + xsel --clipboard --output + elif command -v pbpaste >/dev/null; then + pbpaste + else + >&2 echo "No clipboard detected. Aborting." + exit 1 + fi else - if command -v xclip >/dev/null; then - xclip -display :0 -selection clipboard -in - elif command -v xsel >/dev/null; then - xsel --clipboard --input - elif command -v pbcopy >/dev/null; then - pbcopy - else - >&2 echo "No clipboard detected. Aborting." - exit 1 - fi + if command -v xclip >/dev/null; then + xclip -display :0 -selection clipboard -in + elif command -v xsel >/dev/null; then + xsel --clipboard --input + elif command -v pbcopy >/dev/null; then + pbcopy + else + >&2 echo "No clipboard detected. Aborting." + exit 1 + fi fi diff --git a/bin/gpgzip b/bin/gpgzip index 517fa737..21358b7e 100755 --- a/bin/gpgzip +++ b/bin/gpgzip @@ -7,34 +7,34 @@ set -e if (($# == 0)); then - >&2 echo "Usage: $0 [DEST]" - exit 1 + >&2 echo "Usage: $0 [DEST]" + exit 1 fi ext='clump' target="$1" cmd= if [[ -f $target ]]; then - cmd=unpack + cmd=unpack elif [[ -d $target ]]; then - cmd=pack + cmd=pack else - >&2 echo "Not a valid target: '$target'" - exit 1 + >&2 echo "Not a valid target: '$target'" + exit 1 fi case $cmd in - p|pack) - if [[ -f $target.$ext ]]; then - >&2 echo "Destination file already exists" - exit 2 - fi - tar -pcvf - "$target" | gpg -c > "$target.$ext" - echo "Packed into $target.$ext" - ;; - u|unpack) - tmpfile=$(mktemp) - gpg -d "$target" > "$tmpfile" && tar -pxvf "$tmpfile" - rm -f "$tmpfile" - ;; + p|pack) + if [[ -f $target.$ext ]]; then + >&2 echo "Destination file already exists" + exit 2 + fi + tar -pcvf - "$target" | gpg -c > "$target.$ext" + echo "Packed into $target.$ext" + ;; + u|unpack) + tmpfile=$(mktemp) + gpg -d "$target" > "$tmpfile" && tar -pxvf "$tmpfile" + rm -f "$tmpfile" + ;; esac diff --git a/bin/htmlent b/bin/htmlent index ddf6ea88..c09d68b9 100755 --- a/bin/htmlent +++ b/bin/htmlent @@ -15,10 +15,10 @@ ENTITIES = {value: key for key, value in entitydefs.items()} def encode(text): t = "" for c in text: - if c in ENTITIES: - t += "&" + ENTITIES[c] + ";" - else: - t += c + if c in ENTITIES: + t += "&" + ENTITIES[c] + ";" + else: + t += c return t def decode(text): diff --git a/bin/rclip b/bin/rclip index 88c827b8..40c68134 100755 --- a/bin/rclip +++ b/bin/rclip @@ -21,26 +21,26 @@ bin="${0##*/}" flags= while getopts p:i:l: opt; do - case $opt in - p) flags+=" -p $OPTARG" ;; - i) flags+=" -i $OPTARG" ;; - l) flags+=" -l $OPTARG" ;; - *) >&2 echo "Invalid option $OPTARG" - exit 1 - ;; - esac + case $opt in + p) flags+=" -p $OPTARG" ;; + i) flags+=" -i $OPTARG" ;; + l) flags+=" -l $OPTARG" ;; + *) >&2 echo "Invalid option $OPTARG" + exit 1 + ;; + esac done shift $((OPTIND-1)) target="$1" if [[ $target ]]; then - if [[ -t 0 ]]; then - pb | $bin $target - else - ssh $flags -qt "$target" "pb" && echo "Sent to $target" - fi + if [[ -t 0 ]]; then + pb | $bin $target + else + ssh $flags -qt "$target" "pb" && echo "Sent to $target" + fi else - pb + pb fi # vim:set ft=sh: diff --git a/bin/ssclip b/bin/ssclip index e56c96c5..f3c03e6c 100755 --- a/bin/ssclip +++ b/bin/ssclip @@ -2,11 +2,11 @@ # A script that takes a screenshot and stores it in the clipboard tmp=$(mktemp) if maim -us >"$tmp"; then - xclip -selection clipboard -t image/png "$tmp" && \ - ding && \ - notify-send "Screenshot saved" + xclip -selection clipboard -t image/png "$tmp" && \ + ding && \ + notify-send "Screenshot saved" else - notify-send -u low "Screenshot aborted" - ding error + notify-send -u low "Screenshot aborted" + ding error fi -rm -f "$tmp" \ No newline at end of file +rm -f "$tmp"