Commit dff1fcc
xxwhirlpool
·
2026-05-21 19:10:15 -0400 EDT
parent e28b3a1
split `gum_echo` into its own script bc i use it often
7 files changed,
+43,
-50
+5,
-0
| ... | ... | @@ -0,0 +1,5 @@ | |
| 1 | + | #!/usr/bin/env bash | |
| 2 | + | # | |
| 3 | + | # `echo` but it's in a fun color | |
| 4 | + | ||
| 5 | + | gum style --foreground 212 "$@" |
+0,
-4
| ... | ... | @@ -4,10 +4,6 @@ | |
| 4 | 4 | ||
| 5 | 5 | file="$(mktemp --suffix _scratchpad)" | |
| 6 | 6 | ||
| 7 | - | gum_echo() { | |
| 8 | - | gum style --foreground 212 "$@" | |
| 9 | - | } | |
| 10 | - | ||
| 11 | 7 | micro "$file" | |
| 12 | 8 | ||
| 13 | 9 | gum_echo "FILEPATH:" |
+2,
-2
| ... | ... | @@ -26,7 +26,7 @@ gum_border() { | |
| 26 | 26 | gum style --foreground "#a6d189" --border-foreground "#99d1db" --border double --width 50 --padding "0 0" --align center "$@" | |
| 27 | 27 | } | |
| 28 | 28 | ||
| 29 | - | gum_echo() { | |
| 29 | + | gum_echo_custom() { | |
| 30 | 30 | gum style --foreground "#f4b8e4" --width 50 --padding "0 0" --align center "🌈✩₊˚.⋆⋆⁺₊✧ $* ✩₊˚.⋆⋆⁺₊✧🦋" && echo -e "\n" | |
| 31 | 31 | } | |
| 32 | 32 |
| ... | ... | @@ -35,6 +35,6 @@ if [[ ! "$time" =~ "m" ]]; then | |
| 35 | 35 | echo "add a time or a time unit (m for minutes)" | |
| 36 | 36 | else | |
| 37 | 37 | gum_border "♥ mini timer ♥" | |
| 38 | - | gum_echo "$time" | |
| 38 | + | gum_echo_custom "$time" | |
| 39 | 39 | timer -n "mini timer" "$time" && notif || exit 1 | |
| 40 | 40 | fi |
+22,
-22
| ... | ... | @@ -30,7 +30,7 @@ declare -A mixtapes=( | |
| 30 | 30 | ||
| 31 | 31 | # little header text graphic to show before playback | |
| 32 | 32 | ||
| 33 | - | gum_echo() { | |
| 33 | + | gum_echo_custom() { | |
| 34 | 34 | top=$(gum style --bold --foreground "#a6d189" --border none --width 50 --margin "1 0" --align center "musicForProgramming();") | |
| 35 | 35 | bottom=$(gum style --foreground "#f4b8e4" --border none --width 50 --margin "1 0" --align center "$@") | |
| 36 | 36 |
| ... | ... | @@ -51,27 +51,27 @@ random_mix() { | |
| 51 | 51 | choice() { | |
| 52 | 52 | choose=$(gum choose --header "mixtapes" "random" {1..20} --height 20) | |
| 53 | 53 | case "$choose" in | |
| 54 | - | random) gum_echo "random!" && random_mix;; | |
| 55 | - | 1) gum_echo "datasette" && mpv "${mixtapes['1']}";; | |
| 56 | - | 2) gum_echo "sunjammer" && mpv "${mixtapes['2']}";; | |
| 57 | - | 3) gum_echo "datassette" && mpv "${mixtapes['3']}";; | |
| 58 | - | 4) gum_echo "com truise" && mpv "${mixtapes['4']}";; | |
| 59 | - | 5) gum_echo "abe mangger" && mpv "${mixtapes['5']}";; | |
| 60 | - | 6) gum_echo "gods of the new age" && mpv "${mixtapes['6']}";; | |
| 61 | - | 7) gum_echo "tahlhoff garten + untitled" && mpv "${mixtapes['7']}";; | |
| 62 | - | 8) gum_echo "connectedness locus" && mpv "${mixtapes['8']}";; | |
| 63 | - | 9) gum_echo "datassette" && mpv "${mixtapes['9']}";; | |
| 64 | - | 10) gum_echo "unity gain temple" && mpv "${mixtapes['10']}";; | |
| 65 | - | 11) gum_echo "miles tilmann" && mpv "${mixtapes['11']}";; | |
| 66 | - | 12) gum_echo "forgotten light" && mpv "${mixtapes['12']}";; | |
| 67 | - | 13) gum_echo "matt whitehead" && mpv "${mixtapes['13']}";; | |
| 68 | - | 14) gum_echo "tahlhoff garten + untitled" && mpv "${mixtapes['14']}";; | |
| 69 | - | 15) gum_echo "dan adeyemi" && mpv "${mixtapes['15']}";; | |
| 70 | - | 16) gum_echo "silent stelios" && mpv "${mixtapes['16']}";; | |
| 71 | - | 17) gum_echo "graphplan" && mpv "${mixtapes['17']}";; | |
| 72 | - | 18) gum_echo "konx om par" && mpv "${mixtapes['18']}";; | |
| 73 | - | 19) gum_echo "hivemind" && mpv "${mixtapes['19']}";; | |
| 74 | - | 20) gum_echo "uberdog" && mpv "${mixtapes['20']}";; | |
| 54 | + | random) gum_echo_custom "random!" && random_mix;; | |
| 55 | + | 1) gum_echo_custom "datasette" && mpv "${mixtapes['1']}";; | |
| 56 | + | 2) gum_echo_custom "sunjammer" && mpv "${mixtapes['2']}";; | |
| 57 | + | 3) gum_echo_custom "datassette" && mpv "${mixtapes['3']}";; | |
| 58 | + | 4) gum_echo_custom "com truise" && mpv "${mixtapes['4']}";; | |
| 59 | + | 5) gum_echo_custom "abe mangger" && mpv "${mixtapes['5']}";; | |
| 60 | + | 6) gum_echo_custom "gods of the new age" && mpv "${mixtapes['6']}";; | |
| 61 | + | 7) gum_echo_custom "tahlhoff garten + untitled" && mpv "${mixtapes['7']}";; | |
| 62 | + | 8) gum_echo_custom "connectedness locus" && mpv "${mixtapes['8']}";; | |
| 63 | + | 9) gum_echo_custom "datassette" && mpv "${mixtapes['9']}";; | |
| 64 | + | 10) gum_echo_custom "unity gain temple" && mpv "${mixtapes['10']}";; | |
| 65 | + | 11) gum_echo_custom "miles tilmann" && mpv "${mixtapes['11']}";; | |
| 66 | + | 12) gum_echo_custom "forgotten light" && mpv "${mixtapes['12']}";; | |
| 67 | + | 13) gum_echo_custom "matt whitehead" && mpv "${mixtapes['13']}";; | |
| 68 | + | 14) gum_echo_custom "tahlhoff garten + untitled" && mpv "${mixtapes['14']}";; | |
| 69 | + | 15) gum_echo_custom "dan adeyemi" && mpv "${mixtapes['15']}";; | |
| 70 | + | 16) gum_echo_custom "silent stelios" && mpv "${mixtapes['16']}";; | |
| 71 | + | 17) gum_echo_custom "graphplan" && mpv "${mixtapes['17']}";; | |
| 72 | + | 18) gum_echo_custom "konx om par" && mpv "${mixtapes['18']}";; | |
| 73 | + | 19) gum_echo_custom "hivemind" && mpv "${mixtapes['19']}";; | |
| 74 | + | 20) gum_echo_custom "uberdog" && mpv "${mixtapes['20']}";; | |
| 75 | 75 | esac | |
| 76 | 76 | } | |
| 77 | 77 |
+0,
-4
| ... | ... | @@ -15,10 +15,6 @@ usage_help() { | |
| 15 | 15 | echo "Options: -f | -h" | |
| 16 | 16 | } | |
| 17 | 17 | ||
| 18 | - | gum_echo() { | |
| 19 | - | gum style --foreground "#f4b8e4" "$@" | |
| 20 | - | } | |
| 21 | - | ||
| 22 | 18 | die() { | |
| 23 | 19 | printf "%s\n" "$1" | |
| 24 | 20 | exit 1 |
+14,
-14
| ... | ... | @@ -20,7 +20,7 @@ declare -A stations=( | |
| 20 | 20 | ||
| 21 | 21 | # little header text graphic to show before playback | |
| 22 | 22 | ||
| 23 | - | gum_echo() { | |
| 23 | + | gum_echo_custom() { | |
| 24 | 24 | top=$(gum style --bold --foreground "#a6d189" --border none --width 50 --margin "1 0" --align center "♥ NOW PLAYING ♥") | |
| 25 | 25 | bottom=$(gum style --foreground "#f4b8e4" --border none --width 50 --margin "1 0" --align center "$@") | |
| 26 | 26 |
| ... | ... | @@ -35,19 +35,19 @@ gum_echo() { | |
| 35 | 35 | choice() { | |
| 36 | 36 | choose=$(gum choose --height 20 --header "radio stations" "kexp" "nts1" "nts2" "dadradio" "indiebeat-pop" "indiebeat-rock" "indiebeat-jazz" "vintageobscura" "hbr1-tranceponder" "hbr1-tronic" "hbr1-dream") | |
| 37 | 37 | case "$choose" in | |
| 38 | - | kexp) gum_echo "KEXP" && mpv "${stations['KEXP']}";; | |
| 39 | - | nts1) gum_echo "NTS1" && mpv "${stations['NTS1']}";; | |
| 40 | - | nts2) gum_echo "NTS2" && mpv "${stations['NTS2']}";; | |
| 41 | - | dadradio) gum_echo "dadradio" && mpv "${stations['dadradio']}";; | |
| 42 | - | indiebeat-pop) gum_echo "indiebeat - pop" && mpv "${stations['indiebeat-pop']}";; | |
| 43 | - | indiebeat-rock) gum_echo "indiebeat - rock" && mpv "${stations['indiebeat-rock']}";; | |
| 44 | - | indiebeat-jazz) gum_echo "indiebeat - jazz" && mpv "${stations['indiebeat-jazz']}";; | |
| 45 | - | indiebeat-electronic) gum_echo "indiebeat - electronic" && mpv "${stations['indiebeat-electronic']}";; | |
| 46 | - | indiebeat-bonkwave) gum_echo "indiebeat - bonkwave" && mpv "${stations['indiebeat-bonkwave']}";; | |
| 47 | - | vintageobscura) gum_echo "vintage obscura" && mpv "${stations['vintageobscura']}";; | |
| 48 | - | hbr1-tranceponder) gum_echo "HBR1 I.D.M. tranceponder" && mpv "${stations['hbr1-tranceponder']}";; | |
| 49 | - | hbr1-tronic) gum_echo "HBR1 tronic lounge" && mpv "${stations['hbr1-tronic']}";; | |
| 50 | - | hbr1-dream) gum_echo "HBR1 dream factory" && mpv "${stations['hbr1-dream']}" | |
| 38 | + | kexp) gum_echo_custom "KEXP" && mpv "${stations['KEXP']}";; | |
| 39 | + | nts1) gum_echo_custom "NTS1" && mpv "${stations['NTS1']}";; | |
| 40 | + | nts2) gum_echo_custom "NTS2" && mpv "${stations['NTS2']}";; | |
| 41 | + | dadradio) gum_echo_custom "dadradio" && mpv "${stations['dadradio']}";; | |
| 42 | + | indiebeat-pop) gum_echo_custom "indiebeat - pop" && mpv "${stations['indiebeat-pop']}";; | |
| 43 | + | indiebeat-rock) gum_echo_custom "indiebeat - rock" && mpv "${stations['indiebeat-rock']}";; | |
| 44 | + | indiebeat-jazz) gum_echo_custom "indiebeat - jazz" && mpv "${stations['indiebeat-jazz']}";; | |
| 45 | + | indiebeat-electronic) gum_echo_custom "indiebeat - electronic" && mpv "${stations['indiebeat-electronic']}";; | |
| 46 | + | indiebeat-bonkwave) gum_echo_custom "indiebeat - bonkwave" && mpv "${stations['indiebeat-bonkwave']}";; | |
| 47 | + | vintageobscura) gum_echo_custom "vintage obscura" && mpv "${stations['vintageobscura']}";; | |
| 48 | + | hbr1-tranceponder) gum_echo_custom "HBR1 I.D.M. tranceponder" && mpv "${stations['hbr1-tranceponder']}";; | |
| 49 | + | hbr1-tronic) gum_echo_custom "HBR1 tronic lounge" && mpv "${stations['hbr1-tronic']}";; | |
| 50 | + | hbr1-dream) gum_echo_custom "HBR1 dream factory" && mpv "${stations['hbr1-dream']}" | |
| 51 | 51 | esac | |
| 52 | 52 | } | |
| 53 | 53 |
+0,
-4