Fix linting issues in scripts

This commit is contained in:
Ohad Livne 2025-06-04 22:46:01 +03:00
parent e3d5f15c00
commit c4952aad8f
Signed by: libohad-dev
GPG key ID: 34FDC68B51191A4D
7 changed files with 17 additions and 13 deletions

View file

@ -64,5 +64,7 @@ META_PKGS="\
fonts-noto \ fonts-noto \
" "
# shellcheck disable=SC2086
sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes ${DEB_PKGS} sudo DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --yes ${DEB_PKGS}
# shellcheck disable=SC2086
sudo DEBIAN_FRONTEND=noninteractive apt-get install --install-recommends --yes ${META_PKGS} sudo DEBIAN_FRONTEND=noninteractive apt-get install --install-recommends --yes ${META_PKGS}

View file

@ -1,13 +1,15 @@
#! /usr/bin/sh #! /usr/bin/sh
ssid=$(nmcli --fields SSID,RATE,SIGNAL,BARS device wifi list | fuzzel --dmenu --width 40 | awk '{print $1}') ssid=$(nmcli --fields SSID,RATE,SIGNAL,BARS device wifi list | fuzzel --dmenu --width 40 | awk '{print $1}')
retval=$?
if [ -z "${ssid}" ]; then if [ -z "${ssid}" ]; then
exit $? exit $retval
fi fi
password=$(fuzzel --dmenu --password) password=$(fuzzel --dmenu --password)
if [ $? -ne 0 ]; then retval=$?
exit $? if [ $retval -ne 0 ]; then
exit $retval
fi fi
nmcli device wifi connect "${ssid}" password "${password}" nmcli device wifi connect "${ssid}" password "${password}"

View file

@ -1,7 +1,7 @@
#! /usr/bin/sh #! /usr/bin/sh
rebase_marker="$(git rev-parse --show-toplevel)/.git/rebase-merge/done" rebase_marker="$(git rev-parse --show-toplevel)/.git/rebase-merge/done"
while [ -f ${rebase_marker} ] while [ -f "${rebase_marker}" ]
do do
git sign git sign
git rebase --continue git rebase --continue

View file

@ -13,7 +13,7 @@ backup () {
if "${HOME}/.local/bin/dirtree-changed" --directory "${directory}" --check-file "${TS_DIR}/${target}" if "${HOME}/.local/bin/dirtree-changed" --directory "${directory}" --check-file "${TS_DIR}/${target}"
then then
borg create --compression auto,lzma ::"${target}"-{now} "${directory}" borg create --compression auto,lzma ::"${target}"-\{now\} "${directory}"
touch "${TS_DIR}/${target}" touch "${TS_DIR}/${target}"
fi fi
} }

View file

@ -5,17 +5,17 @@ WATCHLIST=~/.local/share/package-alert/watchlist
agg_results="" agg_results=""
if [ -f "${WATCHLIST}" ]; then if [ -f "${WATCHLIST}" ]; then
for pattern in $(cat "${WATCHLIST}"); do while read -r pattern; do
pat_results=$(apt-cache search --names-only "${pattern}") pat_results=$(apt-cache search --names-only "${pattern}")
if [ ! -z "${pat_results}" ]; then if [ -n "${pat_results}" ]; then
agg_results="${agg_results:+${agg_results} agg_results="${agg_results:+${agg_results}
}Packages matching \"${pattern}\": }Packages matching \"${pattern}\":
${pat_results} ${pat_results}
" "
fi fi
done done < "${WATCHLIST}"
fi fi
if [ ! -z "${agg_results}" ]; then if [ -n "${agg_results}" ]; then
printf '%s' "${agg_results}" | /usr/sbin/sendmail "${USER}" printf '%s' "${agg_results}" | /usr/sbin/sendmail "${USER}"
fi fi

View file

@ -19,7 +19,7 @@ today=$(date +'%Y-%m-%d')
now=$(date +'%H:%M:%S') now=$(date +'%H:%M:%S')
hour=$(echo "${now}" | cut -d: -f1 -) hour=$(echo "${now}" | cut -d: -f1 -)
minute=$(echo "${now}" | cut -d: -f2 -) minute=$(echo "${now}" | cut -d: -f2 -)
if [ "${minute}" \< "30" ]; then if [ "${minute}" -lt 30 ]; then
case "${hour}" in case "${hour}" in
"00"|"12") clock_face="🕛";; "00"|"12") clock_face="🕛";;
"01"|"13") clock_face="🕐";; "01"|"13") clock_face="🕐";;
@ -84,4 +84,4 @@ case "${battery_state}" in
;; ;;
esac esac
echo ${recs} 🕹️${touchpad_active} 📆${today} ${clock_face}${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}% echo "${recs} 🕹️${touchpad_active} 📆${today} ${clock_face}${now} ${audio_symbol}${audio_volume}% ${battery_symbol}${battery}%"

View file

@ -20,11 +20,11 @@ ts() {
} }
screenshot_filename() { screenshot_filename() {
echo ~/Pictures/screenshots/screenshot-$(ts).png echo ~/Pictures/screenshots/screenshot-"$(ts)".png
} }
recording_filename() { recording_filename() {
echo ~/Pictures/screenshots/recording-$(ts).mp4 echo ~/Pictures/screenshots/recording-"$(ts)".mp4
} }
if [ -z "$1" ]; then if [ -z "$1" ]; then