ptgdp: Properly handle invoking -R with a file
This commit is contained in:
11
ptgdp
11
ptgdp
@@ -278,6 +278,8 @@ rofimenu() {
|
|||||||
error "Could not open directory \"$_optrofi\"" 2
|
error "Could not open directory \"$_optrofi\"" 2
|
||||||
else
|
else
|
||||||
[ -f "$_optrofi" ] || error "Could not open file \"$_optrofi\"" 2
|
[ -f "$_optrofi" ] || error "Could not open file \"$_optrofi\"" 2
|
||||||
|
rofiplaysong "$_optrofi"
|
||||||
|
return $?
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
files=$(find "$_optrofi" -type f -name \*.gdp)
|
files=$(find "$_optrofi" -type f -name \*.gdp)
|
||||||
@@ -324,10 +326,13 @@ rofiplaysong() {
|
|||||||
choice="$(rofi -dmenu -i -p "$prompt" <<< "$songs" 2>/dev/null)"
|
choice="$(rofi -dmenu -i -p "$prompt" <<< "$songs" 2>/dev/null)"
|
||||||
if [ -z "$choice" ]; then
|
if [ -z "$choice" ]; then
|
||||||
# Assume user is looking for another list
|
# Assume user is looking for another list
|
||||||
# Kick him back to the main menu
|
# Kick him back to the main menu, unless he picked a file
|
||||||
rofimenu
|
if ! [ "$_optrofi" = "$1" ]; then
|
||||||
|
rofimenu
|
||||||
|
else
|
||||||
|
error "User aborted at selection" 62
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
log "User picked: $choice"
|
|
||||||
queuesong "$choice"
|
queuesong "$choice"
|
||||||
[ "$?" = "1" ] && return 62
|
[ "$?" = "1" ] && return 62
|
||||||
execqueue
|
execqueue
|
||||||
|
Reference in New Issue
Block a user