dots


commit
f0e2e22
parent
68cb8e1
author
xxwhirlpool
date
2026-03-10 09:53:17 -0400 EDT
shellcheck-ing old scripts
7 files changed,  +14, -19
M config/.local/bin/batnotif
+1, -1
1@@ -1,6 +1,6 @@
2 #!/usr/bin/env bash
3 
4-battery=$(upower -i $(upower -e | grep 'BAT') | awk '/percentage/ {print $NF}' | sed 's/%//g')
5+battery=$(upower -i "$(upower -e | grep 'BAT')" | awk '/percentage/ {print $NF}' | sed 's/%//g')
6 batteryint=$((battery))
7 
8 if (( "$batteryint" < "20")); then
M config/.local/bin/dict
+1, -1
1@@ -8,7 +8,7 @@ word=$(echo " " | dmenu -i -c -l 10 -p "dictionary!")
2 
3 if [ -n "$word" ]; then
4 	response=$(curl -s --connect-timeout 5 --max-time 10 "https://api.dictionaryapi.dev/api/v2/entries/en_US/$word")
5-	notif=$(echo $response | jq -r '[.[].meanings[] | {pos: .partOfSpeech, def: .definitions[].definition}] | .[:3].[] | "\n\(.pos). \(.def)"')
6+	notif=$(echo "$response" | jq -r '[.[].meanings[] | {pos: .partOfSpeech, def: .definitions[].definition}] | .[:3].[] | "\n\(.pos). \(.def)"')
7 
8 	notify-send -t 40000 "$word" "$notif"
9 fi
M config/.local/bin/mksh
+1, -1
1@@ -1,7 +1,7 @@
2 #!/usr/bin/env bash
3 
4 if [ $# -eq 0 ]; then
5-	echo "Usage: mksh [--bin] [FILENAME]"
6+	echo "Usage: mksh [-b] [FILENAME]"
7 	echo "       --bin puts it in PATH"
8 	echo "       otherwise default to pwd"
9 	exit 1
M config/.local/bin/mvpn
+1, -1
1@@ -2,4 +2,4 @@
2 #
3 # launch any program split-tunneled from mullvad VPN
4 
5-nohup mullvad-exclude $1 > /dev/null || echo "failed to launch $1" 2>&1 &
6+nohup mullvad-exclude "$1" > /dev/null || echo "failed to launch $1" 2>&1 &
M config/.local/bin/nowplaying
+5, -10
 1@@ -2,11 +2,6 @@
 2 # inspired by https://codeberg.org/hyperreal/bin/src/branch/main/amimullvad
 3 #
 4 # 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=""
10 
11 user="springpool"
12 
13@@ -14,9 +9,9 @@ apikey=$(pass api/lastfm)
14 
15 URL="https://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&user=$user&api_key=$apikey&format=json&limit=1"
16 
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')
20+artist=$(curl -s "$URL" | jq -r '.recenttracks.track[0].artist."#text"')
21+album=$(curl -s "$URL" | jq -r '.recenttracks.track[0].album."#text"')
22+song=$(curl -s "$URL" | jq -r '.recenttracks.track[0].name')
23 
24 left=$(printf "%s\n%s\n%s\n" "artist" "album" "song")
25 right=$(printf "%s\n%s\n%s\n" "$artist" "$album" "$song")
26@@ -24,7 +19,7 @@ right=$(printf "%s\n%s\n%s\n" "$artist" "$album" "$song")
27 final_left=$(gum style --foreground "#a6d189" --border none --width 20 --margin "1 2" --padding "0 1" --align left "$left")
28 final_right=$(gum style --foreground "#f4b8e4" --border none --width 20 --margin "1 0" --align left "$right")
29 
30-join=$(gum join --horizontal --align right "$final_left" "$final_right")
31-all=$(gum style --border-foreground "#99d1db" --border double --width 50 --padding "0 1" --align center "$join")
32+joingum=$(gum join --horizontal --align right "$final_left" "$final_right")
33+all=$(gum style --border-foreground "#99d1db" --border double --width 50 --padding "0 1" --align center "$joingum")
34 
35 gum join --vertical "$all"
M config/.local/bin/pomodoro
+2, -2
 1@@ -23,7 +23,7 @@ work() {
 2 	notif
 3 }
 4 
 5-break() {
 6+takebreak() {
 7 	val="break"
 8 	echo -e "⏱️ $val ‧₊˚🌈✩ ₊˚🫧⊹♡" | lolcat -p 0.2
 9 	timer "20m"
10@@ -43,7 +43,7 @@ list() {
11 	case "$pick" in
12 		*quick) quick;;
13 		*work) work;;
14-		*break) break;;
15+		*takebreak) takebreak;;
16 		*custom) custom;;
17 		*) exit;;
18 	esac
M config/.local/bin/resizeimg
+3, -3
 1@@ -4,8 +4,8 @@ WORKDIR=$(pwd)
 2 
 3 TMPDIR="/home/kat/Pictures/Camera/tmp-resize"
 4 
 5-cd ${WORKDIR}
 6+cd "$WORKDIR" || exit 1
 7 
 8-for f in *.jpg; do mv $f ${TMPDIR}; done
 9+for f in *.jpg; do mv "$f" "$TMPDIR"; done
10 
11-cd ${TMPDIR} && magick -size 3000x4000 *.jpg -resize 40% "../${f%.*}-resized.jpg" && rm -rf *.jpg
12+cd "$TMPDIR" && magick -size 3000x4000 ./*glob*.jpg -resize 40% "../${f%.*}-resized.jpg" && rm -rf ./*glob*.jpg