mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-14 04:32:12 +00:00
Song: Don't print empty song generally
This commit is contained in:
8
neofetch
8
neofetch
@@ -1251,15 +1251,15 @@ get_song() {
|
||||
;;
|
||||
|
||||
"banshee"*)
|
||||
song="$(banshee --query-artist --query-title | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')"
|
||||
song="$(banshee --query-artist --query-title | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')"
|
||||
;;
|
||||
|
||||
"amarok"*)
|
||||
song="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')"
|
||||
song="$(qdbus org.kde.amarok /Player GetMetadata | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')"
|
||||
;;
|
||||
|
||||
"pragha"*)
|
||||
song="$(pragha -c | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{if (a && t) print a " - " t}')"
|
||||
song="$(pragha -c | awk -F':' '/^artist/ {a=$2} /^title/ {t=$2} END{print a " - " t}')"
|
||||
;;
|
||||
|
||||
"exaile"*)
|
||||
@@ -1268,6 +1268,8 @@ get_song() {
|
||||
;;
|
||||
esac
|
||||
|
||||
[[ "$(trim "$song")" = "-" ]] && unset -v song
|
||||
|
||||
# Display Artist and Title on separate lines.
|
||||
if [[ "$song_shorthand" == "on" ]]; then
|
||||
artist="${song/ -*}"
|
||||
|
||||
Reference in New Issue
Block a user