Align shell style all over the repo

This commit is contained in:
Lucas 2020-05-03 14:47:27 +00:00
parent afb13d9c9c
commit d5e71c46f7
16 changed files with 113 additions and 86 deletions

View file

@ -1,6 +1,6 @@
#!/bin/sh
# env
# Written in 2019 by Lucas
# Written in 2019-2020 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
@ -16,19 +16,18 @@
: ${IMAGE_HEIGHT:=500}
: ${IMAGE_WIDTH:=500}
pos_x=$((3 * $CANVAS_WIDTH / 4 - $IMAGE_WIDTH / 2))
pos_y=$(($CANVAS_HEIGHT / 2 - $IMAGE_HEIGHT / 2))
pos_x=$((3 * CANVAS_WIDTH / 4 - IMAGE_WIDTH / 2))
pos_y=$((CANVAS_HEIGHT / 2 - IMAGE_HEIGHT / 2))
if ! tmpfile=$(mktemp -t bg.XXXXXXXXXX); then
printf "%s: Can't create temporary file.\n" "${0##*/}" >&2
printf "%s: can't create temporary file\n" "${0##*/}" >&2
exit 1
fi
trap 'rm -f "$tmpfile"' EXIT INT QUIT TERM
pngtopam -alphapam FreeHugsBSD.png \
| pamscale -width="$IMAGE_WIDTH" -height="$IMAGE_HEIGHT" \
>"$tmpfile"
ppmmake "$CANVAS_BGCOLOR" "$CANVAS_WIDTH" "$CANVAS_HEIGHT" \
| pamcomp -xoff="$pos_x" -yoff="$pos_y" "$tmpfile" \
| pamtopng >FreeHugsBSD-bg.png
pngtopam -alphapam FreeHugsBSD.png |
pamscale -width "$IMAGE_WIDTH" -height "$IMAGE_HEIGHT" >"$tmpfile"
ppmmake "$CANVAS_BGCOLOR" "$CANVAS_WIDTH" "$CANVAS_HEIGHT" |
pamcomp -xoff "$pos_x" -yoff "$pos_y" "$tmpfile" |
pamtopng >FreeHugsBSD-bg.png

View file

@ -1,6 +1,6 @@
#!/bin/sh
# env
# Written in 2019 by Lucas
# Written in 2019-2020 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
@ -16,19 +16,18 @@
: ${IMAGE_HEIGHT:=768}
: ${IMAGE_WIDTH:=1080}
pos_x=$((($CANVAS_WIDTH - $IMAGE_WIDTH) / 2))
pos_y=$((($CANVAS_HEIGHT - $IMAGE_HEIGHT) / 2))
pos_x=$(((CANVAS_WIDTH - IMAGE_WIDTH) / 2))
pos_y=$(((CANVAS_HEIGHT - IMAGE_HEIGHT) / 2))
if ! tmpfile=$(mktemp -t bg.XXXXXXXXXX); then
printf "%s: Can't create temporary file.\n" "${0##*/}" >&2
printf "%s: can't create temporary file\n" "${0##*/}" >&2
exit 1
fi
trap 'rm -f "$tmpfile"' EXIT INT QUIT TERM
pngtopam -alphapam cyberia-cafe-club.png \
| pamscale -width="$IMAGE_WIDTH" -height="$IMAGE_HEIGHT" \
>"$tmpfile"
ppmmake "$CANVAS_BGCOLOR" "$CANVAS_WIDTH" "$CANVAS_HEIGHT" \
| pamcomp -xoff="$pos_x" -yoff="$pos_y" "$tmpfile" \
| pamtopng >cyberia-cafe-club-bg.png
pngtopam -alphapam cyberia-cafe-club.png |
pamscale -width "$IMAGE_WIDTH" -height "$IMAGE_HEIGHT" >"$tmpfile"
ppmmake "$CANVAS_BGCOLOR" "$CANVAS_WIDTH" "$CANVAS_HEIGHT" |
pamcomp -xoff "$pos_x" -yoff "$pos_y" "$tmpfile" |
pamtopng >cyberia-cafe-club-bg.png

