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
f887280a
Commit
f887280a
authored
Jan 06, 2017
by
Dylan Araps
Committed by
GitHub
Jan 06, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #597 from mstraube/song
Song: Add support for Yarock and Qmmp
parents
31e8ebda
4b1b77bf
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
neofetch
neofetch
+9
-5
No files found.
neofetch
View file @
f887280a
...
@@ -1199,7 +1199,7 @@ get_memory() {
...
@@ -1199,7 +1199,7 @@ get_memory() {
get_song
()
{
get_song
()
{
# This is absurdly long.
# This is absurdly long.
player
=
"
$(
ps x |
awk
'!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|xmms2d|gnome-music|lollypop|clementine|pragha|exaile|juk|bluemindo|guayadeque/ {printf $5 " " $6; exit}'
)
"
player
=
"
$(
ps x |
awk
'!(/awk|Helper|Cache/) && /mpd|cmus|mocp|spotify|Google Play|iTunes.app|rhythmbox|banshee|amarok|deadbeef|audacious|xmms2d|gnome-music|lollypop|clementine|pragha|exaile|juk|bluemindo|guayadeque
|yarock|qmmp
/ {printf $5 " " $6; exit}'
)
"
get_song_dbus
()
{
get_song_dbus
()
{
# Multiple players use an almost identical dbus command to get the information.
# Multiple players use an almost identical dbus command to get the information.
...
@@ -1217,15 +1217,17 @@ get_song() {
...
@@ -1217,15 +1217,17 @@ get_song() {
"mocp"
*
)
song
=
"
$(
mocp
-Q
"%artist - %song"
)
"
;;
"mocp"
*
)
song
=
"
$(
mocp
-Q
"%artist - %song"
)
"
;;
"google play"
*
)
song
=
"
$(
gpmdp-remote current
)
"
;;
"google play"
*
)
song
=
"
$(
gpmdp-remote current
)
"
;;
"rhythmbox"
*
)
song
=
"
$(
rhythmbox-client
--print-playing
)
"
;;
"rhythmbox"
*
)
song
=
"
$(
rhythmbox-client
--print-playing
)
"
;;
"deadbeef"
*
)
song
=
"
$(
deadbeef
--nowplaying
'%a - %t
'
)
"
;;
"deadbeef"
*
)
song
=
"
$(
deadbeef
--nowplaying
-tf
'%artist% - %title%
'
)
"
;;
"audacious"
*
)
song
=
"
$(
audtool current-song
)
"
;;
"audacious"
*
)
song
=
"
$(
audtool current-song
)
"
;;
"xmms2d"
*
)
song
=
"
$(
xmms2 current
-f
'${artist} - ${title}'
)
"
;;
"xmms2d"
*
)
song
=
"
$(
xmms2 current
-f
'${artist} - ${title}'
)
"
;;
"qmmp"
*
)
song
=
"
$(
qmmp
--nowplaying
'%p - %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"
;;
"juk"
*
)
get_song_dbus
"juk"
;;
"juk"
*
)
get_song_dbus
"juk"
;;
"bluemindo"
*
)
get_song_dbus
"Bluemindo"
;;
"bluemindo"
*
)
get_song_dbus
"Bluemindo"
;;
"guayadeque"
*
)
get_song_dbus
"guayadeque"
;;
"guayadeque"
*
)
get_song_dbus
"guayadeque"
;;
"yarock"
*
)
get_song_dbus
"yarock"
;;
"cmus"
*
)
"cmus"
*
)
song
=
"
$(
cmus-remote
-Q
|
awk
'/tag artist/ {$1=$2=""; print; print " - "} /tag title/ {$1=$2=""; print}'
)
"
song
=
"
$(
cmus-remote
-Q
|
awk
'/tag artist/ {$1=$2=""; print; print " - "} /tag title/ {$1=$2=""; print}'
)
"
...
@@ -1246,15 +1248,15 @@ get_song() {
...
@@ -1246,15 +1248,15 @@ get_song() {
;;
;;
"banshee"
*
)
"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"
*
)
"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"
*
)
"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"
*
)
"exaile"
*
)
...
@@ -1263,6 +1265,8 @@ get_song() {
...
@@ -1263,6 +1265,8 @@ get_song() {
;;
;;
esac
esac
[[
"
$(
trim
"
$song
"
)
"
=
"-"
]]
&&
unset
-
v song
# Display Artist and Title on separate lines.
# Display Artist and Title on separate lines.
if
[[
"
$song_shorthand
"
==
"on"
]]
;
then
if
[[
"
$song_shorthand
"
==
"on"
]]
;
then
artist
=
"
${
song
/ -*
}
"
artist
=
"
${
song
/ -*
}
"
...
...
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