diff --git a/home/user/.local/bin/apco b/home/user/.local/bin/apco index 904b573..b9082ac 100755 --- a/home/user/.local/bin/apco +++ b/home/user/.local/bin/apco @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu codes="10-0 - Офицер ранен 10-1 - Офицеру нужна помощь diff --git a/home/user/.local/bin/bak b/home/user/.local/bin/bak index eb7b30f..f73cfa8 100755 --- a/home/user/.local/bin/bak +++ b/home/user/.local/bin/bak @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu ends_with_bak() { case "${1}" in diff --git a/home/user/.local/bin/bb b/home/user/.local/bin/bb index cbfb038..11fc4f3 100755 --- a/home/user/.local/bin/bb +++ b/home/user/.local/bin/bb @@ -1,6 +1,4 @@ -#!/bin/sh - -set -eum +#!/bin/sh -eum if test -t 1; then exec 1>/dev/null diff --git a/home/user/.local/bin/cleanup-directory b/home/user/.local/bin/cleanup-directory index 04bc184..2399fca 100755 --- a/home/user/.local/bin/cleanup-directory +++ b/home/user/.local/bin/cleanup-directory @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu directory="$(realpath "${1}")" diff --git a/home/user/.local/bin/cleanup-directory-log b/home/user/.local/bin/cleanup-directory-log index c346cec..0bca0e9 100755 --- a/home/user/.local/bin/cleanup-directory-log +++ b/home/user/.local/bin/cleanup-directory-log @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu directory="$(realpath "${1}")" diff --git a/home/user/.local/bin/cleanup-downloads b/home/user/.local/bin/cleanup-downloads index c8a922b..dd218a2 100755 --- a/home/user/.local/bin/cleanup-downloads +++ b/home/user/.local/bin/cleanup-downloads @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu readonly downloads_directory="${XDG_DOWNLOAD_DIR}" cleanup-directory-log "${downloads_directory}" diff --git a/home/user/.local/bin/copy b/home/user/.local/bin/copy index 9a55463..9b1e582 100755 --- a/home/user/.local/bin/copy +++ b/home/user/.local/bin/copy @@ -1,6 +1,4 @@ -#!/bin/sh - -set -eu +#!/bin/sh -eu case "${OSTYPE:-}" in diff --git a/home/user/.local/bin/destroy b/home/user/.local/bin/destroy index f7d6169..0bc2cdf 100755 --- a/home/user/.local/bin/destroy +++ b/home/user/.local/bin/destroy @@ -1,6 +1,4 @@ -#!/bin/sh - -set -eu +#!/bin/sh -eu readonly filename="${1}" @@ -20,4 +18,4 @@ if [ ! "${response}" = "y" ]; then exit 1 fi -shred -zun 3 "${filename}" \ No newline at end of file +shred -zun 3 "${filename}" diff --git a/home/user/.local/bin/django-create-project b/home/user/.local/bin/django-create-project index 07c09aa..48634fd 100755 --- a/home/user/.local/bin/django-create-project +++ b/home/user/.local/bin/django-create-project @@ -1,8 +1,4 @@ -#!/bin/sh - - -set -ue - +#!/bin/sh -eu readonly project_name="${1}" diff --git a/home/user/.local/bin/emoji b/home/user/.local/bin/emoji index 614a8a2..20a65ca 100755 --- a/home/user/.local/bin/emoji +++ b/home/user/.local/bin/emoji @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu emoji="😀 grinning cheerful cheery face grin grinning face happy laugh nice smile smiling teeth 😃 smiley awesome face grin happy mouth open smile smiling smiling face with open mouth teeth yay diff --git a/home/user/.local/bin/extract b/home/user/.local/bin/extract index 906189c..e630be6 100755 --- a/home/user/.local/bin/extract +++ b/home/user/.local/bin/extract @@ -1,6 +1,4 @@ -#!/bin/sh - -set -eu +#!/bin/sh -eu if [ -z "${1}" ]; then @@ -38,4 +36,4 @@ case "${1}" in *.xz) unxz ../"${1}" ;; *.exe) cabextract ../"${1}" ;; *) echo "extract: error: '${1}' - unknown archive method" >&2 ;; -esac \ No newline at end of file +esac diff --git a/home/user/.local/bin/firefox_media b/home/user/.local/bin/firefox_media index 4f7412c..eb2e425 100755 --- a/home/user/.local/bin/firefox_media +++ b/home/user/.local/bin/firefox_media @@ -1,4 +1,3 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu firefox --new-instance -P media --name firefox_media diff --git a/home/user/.local/bin/genpass b/home/user/.local/bin/genpass index 1dedbf5..acab9a5 100755 --- a/home/user/.local/bin/genpass +++ b/home/user/.local/bin/genpass @@ -1,6 +1,4 @@ -#!/bin/sh - -set -ue +#!/bin/sh -eu LC_ALL=C DEFAULT_PASSWORD_LENGTH=20 diff --git a/home/user/.local/bin/gensalt b/home/user/.local/bin/gensalt index bbbc407..f83685e 100755 --- a/home/user/.local/bin/gensalt +++ b/home/user/.local/bin/gensalt @@ -1,5 +1,3 @@ -#!/bin/sh +#!/bin/sh -eu -set -ue - -dd if=/dev/urandom count=16 2>/dev/null | sha256sum | head -c 64 \ No newline at end of file +dd if=/dev/urandom count=16 2>/dev/null | sha256sum | head -c 64 diff --git a/home/user/.local/bin/gobuild b/home/user/.local/bin/gobuild index bf0c304..ef4ea2f 100755 --- a/home/user/.local/bin/gobuild +++ b/home/user/.local/bin/gobuild @@ -1,4 +1,3 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu go build -v "${@}" -o ./bin/ ./... diff --git a/home/user/.local/bin/highlight-logs b/home/user/.local/bin/highlight-logs index b8b35e6..7b5c9a7 100755 --- a/home/user/.local/bin/highlight-logs +++ b/home/user/.local/bin/highlight-logs @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu ESC=$(printf '\033') diff --git a/home/user/.local/bin/httpstatus b/home/user/.local/bin/httpstatus index 3fb1438..0c5c05b 100755 --- a/home/user/.local/bin/httpstatus +++ b/home/user/.local/bin/httpstatus @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu statuses="100 Continue - Разрешение клиенту на продолжение отправки. 101 Switching Protocols - Переключение протоколов, исходя из указаний клиента. diff --git a/home/user/.local/bin/json b/home/user/.local/bin/json index 1593b6c..63a3558 100755 --- a/home/user/.local/bin/json +++ b/home/user/.local/bin/json @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu if [ -t 0 ]; then echo "${@}" | python3 -m json.tool --no-ensure-ascii diff --git a/home/user/.local/bin/mirror-site b/home/user/.local/bin/mirror-site index 493b66c..0a8ea6b 100755 --- a/home/user/.local/bin/mirror-site +++ b/home/user/.local/bin/mirror-site @@ -1,6 +1,4 @@ -#!/bin/sh - -set -eu +#!/bin/sh -eu readonly name="${1}"; shift @@ -23,4 +21,4 @@ wget \ --user-agent "${user_agent}" \ --reject '*.woff*,*.ttf,*.eot,*.js' \ --tries 10 \ - "$@" \ No newline at end of file + "$@" diff --git a/home/user/.local/bin/mpv-service.sh b/home/user/.local/bin/mpv-service.sh index e84bb8d..23a5177 100755 --- a/home/user/.local/bin/mpv-service.sh +++ b/home/user/.local/bin/mpv-service.sh @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu SOCKET_PATH="/tmp/mpv-${USER}.sock" diff --git a/home/user/.local/bin/open b/home/user/.local/bin/open index 7c00163..c1784ac 100755 --- a/home/user/.local/bin/open +++ b/home/user/.local/bin/open @@ -1,6 +1,4 @@ -#!/bin/sh -set -eu - +#!/bin/sh -eu if [ ! -e "${1}" ]; then printf 'File %s not found' "${1}" >&2 diff --git a/home/user/.local/bin/pasta b/home/user/.local/bin/pasta index ee37ba3..4989dc4 100755 --- a/home/user/.local/bin/pasta +++ b/home/user/.local/bin/pasta @@ -1,7 +1,4 @@ -#!/bin/sh - -set -eu - +#!/bin/sh -eu case "${OSTYPE:-}" in "linux-gnu"*) diff --git a/home/user/.local/bin/pastas b/home/user/.local/bin/pastas index 3efbc1b..9b624f6 100755 --- a/home/user/.local/bin/pastas +++ b/home/user/.local/bin/pastas @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu trap 'exit 0' INT diff --git a/home/user/.local/bin/player b/home/user/.local/bin/player index 57bbd6c..5e129a2 100755 --- a/home/user/.local/bin/player +++ b/home/user/.local/bin/player @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu PROG="$(basename "${0}")" SOCKET_PATH="/tmp/mpv-${USER}.sock" diff --git a/home/user/.local/bin/py b/home/user/.local/bin/py index e224e7e..90c58a6 100755 --- a/home/user/.local/bin/py +++ b/home/user/.local/bin/py @@ -1,6 +1,4 @@ -#!/bin/sh -set -eu - +#!/bin/sh -eu if [ -z "${*}" ] && [ -x "$(command -v ipython 2>/dev/null)" ]; then ipython -i -c "q = exit" diff --git a/home/user/.local/bin/radio b/home/user/.local/bin/radio index b445486..978a004 100755 --- a/home/user/.local/bin/radio +++ b/home/user/.local/bin/radio @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu channel="${1:-}" diff --git a/home/user/.local/bin/rmt b/home/user/.local/bin/rmt index fccb5ef..2d09716 100755 --- a/home/user/.local/bin/rmt +++ b/home/user/.local/bin/rmt @@ -1,4 +1,3 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu gio trash "${@}" diff --git a/home/user/.local/bin/scratch b/home/user/.local/bin/scratch index e90748f..4b9ff19 100755 --- a/home/user/.local/bin/scratch +++ b/home/user/.local/bin/scratch @@ -1,6 +1,4 @@ -#!/bin/sh -set -eu - +#!/bin/sh -eu file="$(mktemp)" echo "Editing ${file}" diff --git a/home/user/.local/bin/screenshot b/home/user/.local/bin/screenshot index 78bc74b..dbb4117 100755 --- a/home/user/.local/bin/screenshot +++ b/home/user/.local/bin/screenshot @@ -1,6 +1,4 @@ -#!/usr/bin/env zsh - -set -euo pipefail +#!/usr/bin/env -S zsh -euo pipefail readonly LOG_FILE="${HOME}/.screenshots.log" readonly NOTIFY_TIME_LOW_MS=1500 diff --git a/home/user/.local/bin/serveit b/home/user/.local/bin/serveit index 1ec7e8a..b24eb9b 100755 --- a/home/user/.local/bin/serveit +++ b/home/user/.local/bin/serveit @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu PROGRAM="$(basename "${0}")" diff --git a/home/user/.local/bin/sha b/home/user/.local/bin/sha index 00139a6..54cd8fb 100755 --- a/home/user/.local/bin/sha +++ b/home/user/.local/bin/sha @@ -1,6 +1,4 @@ -#!/bin/sh -set -eu - +#!/bin/sh -eu if [ -n "${2+x}" ]; then shasum -a 256 "${@}" diff --git a/home/user/.local/bin/showtips b/home/user/.local/bin/showtips index 5eb95d0..6b818bd 100755 --- a/home/user/.local/bin/showtips +++ b/home/user/.local/bin/showtips @@ -1,6 +1,4 @@ -#!/bin/sh -set -eu - +#!/bin/sh -eu readonly tips_dir="${HOME}/.tips" diff --git a/home/user/.local/bin/split-file b/home/user/.local/bin/split-file index f1bfb51..f0a0069 100755 --- a/home/user/.local/bin/split-file +++ b/home/user/.local/bin/split-file @@ -1,7 +1,4 @@ -#!/bin/sh - -set -eu - +#!/bin/sh -eu if [ ! -e "${1}" ]; then echo "file '${1}' not found" >&2 @@ -12,4 +9,4 @@ readonly size="${2:-1G}" mkdir "${1}.splitted" cd "${1}.splitted" -split -d -b "${size}" "../${1}" \ No newline at end of file +split -d -b "${size}" "../${1}" diff --git a/home/user/.local/bin/starsector b/home/user/.local/bin/starsector index 3f6e402..b703c37 100755 --- a/home/user/.local/bin/starsector +++ b/home/user/.local/bin/starsector @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu cd "${HOME}/Games/starsector" ./starsector.sh diff --git a/home/user/.local/bin/timer b/home/user/.local/bin/timer index f30c57a..cfbebbe 100755 --- a/home/user/.local/bin/timer +++ b/home/user/.local/bin/timer @@ -1,6 +1,4 @@ -#!/bin/sh - -set -eu +#!/bin/sh -eu sleep "${@}" diff --git a/home/user/.local/bin/tryna b/home/user/.local/bin/tryna index ebeb9b9..951b3a9 100755 --- a/home/user/.local/bin/tryna +++ b/home/user/.local/bin/tryna @@ -1,8 +1,6 @@ -#!/bin/sh +#!/bin/sh -u # Выполнять, пока команда падает -set -u - while ! "${@}" ; do sleep 0.5 done diff --git a/home/user/.local/bin/trynafail b/home/user/.local/bin/trynafail index 8a81e10..c5ec2fe 100755 --- a/home/user/.local/bin/trynafail +++ b/home/user/.local/bin/trynafail @@ -1,8 +1,6 @@ -#!/bin/sh +#!/bin/sh -u # Выполнять, пока команда не упадет. -set -u - while "${@}"; do sleep 0.5 done diff --git a/home/user/.local/bin/wake b/home/user/.local/bin/wake index 4e9f618..80424fb 100755 --- a/home/user/.local/bin/wake +++ b/home/user/.local/bin/wake @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu if "${@}"; then beep -f 800 -l 250 -n -f 1000 -l 500 diff --git a/home/user/.local/bin/weather b/home/user/.local/bin/weather index f3db7e0..1e1fc65 100755 --- a/home/user/.local/bin/weather +++ b/home/user/.local/bin/weather @@ -1,5 +1,4 @@ -#!/bin/sh -set -eu +#!/bin/sh -eu readonly city="${1}" curl "wttr.in/${city}" 2>/dev/null | head -n -1 diff --git a/install b/install index ac68b31..f3707b4 100755 --- a/install +++ b/install @@ -1,6 +1,4 @@ -#!/bin/sh - -set -ue +#!/bin/sh -eu readonly TARGET_PATH="${HOME}"