View file

@ -1,4 +1,15 @@
#!/bin/sh
# env
# Written in 2020 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# Dedication along with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
usage()
{
printf "Usage: %s [-c curve] [-d days] domain\n" "${0##*/}" >&2
@ -28,7 +39,7 @@ shift $((OPTIND - 1))
domain=$1
if [ -f "$domain.key" ]; then
printf "%s: key for %s already exists; reusing it.\n" \
printf "%s: key for %s already exists; reusing it\n" \
"${0##*/}" "$domain" >&2
else
(umask 0377 &&

View file

@ -1,4 +1,15 @@
#!/bin/sh
# env
# Written in 2020 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# Dedication along with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
usage()
{
printf "Usage: %s newkey\n" "${0##*/}" >&2
@ -18,21 +29,21 @@ newsekrit()
[ $# -eq 1 ] || usage
newkey=$1
gpg2 -k "$newkey" >/dev/null || err "Can't find key \"$newkey\""
gpg2 -k "$newkey" >/dev/null || err "can't find key $newkey"
umask 077
newdir=$(mktemp -dt sekrit-XXXXXXXXXX) ||
err "Failed to create temporary directory"
err "failed to create temporary directory"
scratch=$(mktemp -tp "$newdir" .sekrit-scratch-XXXXXXXXXX) ||
err "Failed to create scratch file"
err "failed to create scratch file"
trap 'rm -fr -- "$scratch" "$newdir"' INT QUIT TERM
for entry in $(sekrit ls | grep -v ^DONE); do
printf "%s... " "$entry"
sekrit get "$entry" >|"$scratch" ||
err "Failed to export entry \"$entry\""
err "failed to export entry $entry"
newsekrit add "$entry" <"$scratch" ||
err "Failed to import entry \"$entry\""
err "failed to import entry $entry"
printf "OK\n"
done
rm -f "$scratch"

View file

@ -1,6 +1,6 @@
#!/bin/sh
# env
# Written in 2019 by Lucas
# Written in 2019-2020 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
@ -22,7 +22,7 @@ tput rev
printf " bg on fg "
tput sgr0
for i in 0 1 2 3 4 5 6 7; do
tput setab $(($i + 8)) 0 0
tput setab $((i + 8)) 0 0
printf " "
done
printf "\n"

View file

@ -1,4 +1,15 @@
#!/bin/sh
# env
# Written in 2020 by Lucas
# CC0 1.0 Universal/Public domain - No rights reserved
#
# To the extent possible under law, the author(s) have dedicated all
# copyright and related and neighboring rights to this software to the
# public domain worldwide. This software is distributed without any
# warranty. You should have received a copy of the CC0 Public Domain
# Dedication along with this software. If not, see
# <http://creativecommons.org/publicdomain/zero/1.0/>.
usage()
{
printf "Usage: %s version\n" "${0##*/}" >&2
@ -16,19 +27,14 @@ isversion()
printf "%s\n" "$*" | grep -Eq "^v[0-9]+\.[0-9]+\.[0-9]+$"
}
if [ -z "${RIOT_WEB_UI_DIR:-}" ]; then
err "Environment RIOT_WEB_UI_DIR unset"
fi
if [ $# -ne 1 ] || ! isversion "$1"; then
usage
fi
[ -n "${RIOT_WEB_UI_DIR:-}" ] || err "environment var RIOT_WEB_UI_DIR unset"
[ $# -eq 1 ] && isversion "$1" || usage
ver=$1
GH_BASE_URL=https://github.com/vector-im/riot-web/releases/download
cd "$RIOT_WEB_UI_DIR" || err "Can't cd to web UI directory"
cd "$RIOT_WEB_UI_DIR" || err "can't cd to web UI directory"
ftp -o - "$GH_BASE_URL/$ver/riot-$ver.tar.gz" | pax -rz ||
err "Can't fetch and extract release"
err "can't fetch and extract release"
rm -f riot && ln -s "riot-$ver" riot ||
err "Can't point web UI directory to new release"
err "can't point web UI directory to new release"