Now Playing Conky

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Now Playing Conky

Post by Bleys »

First something basic about paths in Conky. If Conky is executed inside the conkyrc (conky.conf etc.) directory, it is sufficient to specify all the required files that are located in the conkyrc directory directly with ./ in front of them. A suitable script for the autostart should then look like this:

Code: Select all

#!/bin/bash
#
sleep 5
cd $HOME/.conky
conky -c conkyrc &
exit 0
If conkyrc etc. is located in other directories, the CD command must be adapted accordingly. The same procedure is also recommended for testing. Always run Conky in the terminal for testing in order to see any error messages and open the terminal in the directory in which the scripts to be tested are located.

I will use this procedure in all scripts from now on. The scripts for the Now Playing Conky have already been changed accordingly.
The Now Playing Conky only works with mpris-capable players. With some players you have to activate mpris manually, e.g. qmmp:
qmmp_settings.png
qdbus must be installed so that mpris data can be queried:

Code: Select all

sudo apt install qdbus
If VLC is used, urlencode is required because VLC outputs the path to the cover as an HTML path (%20 instead of a space, for example). Urlencode is included in the gridsite-clients package:

Code: Select all

sudo apt install gridsite-clients
In the terminal you can see what information the selected player provides. Copy the qdbus command from the mpris.sh script:

Code: Select all

qdbus org.mpris.MediaPlayer2.$Player /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata
and replace $Player with the player used. Example for Clementine:

Code: Select all

qdbus org.mpris.MediaPlayer2.clementine /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata
A sample issue:

Code: Select all

bitrate: 128
mpris:artUrl: file:///tmp/clementine-art-tOEtVZ.jpg
mpris:length: 230000000
mpris:trackid: /org/clementineplayer/Clementine/Track/90
xesam:album: Bravo Hits 17
xesam:albumArtist: Various Artists
xesam:artist: Maggie Reilly
xesam:autoRating: 50
xesam:contentCreated: 2023-08-09T22:23:26
xesam:discNumber: 2
xesam:genre: Techno
xesam:lastUsed: 2023-03-21T22:14:50
xesam:title: Listen To Yours Hearth
xesam:trackNumber: 11
xesam:url: file:///home/ralf/Musik/Favoriten/Maggie Reilly - Listen To Yours Hearth.mp3
xesam:useCount: 1
year: 1997
A radio player such as the Radio++ applet provides almost no information. This applet uses mpv for the sound output. The corresponding qdbus command is therefore:

Code: Select all

qdbus org.mpris.MediaPlayer2.mpv /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata
Sample issue Radio BOB:

Code: Select all

mpris:length: 49128000
mpris:trackid: 
xesam:title: BOOMTOWN RATS - I DON'T LIKE MONDAYS
xesam:url: http://live6.infonetmedia.si/Europa05
One Useful information: xesam:title: BOOMTOWN RATS - I DON'T LIKE MONDAYS
To display the radio info I would make another Now Paying Conky. This one is unsuitable for that.

