commit b32e58bbabb54eb5eeeb02ef4ffc82ace4a3f2f7
parent cc1ef413228a033e15062964d4c2087a97f557e6
Author: regexghost <dev@regexghost.com>
Date: Mon, 31 Aug 2026 20:18:03 +0100
bug fixes in music scripts, consistent prompts in dmenu scripts
Diffstat:
6 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/panel-scripts/music-moc.sh b/panel-scripts/music-moc.sh
@@ -35,6 +35,7 @@ elif [ "$1" = "--previous" ]; then
exit
elif [ "$1" = "--favourite" ]; then
song="$($mocp_command -i | grep "File:" | sed 's/File: //g')"
+ [ "$song" = "" ] && exit
echo "$song" | grep -q "CurrentPlaylist/" && exit
favourite_path="$(echo "$song" | sed "s|$MUSIC_DIR/||g")"
favourite_dir="$(dirname "$favourite_path")"
@@ -70,6 +71,7 @@ if [ "$1" = "--choice" ]; then
# Ask for playlist
playlist="$(ls "$MUSIC_DIR" | sed 's/\([A-Z][a-z]\)/ \1/g' | sed 's/\([a-z]\)\([0-9]\)/\1 \2/g' | sed 's/^ //g' | "${DMENU_SCRIPT}" "Select Playlist:")"
[ "$?" != "0" ] && exit
+ [ "$playlist" = "" ] && exit
playlist_path="$MUSIC_DIR/$(echo "$playlist" | sed 's/ //g')"
else
playlist_path="$MUSIC_DIR/CurrentPlaylist"
diff --git a/panel-scripts/music-mpd.sh b/panel-scripts/music-mpd.sh
@@ -23,6 +23,7 @@ elif [ "$1" = "--previous" ]; then
exit
elif [ "$1" = "--favourite" ]; then
song="$(mpc current -f '%file%')"
+ [ "$song" = "" ] && exit
echo "$song" | grep -q "CurrentPlaylist/" && exit
favourite_path="$song"
favourite_dir="$(dirname "$favourite_path")"
@@ -63,6 +64,7 @@ fi
if [ $(find "$playlist_path" -type d | wc -l) -ne 1 ]; then
playlist="$(ls "$playlist_path" | sed 's/\([A-Z][a-z]\)/ \1/g' | sed 's/\([a-z]\)\([0-9]\)/\1 \2/g' | sed 's/^ //g' | awk 'BEGIN {RS = ""} {print "All\n"$0}' | "${DMENU_SCRIPT}" "Select Playlist:")"
[ "$?" != "0" ] && exit
+ [ "$playlist" = "" ] && exit
# If all songs, don't change playlist path
if ! [ "$playlist" = "All" ]; then
playlist_path="$playlist_path/$(echo "$playlist" | sed 's/ //g')"
diff --git a/wm-scripts/bookmarks.sh b/wm-scripts/bookmarks.sh
@@ -3,7 +3,7 @@
DMENU_SCRIPT="$XDG_DATA_HOME/regexghost/wm-scripts/dmenu-runner.sh"
BOOKMARKS_FILE="$XDG_DATA_HOME/regexghost/script-data/bookmarks.txt"
-output="$(cat "$BOOKMARKS_FILE" | sed 's/DELIM.*//g' | "$DMENU_SCRIPT" "Select Bookmark:")"
+output="$(cat "$BOOKMARKS_FILE" | sed 's/DELIM.*//g' | "$DMENU_SCRIPT" "Select bookmark:")"
status=$?
real_bookmark=$(cat "$BOOKMARKS_FILE" | grep "${output}DELIM" | sed 's/.*DELIM//g')
diff --git a/wm-scripts/dmenu-programs.sh b/wm-scripts/dmenu-programs.sh
@@ -2,4 +2,4 @@
DMENU_RUNNER="$XDG_DATA_HOME/regexghost/wm-scripts/dmenu-runner.sh"
-dmenu_path | "$DMENU_RUNNER" | ${SHELL:-"/bin/sh"} &
+dmenu_path | "$DMENU_RUNNER" "Select program:" | ${SHELL:-"/bin/sh"} &
diff --git a/wm-scripts/launch-stream.sh b/wm-scripts/launch-stream.sh
@@ -8,7 +8,7 @@ STREAMS_FILE="$XDG_CONFIG_HOME/regexghost/streams.csv"
DMENU_SCRIPT="$XDG_DATA_HOME/regexghost/wm-scripts/dmenu-runner.sh"
-stream="$(cat "$STREAMS_FILE" | cut -d "," -f 1 | "$DMENU_SCRIPT" "Select Stream:" -ix)"
+stream="$(cat "$STREAMS_FILE" | cut -d "," -f 1 | "$DMENU_SCRIPT" "Select stream:" -ix)"
[ "$stream" = "" ] && exit
diff --git a/wm-scripts/snippets.sh b/wm-scripts/snippets.sh
@@ -5,7 +5,7 @@
DMENU_SCRIPT="$XDG_DATA_HOME/regexghost/wm-scripts/dmenu-runner.sh"
SNIPPETS_DIR="$XDG_DATA_HOME/regexghost/snippets"
-output="$(ls "$SNIPPETS_DIR" | "$DMENU_SCRIPT" "Select Snippet:")"
+output="$(ls "$SNIPPETS_DIR" | "$DMENU_SCRIPT" "Select snippet:")"
status=$?
[ "$output" = "" ] && exit