Commit f0e2e22

xxwhirlpool  ·  2026-03-10 09:53:17 -0400 EDT
parent 68cb8e1
shellcheck-ing old scripts
7 files changed,  +14, -19
+1, -1
......@@ -1,6 +1,6 @@
11 #!/usr/bin/env bash
22
3-battery=$(upower -i $(upower -e | grep 'BAT') | awk '/percentage/ {print $NF}' | sed 's/%//g')
3+battery=$(upower -i "$(upower -e | grep 'BAT')" | awk '/percentage/ {print $NF}' | sed 's/%//g')
44 batteryint=$((battery))
55
66 if (( "$batteryint" < "20")); then
+1, -1
......@@ -8,7 +8,7 @@ word=$(echo " " | dmenu -i -c -l 10 -p "dictionary!")
88
99 if [ -n "$word" ]; then
1010 response=$(curl -s --connect-timeout 5 --max-time 10 "https://api.dictionaryapi.dev/api/v2/entries/en_US/$word")
11- notif=$(echo $response | jq -r '[.[].meanings[] | {pos: .partOfSpeech, def: .definitions[].definition}] | .[:3].[] | "\n\(.pos). \(.def)"')
11+ notif=$(echo "$response" | jq -r '[.[].meanings[] | {pos: .partOfSpeech, def: .definitions[].definition}] | .[:3].[] | "\n\(.pos). \(.def)"')
1212
1313 notify-send -t 40000 "$word" "$notif"
1414 fi
+1, -1
......@@ -1,7 +1,7 @@
11 #!/usr/bin/env bash
22
33 if [ $# -eq 0 ]; then
4- echo "Usage: mksh [--bin] [FILENAME]"
4+ echo "Usage: mksh [-b] [FILENAME]"
55 echo " --bin puts it in PATH"
66 echo " otherwise default to pwd"
77 exit 1
+1, -1
......@@ -2,4 +2,4 @@
22 #
33 # launch any program split-tunneled from mullvad VPN
44
5-nohup mullvad-exclude $1 > /dev/null || echo "failed to launch $1" 2>&1 &
5+nohup mullvad-exclude "$1" > /dev/null || echo "failed to launch $1" 2>&1 &
+5, -10
......@@ -2,11 +2,6 @@
22 # inspired by https://codeberg.org/hyperreal/bin/src/branch/main/amimullvad
33 #
44 # requires curl & charmbracelet/gum
5-#
6-# i have my API key stored in a private var file sourced by bashrc so either do that too or just uncomment below and put it there
7-#
8-#
9-# LASTFM_APIKEY=""
105
116 user="springpool"
127
......@@ -14,9 +9,9 @@ apikey=$(pass api/lastfm)
149
1510 URL="https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$user&api_key=$apikey&format=json&limit=1"
1611
17-artist=$(curl -s ${URL} | jq -r '.recenttracks.track[0].artist."#text"')
18-album=$(curl -s ${URL} | jq -r '.recenttracks.track[0].album."#text"')
19-song=$(curl -s ${URL} | jq -r '.recenttracks.track[0].name')
12+artist=$(curl -s "$URL" | jq -r '.recenttracks.track[0].artist."#text"')
13+album=$(curl -s "$URL" | jq -r '.recenttracks.track[0].album."#text"')
14+song=$(curl -s "$URL" | jq -r '.recenttracks.track[0].name')
2015
2116 left=$(printf "%s\n%s\n%s\n" "artist" "album" "song")
2217 right=$(printf "%s\n%s\n%s\n" "$artist" "$album" "$song")
......@@ -24,7 +19,7 @@ right=$(printf "%s\n%s\n%s\n" "$artist" "$album" "$song")
2419 final_left=$(gum style --foreground "#a6d189" --border none --width 20 --margin "1 2" --padding "0 1" --align left "$left")
2520 final_right=$(gum style --foreground "#f4b8e4" --border none --width 20 --margin "1 0" --align left "$right")
2621
27-join=$(gum join --horizontal --align right "$final_left" "$final_right")
28-all=$(gum style --border-foreground "#99d1db" --border double --width 50 --padding "0 1" --align center "$join")
22+joingum=$(gum join --horizontal --align right "$final_left" "$final_right")
23+all=$(gum style --border-foreground "#99d1db" --border double --width 50 --padding "0 1" --align center "$joingum")
2924
3025 gum join --vertical "$all"
+2, -2
......@@ -23,7 +23,7 @@ work() {
2323 notif
2424 }
2525
26-break() {
26+takebreak() {
2727 val="break"
2828 echo -e "⏱️ $val ‧₊˚🌈✩ ₊˚🫧⊹♡" | lolcat -p 0.2
2929 timer "20m"
......@@ -43,7 +43,7 @@ list() {
4343 case "$pick" in
4444 *quick) quick;;
4545 *work) work;;
46- *break) break;;
46+ *takebreak) takebreak;;
4747 *custom) custom;;
4848 *) exit;;
4949 esac
+3, -3
......@@ -4,8 +4,8 @@ WORKDIR=$(pwd)
44
55 TMPDIR="/home/kat/Pictures/Camera/tmp-resize"
66
7-cd ${WORKDIR}
7+cd "$WORKDIR" || exit 1
88
9-for f in *.jpg; do mv $f ${TMPDIR}; done
9+for f in *.jpg; do mv "$f" "$TMPDIR"; done
1010
11-cd ${TMPDIR} && magick -size 3000x4000 *.jpg -resize 40% "../${f%.*}-resized.jpg" && rm -rf *.jpg
11+cd "$TMPDIR" && magick -size 3000x4000 ./*glob*.jpg -resize 40% "../${f%.*}-resized.jpg" && rm -rf ./*glob*.jpg