Variationen now.lua
Remove frame: comment out Line 146 ( draw_bg(cr,color,alpha,typ))
Rounded corners: Line 36 (local corner_r=20) 0 for no rounding
Remove Background: comment out Line 144 (draw_bg(cr,color,alpha,typ)
variationen.jpg
ScriptS: https://gist.github.com/rdschmidt/8c04a ... 040d41f7c6

Note for testing: you can move any Conky window on the display by holding down the ALT key and left mouse button.
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

PROGRESS!!

Image

I just tried 3 different files, but I am not getting any album art display
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

For me this is only working partially with Qmmp.

I switched the line in .lua from "qmmp" to "vlc" and got no display whatsoever.

Any Ideas on enabling the album art display?
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: Now Playing Conky

Post by Bleys »

Logansfury wrote: Sun Feb 18, 2024 9:31 am
I just tried 3 different files, but I am not getting any album art display
Where are the Covers of your Songs?

qdbus Output for artUrl?:

qdbus org.mpris.MediaPlayer2.YOURPLAYER /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep mpris:artUrl:
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: Now Playing Conky

Post by Bleys »

My Simple Now Playing and Now Playing: no Problems
Screen Capture_select-area_20240218145912.jpg
mpris Output vlc:

Code: Select all

ralf@Nexus:~/.conky/SimplyNowPlaying$ qdbus org.mpris.MediaPlayer2.vlc /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata
mpris:artUrl: file:///home/ralf/.cache/vlc/art/artistalbum/Roxette/Absolute%20Kidz%204/art.jpg
mpris:length: 241440590
mpris:trackid: 
vlc:length: 241440
vlc:publisher: 3
vlc:time: 241
xesam:album: Absolute Kidz 4
xesam:artist: Roxette
xesam:contentCreated: 2001
xesam:genre: Unknown
xesam:title: Milk And Toast And Honey
xesam:tracknumber: 10
xesam:url: file:///home/ralf/Musik/Favoriten/Roxette%20-%20Milk%20And%20Toast%20And%20Honey.mp3
ralf@Nexus:~/.conky/SimplyNowPlaying$ 

Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

I have an Album Art directory in my /home/logansfury/Music directory.

Song files placed in this directory seem to automatically acquire the album art.

I have done this edit in mpris.sh, is this correct?

Code: Select all

	COVER=$(qdbus org.mpris.MediaPlayer2.qmmp /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata | grep "artUrl:")
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

I dont appear to have an arturl when I do the terminal command:

Code: Select all

logansfury@OptiPlex-5040:~$ qdbus org.mpris.MediaPlayer2.qmmp /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata
mpris:length: 185208000
mpris:trackid: 
xesam:album: Love Gun
xesam:artist: Kiss
xesam:contentCreated: 1977
xesam:genre: Glam Rock
xesam:title: I Stole Your Love
xesam:trackNumber: 1
xesam:url: file:///home/logansfury/Music/KISS 01. I Stole Your Love.mp3
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: Now Playing Conky

Post by Bleys »

Logansfury wrote: Sun Feb 18, 2024 10:03 am
I have done this edit in mpris.sh, is this correct?
NO! Never change the sh file!

the LUA script calls the sh file and passes the correct player:

Code: Select all

--        player="clementine"
--        player="audacious"
        player="vlc"
--        player="mpv"
        running(cr,player)
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

Bleys wrote: Sun Feb 18, 2024 10:20 am
Logansfury wrote: Sun Feb 18, 2024 10:03 am
I have done this edit in mpris.sh, is this correct?
NO! Never change the sh file!

the LUA script calls the sh file and passes the correct player:

Code: Select all

--        player="clementine"
--        player="audacious"
        player="vlc"
--        player="mpv"
        running(cr,player)
My bad. I have restored the original mpris.sh. Any idea why I have no album art URL line when I do the metadata command in terminal?
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: Now Playing Conky

Post by Bleys »

Logansfury wrote: Sun Feb 18, 2024 10:26 am
My bad. I have restored the original mpris.sh. Any idea why I have no album art URL line when I do the metadata command in terminal?
Screen Capture_select-area_20240218152715.jpg
qmmp searches with the standard settings only in the directory of the songs...

And in VLC you have to add the Cover Path in the Settings.
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

I changed the 0 to 1 then 5 but neither edit had any effect.

Where do you keep music art on your system?

Image
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: Now Playing Conky

Post by Bleys »

Logansfury wrote: Sun Feb 18, 2024 10:37 am Where do you keep music art on your system?
the problem with covers starts with the players you choose. everyone looks somewhere else. Rhythmbox expects covers in ~/.cache/rhythmbox/covers. QMPlay2 in ~/.config/QMPlay2/Covers and so on.
So i started integrating the covers into my mp3s a long time ago with the help of EasyTag. I don't have any songs without an integrated cover.
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

IIRC, the music files you see from KISS and Pink Floyd in my Music directory had the album art assigned using VLC. As it's already assigned and I am playing the assigned art file, why don't I have an album art line in the terminal return when I executed the metadata command? Can anything be done to repair this?
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

View Track Details of playing song in Qmmp shows album-art assigned to track, but not showing in conky:

Image
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: Now Playing Conky

Post by Bleys »

So... I've now picked up an album with songs without integrated covers. I have adapted the mpris.sh script so that cover paths with spaces are also processed:
Screen Capture_select-area_20240218172123.jpg
and it would be really helpful if you would post terminal issues. From conky AND qdbus....
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

Code: Select all

ogansfury@OptiPlex-5040:~$ qdbus org.mpris.MediaPlayer2.$Player /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata
Service 'org.mpris.MediaPlayer2.' is not a valid name.
logansfury@OptiPlex-5040:~$ 

Code: Select all

conky: desktop window (2400010) is subwindow of root window (6cb)
conky: window type - normal
conky: drawing to created window (0x8200001)
conky: drawing to double buffer
I changed the name of the directory album art to album as prompted by the terminal message, now every
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

Launching from terminal caused an error "cannot find dir /home/logansfury/Music/album" so I made a dir named album and put the two covers in there for the songs local on my Linux box. I have nothing in the terminal indicating errors, but now no display whatsoever in the widget except the outline.

Image
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Bleys
Level 4
Level 4
Posts: 431
Joined: Wed Apr 20, 2022 4:17 am
Location: Essen, Germany

Re: Now Playing Conky

Post by Bleys »

Do you know what else would be helpful?
READ

In the first post I described how to execute the qdbus command individually in the terminal for a specific player.

$Player is a variable!

In the first non-comment line of the mpris.sh script, I assign the value contained in $1 to this variable. And $1 is the player you selected in the LUA script. If you have set player="qmmp" in the LUA script, the variable $Player in the mpris.sh script is "qmmp"

but the terminal in which you enter the copied qdbus command does not know this.
Therefore you have to replace $Player in this line with the player you are using...
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

Bleys wrote: Sun Feb 18, 2024 1:02 pm Do you know what else would be helpful?
READ

In the first post I described how to execute the qdbus command individually in the terminal for a specific player.

$Player is a variable!

In the first non-comment line of the mpris.sh script, I assign the value contained in $1 to this variable. And $1 is the player you selected in the LUA script. If you have set player="qmmp" in the LUA script, the variable $Player in the mpris.sh script is "qmmp"

but the terminal in which you enter the copied qdbus command does not know this.
Therefore you have to replace $Player in this line with the player you are using...
I'm sorry I've been up sick all night and I'm making silly mistakes.

Here is terminal result with correct command entered:

Code: Select all

logansfury@OptiPlex-5040:~$ qdbus org.mpris.MediaPlayer2.qmmp /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata
mpris:artUrl: file:///home/logansfury/Music/album/KISS - Love Gun.jpg
mpris:length: 280704000
mpris:trackid: 
xesam:album: The Wall
xesam:albumArtist: Pink Floyd
xesam:artist: Pink Floyd
xesam:contentCreated: 1979
xesam:genre: Progressive Rock
xesam:title: Hey You
xesam:trackNumber: 14
xesam:url: file:///home/logansfury/Music/Pink Floyd 14 - Hey You 320.mp3
I have 4 pictures in the album directory:

KISS - Love Gun.jpg
Love Gun.jpg
Pink Floyd - The Wall.jpg
The Wall.jpg

The last time my full album art dir was renamed to album and the first .jpg was for the 13th warrior soundtrack that was selected, this time, it;s Love Gun album art for Pink Floyd song. It seems whatever the first image in the album directory is gets selected, it doesn't seem to be reading the file names.
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
User avatar
Logansfury
Level 6
Level 6
Posts: 1237
Joined: Fri Oct 27, 2023 4:08 pm
Location: Las Vegas NV, USA

Re: Now Playing Conky

Post by Logansfury »

No matter what I play, the script selects the first avail .jpg in the directory, but no image is actually shown, my album art section of the widget is blank:

Code: Select all

logansfury@OptiPlex-5040:~$ qdbus org.mpris.MediaPlayer2.qmmp /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata
mpris:artUrl: file:///home/logansfury/Music/album/KISS - Love Gun.jpg
mpris:length: 194586000
mpris:trackid: 
xesam:album: Love Gun
xesam:artist: Kiss
xesam:contentCreated: 1977
xesam:genre: Glam Rock
xesam:title: Christine Sixteen
xesam:trackNumber: 2
xesam:url: file:///home/logansfury/Music/KISS 02. Christine Sixteen.mp3
logansfury@OptiPlex-5040:~$ qdbus org.mpris.MediaPlayer2.qmmp /org/mpris/MediaPlayer2 org.freedesktop.DBus.Properties.Get org.mpris.MediaPlayer2.Player Metadata
mpris:artUrl: file:///home/logansfury/Music/album/KISS - Love Gun.jpg
mpris:length: 280704000
mpris:trackid: 
xesam:album: The Wall
xesam:albumArtist: Pink Floyd
xesam:artist: Pink Floyd
xesam:contentCreated: 1979
xesam:genre: Progressive Rock
xesam:title: Hey You
xesam:trackNumber: 14
xesam:url: file:///home/logansfury/Music/Pink Floyd 14 - Hey You 320.mp3
logansfury@OptiPlex-5040:~$ 
Image <-- Cick for sudo inxi --usb -Fxxxnmprz output, updated hourly!
Post Reply

Return to “Compiz, Conky, Docks & Widgets”