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
e213ee7e
Unverified
Commit
e213ee7e
authored
Jan 07, 2019
by
Dylan Araps
Committed by
GitHub
Jan 07, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1151 from dylanaraps/song_fix5
song: Fix various issues
parents
17a56081
ee30f29d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
14 deletions
+21
-14
neofetch
neofetch
+21
-14
No files found.
neofetch
View file @
e213ee7e
...
@@ -76,6 +76,7 @@ print_info() {
...
@@ -76,6 +76,7 @@ print_info() {
# info "Battery" battery
# info "Battery" battery
# info "Font" font
# info "Font" font
# info "Song" song
# info "Song" song
# [[ $player ]] && prin "Music Player" "$player"
# info "Local IP" local_ip
# info "Local IP" local_ip
# info "Public IP" public_ip
# info "Public IP" public_ip
# info "Users" users
# info "Users" users
...
@@ -429,7 +430,6 @@ disk_subtitle="mount"
...
@@ -429,7 +430,6 @@ disk_subtitle="mount"
# exaile
# exaile
# gnome-music
# gnome-music
# gmusicbrowser
# gmusicbrowser
# Google Play
# guayadeque
# guayadeque
# iTunes
# iTunes
# juk
# juk
...
@@ -437,6 +437,7 @@ disk_subtitle="mount"
...
@@ -437,6 +437,7 @@ disk_subtitle="mount"
# mocp
# mocp
# mopidy
# mopidy
# mpd
# mpd
# netease-cloud-music
# pogo
# pogo
# pragha
# pragha
# qmmp
# qmmp
...
@@ -2339,7 +2340,6 @@ get_song() {
...
@@ -2339,7 +2340,6 @@ get_song() {
"exaile"
"exaile"
"gnome-music"
"gnome-music"
"gmusicbrowser"
"gmusicbrowser"
"Google Play"
"guayadeque"
"guayadeque"
"iTunes"
"iTunes"
"juk"
"juk"
...
@@ -2347,6 +2347,7 @@ get_song() {
...
@@ -2347,6 +2347,7 @@ get_song() {
"mocp"
"mocp"
"mopidy"
"mopidy"
"mpd"
"mpd"
"netease-cloud-music"
"pogo"
"pogo"
"pragha"
"pragha"
"qmmp"
"qmmp"
...
@@ -2384,10 +2385,9 @@ get_song() {
...
@@ -2384,10 +2385,9 @@ get_song() {
case "${player/*\/}" in
case "${player/*\/}" in
"mpd"*|"mopidy"*) song="$(mpc -f '%artist%\n%album%\n%title%' current "${mpc_args[@]}")" ;;
"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')" ;;
"google play"*) song="$(gpmdp-remote current)" ;;
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist%\\n%album%\\n%title%')" ;;
"deadbeef"*) song="$(deadbeef --nowplaying-tf '%artist%\n%album%\n%title%')" ;;
"xmms2d"*) song="$(xmms2 current -f "\${artist}"$'\n'"\${album}"$'\n'"\${title}")" ;;
"xmms2d"*) song="$(xmms2 current -f "\${artist}"$'\n'"\${album}"$'\n'"\${title}")" ;;
"qmmp"*) song="$(qmmp --nowplaying '%p\
n%a
\n%t')" ;;
"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" ;;
...
@@ -2407,6 +2407,7 @@ get_song() {
...
@@ -2407,6 +2407,7 @@ get_song() {
"dragon"*) get_song_dbus "dragonplayer" ;;
"dragon"*) get_song_dbus "dragonplayer" ;;
"smplayer"*) get_song_dbus "smplayer" ;;
"smplayer"*) get_song_dbus "smplayer" ;;
"rhythmbox"*) get_song_dbus "rhythmbox" ;;
"rhythmbox"*) get_song_dbus "rhythmbox" ;;
"netease-cloud-music"*) get_song_dbus "netease-cloud-music" ;;
"cmus"*)
"cmus"*)
song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "};
song="$(cmus-remote -Q | awk 'BEGIN { ORS=" "};
...
@@ -2467,22 +2468,28 @@ get_song() {
...
@@ -2467,22 +2468,28 @@ get_song() {
/"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)" ;;
*) mpc &>/dev/null && song="$(mpc -f '%artist%\n%album%\n%title%' current)"
|| return
;;
esac
esac
[[ "$song" != *[a-z]* ]] && { unset -v song; return; }
IFS=$'\n' read -d "" -r artist album title <<< "${song//'\n'/$'\n'}"
IFS=$'\n' read -d "" -r artist album title <<< "$song"
# Make sure empty tags are truly empty.
artist="$(trim "$artist")"
album="$(trim "$album")"
title="$(trim "$title")"
# Set default values if no tags were found.
: "${artist:=Unknown Artist}" "${album:=Unknown Album}" "${title:=Unknown Song}"
# Display Artist, Album and Title on separate lines.
# Display Artist, Album and Title on separate lines.
if [[ "$song_shorthand" == "on" ]]; then
if [[ "$song_shorthand" == "on" ]]; then
[[ "$(trim "$artist")" ]] &&
prin "Artist" "$artist"
prin "Artist" "$artist"
[[ "$(trim "$album")" ]] && prin "Album"
"$album"
prin "Album"
"$album"
[[ "$(trim "$song")" ]] && prin "Song"
"$title"
prin "Song"
"$title"
else
else
song="${song_format/\%artist\%/$
{artist}
}"
song="${song_format/\%artist\%/$
artist
}"
song="${song/\%album\%/$
{album}
}"
song="${song/\%album\%/$
album
}"
song="${song/\%title\%/$
{title}
}"
song="${song/\%title\%/$
title
}"
fi
fi
}
}
...
...
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