Conditionals the Luke Smith way!

This commit is contained in:
Thomas Voss 2020-10-04 18:09:26 +02:00 committed by GitHub
parent 41b8e38aff
commit bb78f8d3d3
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
current=$(mpc -f %title% current)
# If mpd isn't running it will return an empty string, we don't want to display that
if [[ -z "$current" ]]; then
current="-"
fi
[[ -z "$current" ]] && current="-"
# 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)"