Merge pull request #2 from Mango0x45/patch-2

Conditionals the Luke Smith way!
This commit is contained in:
Ahmad Ansori Palembani 2020-10-06 09:11:40 +07:00 committed by GitHub
commit 003872a6e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -42,9 +42,7 @@ options="$previous\n$play_pause\n$stop\n$next\n$tog_repeat\n$tog_random"
# Get the current playing song # Get the current playing song
current=$(mpc -f %title% current) current=$(mpc -f %title% current)
# If mpd isn't running it will return an empty string, we don't want to display that # If mpd isn't running it will return an empty string, we don't want to display that
if [[ -z "$current" ]]; then [[ -z "$current" ]] && current="-"
current="-"
fi
# Spawn the mpd menu with the "Play / Pause" entry selected by default # Spawn the mpd menu with the "Play / Pause" entry selected by default
chosen="$(echo -e "$options" | $rofi_command -p "$current" -dmenu $active $urgent -selected-row 1)" chosen="$(echo -e "$options" | $rofi_command -p "$current" -dmenu $active $urgent -selected-row 1)"