Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
0b3e3a59
Unverified
Commit
0b3e3a59
authored
Dec 29, 2019
by
dylan
Committed by
GitHub
Dec 29, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1382 from arisinfenix/song
song: print empty tags correctly
parents
5c7ad91b
92246e7b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
23 deletions
+22
-23
neofetch
neofetch
+22
-23
No files found.
neofetch
View file @
0b3e3a59
...
@@ -2596,16 +2596,14 @@ get_song() {
...
@@ -2596,16 +2596,14 @@ get_song() {
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' \
org.freedesktop.DBus.Properties.Get string:'org.mpris.MediaPlayer2.Player' \
string:'Metadata' |\
string:'Metadata' |\
awk -F '"' 'BEGIN {RS=" entry"}; /"xesam:artist"/ {a = $4} /"xesam:album"/ {b = $4}
awk -F '"' 'BEGIN {RS=" entry"}; /"xesam:artist"/ {a = $4} /"xesam:album"/ {b = $4}
/"xesam:title"/ {t = $4} END {print a "
\n" b "
\n" t}'
/"xesam:title"/ {t = $4} END {print a "
\n" b "
\n" t}'
)"
)"
}
}
case ${player/*\/} in
case ${player/*\/} in
"mpd"*|"mopidy"*) song="$(mpc -f '%artist%\n%album%\n%title%' current "${mpc_args[@]}")" ;;
"mocp"*) song="$(mocp -Q '%artist \n%album \n%song')" ;;
"mocp"*) song="$(mocp -Q '%artist\n%album\n%song')" ;;
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist% \\n%album% \\n%title%')" ;;
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist%\\n%album%\\n%title%')" ;;
"qmmp"*) song="$(qmmp --nowplaying '%p \n%a \n%t')" ;;
"xmms2d"*) song="$(xmms2 current -f "\${artist}"$'\n'"\${album}"$'\n'"\${title}")" ;;
"qmmp"*) song="$(qmmp --nowplaying '%p\\n%a\\n%t')" ;;
"gnome-music"*) get_song_dbus "GnomeMusic" ;;
"gnome-music"*) get_song_dbus "GnomeMusic" ;;
"lollypop"*) get_song_dbus "Lollypop" ;;
"lollypop"*) get_song_dbus "Lollypop" ;;
"clementine"*) get_song_dbus "clementine" ;;
"clementine"*) get_song_dbus "clementine" ;;
...
@@ -2632,19 +2630,20 @@ get_song() {
...
@@ -2632,19 +2630,20 @@ get_song() {
"plasma-browser-integration"*) get_song_dbus "plasma-browser-integration" ;;
"plasma-browser-integration"*) get_song_dbus "plasma-browser-integration" ;;
"io.elementary.music"*) get_song_dbus "Music" ;;
"io.elementary.music"*) get_song_dbus "Music" ;;
"mpd"* | "mopidy"*)
song="$(mpc -f '%artist% \n%album% \n%title%' current "${mpc_args[@]}")"
;;
"xmms2d"*)
song="$(xmms2 current -f "\${artist}"$' \n'"\${album}"$' \n'"\${title}")"
;;
"cmus"*)
"cmus"*)
# NOTE: cmus >= 2.8.0 supports mpris2
# NOTE: cmus >= 2.8.0 supports mpris2
song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "};
song="$(cmus-remote -Q | awk '/tag artist/ {$1=$2=""; a=$0}
/tag artist/ {
/tag album / {$1=$2=""; b=$0}
$1=$2=""; sub(" ", ""); a=$0
/tag title/ {$1=$2=""; t=$0}
}
END {print a " \n" b " \n" t}')"
/tag album / {
$1=$2=""; sub(" ", ""); b=$0
}
/tag title/ {
$1=$2=""; sub(" ", ""); t=$0
}
END { print a "\n" b "\n" t }')"
;;
;;
"spotify"*)
"spotify"*)
...
@@ -2668,7 +2667,7 @@ get_song() {
...
@@ -2668,7 +2667,7 @@ get_song() {
"banshee"*)
"banshee"*)
song="$(banshee --query-artist --query-album --query-title |\
song="$(banshee --query-artist --query-album --query-title |\
awk -F':' '/^artist/ {a=$2} /^album/ {b=$2} /^title/ {t=$2}
awk -F':' '/^artist/ {a=$2} /^album/ {b=$2} /^title/ {t=$2}
END {print a "
\n" b "
\n"t}')"
END {print a "
\n" b "
\n"t}')"
;;
;;
"exaile"*)
"exaile"*)
...
@@ -2678,31 +2677,31 @@ get_song() {
...
@@ -2678,31 +2677,31 @@ get_song() {
awk -F ':' '{sub(",[^,]*$", "", $3); t=$3;
awk -F ':' '{sub(",[^,]*$", "", $3); t=$3;
sub(",[^,]*$", "", $4); a=$4;
sub(",[^,]*$", "", $4); a=$4;
sub(",[^,]*$", "", $5); b=$5}
sub(",[^,]*$", "", $5); b=$5}
END {print a "
\n" b "
\n" t}')"
END {print a "
\n" b "
\n" t}')"
;;
;;
"muine"*)
"muine"*)
song="$(dbus-send --print-reply --dest=org.gnome.Muine /org/gnome/Muine/Player \
song="$(dbus-send --print-reply --dest=org.gnome.Muine /org/gnome/Muine/Player \
org.gnome.Muine.Player.GetCurrentSong |
org.gnome.Muine.Player.GetCurrentSong |
awk -F':' '/^artist/ {a=$2} /^album/ {b=$2} /^title/ {t=$2}
awk -F':' '/^artist/ {a=$2} /^album/ {b=$2} /^title/ {t=$2}
END {print a "
\n" b "
\n" t}')"
END {print a "
\n" b "
\n" t}')"
;;
;;
"quodlibet"*)
"quodlibet"*)
song="$(dbus-send --print-reply --dest=net.sacredchao.QuodLibet \
song="$(dbus-send --print-reply --dest=net.sacredchao.QuodLibet \
/net/sacredchao/QuodLibet net.sacredchao.QuodLibet.CurrentSong |\
/net/sacredchao/QuodLibet net.sacredchao.QuodLibet.CurrentSong |\
awk -F'"' 'BEGIN {RS=" entry"}; /"artist"/ {a=$4} /"album"/ {b=$4}
awk -F'"' 'BEGIN {RS=" entry"}; /"artist"/ {a=$4} /"album"/ {b=$4}
/"title"/ {t=$4} END {print a "
\n" b "
\n" t}')"
/"title"/ {t=$4} END {print a "
\n" b "
\n" t}')"
;;
;;
"pogo"*)
"pogo"*)
song="$(dbus-send --print-reply --dest=org.mpris.pogo /Player \
song="$(dbus-send --print-reply --dest=org.mpris.pogo /Player \
org.freedesktop.MediaPlayer.GetMetadata |
org.freedesktop.MediaPlayer.GetMetadata |
awk -F'"' 'BEGIN {RS=" entry"}; /"artist"/ {a=$4} /"album"/ {b=$4}
awk -F'"' 'BEGIN {RS=" entry"}; /"artist"/ {a=$4} /"album"/ {b=$4}
/"title"/ {t=$4} END {print a "
\n" b "
\n" t}')"
/"title"/ {t=$4} END {print a "
\n" b "
\n" t}')"
;;
;;
*) mpc &>/dev/null && song="$(mpc -f '%artist%
\n%album%
\n%title%' current)" || return ;;
*) mpc &>/dev/null && song="$(mpc -f '%artist%
\n%album%
\n%title%' current)" || return ;;
esac
esac
IFS=$'\n' read -d "" -r artist album title <<< "${song//'\n'/$'\n'}"
IFS=$'\n' read -d "" -r artist album title <<< "${song//'\n'/$'\n'}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment