Author Topic: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps  (Read 8583 times)

VastOne

  •      v-ger
  • Posts: 4191
    • View Profile
    • VSIDO Community
How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps
« on: January 14, 2013, 05:49:16 AM »
This How To will cover two methods of using Conky, one of 18 current Linux Music apps and Cover Art from local sources.

First and foremost, this work is based off of the development of 2 sources.  Kaivalagi Python Scripts and a  wlourf LUA sphere script that started on the Ubuntu Threads. All I did was take the genesis of these and expand upon them to create several more current applications.

EDIT - ImageMagick must be installed for the convert process in the LUA scripts.  ImageMagick is a very powerful lightweight and low resources set of imaging tools. 

To install ImageMagick:

Code: [Select]
sudo apt-get install imagemagick
I will go over every step of the process in getting both methods working and how to use this How To.  At a minimum you should have a better understanding of several tools that you can use in Conky when done.

As I said, there are 18 music apps to work with.  Here is the list:

MPD - and any frontend client (ario, sonata, gmpc etc etc)
Gmusicbrowser
Clementine
Amarok2
Xnoise
Gogglesmm
Audacious
Decibel Audio Player
Exaile
Qmmp
Pogo
Deadbeef
Quod Libet
VLC
Rhythmbox
MoC (MoCP)
Banshee
Guayadeque

Here are screenshots of the end results :

First is conkyMpd.py script running mpd:



And the wlourf LUA Sphere running mpd:



Now this is how to get there

NOTE - mpDris is only needed if you are using mpd or plan on using mpd as your music source.

You will need to install mpDris, a very cool python script that puts an mpd  dbus/mpris instance on your system.  mpDris can be installed in debian/ubuntu with.

Code: [Select]
sudo apt-get install mpdris
or it can be compiled with sources from here (if you are willing). Beyond the scope of this HowTo, contact me if you need help.

For MPD, mpDris will need to be started with the location of your music files. MPD must also be running for this to initiate.

I run it from a script,  but you can run it from terminal or alt+f2 like this:

Code: [Select]
python /usr/bin/mpDris --path=/media/storage/Music/mp3new &
or depending on how it was installed:

Code: [Select]
python /usr/local/bin/mpDris --path=/media/storage/Music/mp3new &
NOTE - You MUST change the --path=/to/your/music/location

NOTE - If you run mpdRis from a script, it must be used like this from within autostart.sh or your bash script.

Code: [Select]
(python /usr/bin/mpDris --path=/media/storage/Music/mp3new) &
or depending on how it was installed:

Code: [Select]
(python /usr/local/bin/mpDris --path=/media/storage/Music/mp3new) &
        Next, 
download musictools.tar.gz. These are the files for everything needed to use in this How To.  Extract it to the same directory structure it is compressed in where / is your /home/user directory.  Each of the python and bash scripts should be made executable. They were all executables when I archived them, they should extract as executable. 

Check at least one python or bash script to make sure the executable flag is set after you extract them, it should be automatic.  If one is set they will all be set.
 
Once that is done we can now begin.  I am going to explain the Python method first.  I will be using MPD as the player for this discussion.

NOTE - In most players you MUST turn dbus/mpris on.  You can contact me if you are having trouble getting mpris/dbus enabled in any one of these apps.

VLC - To turn VLC Dbus on go to:

Tools -> Preferences -> Show all -> Interface -> Control Interface and Enable DBus

GmusicBrowser - To turn GMB mpris on go to:

Main -> Settings -> Plugins -> tick the MPRIS v1 check box and restart GMB

The Python Method

There are 3 components to running the Python Method
  • .conkympdrc   (this rc is included for 18 of the 18 players)
  • conkyMpd.py   The python that does the work
  • conkyMpd.template  The template used for displaying the python work

.conkympdrc

Set this file for your own conky display needs.  What you see in this file is what is necessary for the correct display on my system.

[/list][/list][/list]
Code: [Select]
# .conkyrc - Edited from various examples across the 'net
 # Used by VastOne on #! Debian Wheezy

 # Font Settings ##############################################################
 # Use Xft (anti-aliased font and stuff)
use_xft yes
xftfont Liberation Sans:size=15
 # Alpha of Xft font. Must be a value at or between 1 and 0 ###
xftalpha 0.9
 # Force UTF8? requires XFT ###
override_utf8_locale yes

draw_shades no
draw_outline no
uppercase no
 ######################## End Font Settings ###################################

 # Begin Window Settings ######################################################
alignment top_right
own_window yes
own_window_type desktop
own_window_transparent yes
own_window_class Conky
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

 # ARGB can be used for real transparency
 # NOTE that a composite manager is required for real transparency.
 # This option will not work as desired (in most cases) in conjunction with
 # 'own_window_type override'
own_window_argb_visual yes
 # When ARGB visuals are enabled, this use this to modify the alpha value
 # Valid range is 0-255, where 0 is 0% opacity, and 255 is 100% opacity.
#own_window_argb_value 0

minimum_size 335 5    ## width, height
maximum_width 335    ## width - usually a good idea to equal minimum width.

gap_x 5    ## left &right
gap_y 30    ## up & down
 ####################### End Window Settings ##################################

 # Border Settings ############################################################
border_outer_margin 40
border_inner_margin 0

draw_borders no
border_width 1
stippled_borders 10
 ####################### End Border Settings ##################################

 # Color Settings #############################################################
default_shade_color grey
default_outline_color black

 # Main Color Settings ########################################################
default_color white
color1 B9CDD4
color2 white
color3 white
color4 BAF58B


 # Use the Xdbe extension? (eliminates flicker)
 # It is highly recommended to use own window with this
 # one so double buffer won't be so big
double_buffer yes

 # Adds spaces around certain objects to stop them
 # from moving other things around.
 # only works with mono fonts
use_spacer right
 # Arguments are left, right, and none (default)

 # Size of the standard text buffer (default is 256 bytes).
 # Will allow for more text display per variable.
text_buffer_size 2048

 # Sets bars size even for bars that do not hace that function
 # IE: execbar and execibar
default_bar_size 235 9

 # 0 makes Conky run forever
total_run_times 0
update_interval 1
cpu_avg_samples 1
net_avg_samples 1
no_buffers yes

 # Defaults to 4MiB
 # Set to 0 to disable the image cache
 # Increase this value if you use $image lots
imlib_cache_size 0

TEXT

${if_running mpd}
${execp ~/conkyMpd.py --template=~/conkyMpd.template}
$endif

# delete this and add 19 blank lines














As you can see, all this does is invoke the conkyMpd.py to use the conkyMpd.template

conkyMpd.template

Code: [Select]
${color #7CB2E5}[--datatype=TI --maxlength=32]
${color #7CB2E5}[--datatype=AR --maxlength=32]
${color #7CB2E5}[--datatype=AL --maxlength=30]
${color #7CB2E5}[--datatype=PT]  -  ${color #7CB2E5}[--datatype=LE]
${#FFFFFF}${execibar 1 ~/conkyMpd.py --datatype=PP}
${color #7CB2E5}MPD      ${voffset 2}${#FFFFFF}[--datatype=ST] ${color #7CB2E5}    Volume ${#FFFFFF}[--datatype=VO] ${color 7CB2E5}
${image [--datatype=CA] -p 0,175 -s 335x335}${image ~/images/mpd.png -p 41,143 -s 30x30}
        NOTES:
        • The conkyMpd.template is the place to change colors, position and sizes of everything that is displayed.
        • Use the .conkympdrc to change the over all position of the displayed output; top, bottom, left, right or middle.
        • This MPD is good for any front end client you want to use.

        I start this conky this way:

Code: [Select]
conky -c .conkympdrc &
That is pretty much all there is for the Python method.  All you have to do is choose the .conkyxxxrc, python and template of the player you use and you are set.  All of these files are included in the download musictools.tar.gz

The LUA Sphere Method

(which uses the same python files and in this example using the conkyMpd.py)

This method is a bit more detailed.

It uses the following files -  Note - this example is for MPD.

.conkysphererc
conkyMpd.py
launcher.sh  (required to use)
getcover_sphere.sh
player.lua


.conkysphererc
Code: [Select]
# -- Conky settings -- #
background no
update_interval 1
 
cpu_avg_samples 2
net_avg_samples 2

override_utf8_locale yes

double_buffer yes
no_buffers yes

text_buffer_size 2048
imlib_cache_size 0

# -- Window specifications -- #

draw_borders no
own_window_argb_visual yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window yes
own_window_transparent yes
own_window_class conky-semi

border_inner_margin 0
border_outer_margin 0

minimum_size 400 400
 
alignment tr
gap_x 5
gap_y 60

# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no

# -- Text settings -- #
use_xft yes
xftfont Santana:size=8
xftalpha 0.8
 
uppercase no 

default_color FFFFFF

# -- Lua load -- #
lua_load ~/conky/conky-music/player.lua
lua_draw_hook_pre main

#at least one line (empty or not) after TEXT
#

TEXT

#this line for displaying cover
#set-up in getcover_sphere.sh
${execi 3 ~/conky/conky-music/cover/getcover_sphere.sh}${image ~/conky/conky-music/cover/cover_sphere.png -p 150,150}

#this line for xnoise only - If you use xnoise, uncomment the next line
#${execi 1 ~/bin/getcdxnoise.sh}

#this line for xnoise only - If you use xnoise, uncomment the next line
#${execi 1 ~/bin/getcdexaile.sh}

#this line for gogglesmm only - If you use gogglesmm, uncomment the next line
#${execi 1 ~/bin/getcdgmm.sh}

#this line for audacious only - If you use audacious, uncomment the next line
#${execi 1 ~/bin/getcdaud.sh}

#this line for mocp only - If you use mocp, uncomment the next line
#${execi 1 ~/bin/getcdmocp.sh}


NOTE  - There must be a blank line at the end of .conkysphererc.

As you see in this rc, there are several choices to make based on the music player you use. If you use exaile, xnoise, audacious, gogglesmm, deadbeef or mocp just uncomment the appropriate line so the covers can be pulled.  All of these scripts would have been extracted to your ~/bin directory.

Edit  - Thanks to some help from xaos52, the method of calling the covers has changed if you are running one of the following:

 Deadbeef
 Audacious
 Exaile
 Goggles Music Manager
 Moc / MocP
 Xnoise


NOTE  - lsof will need to be installed for these scripts to run properly:
Code: [Select]
sudo apt-get install lsof
lsof is an incredibly powerful tool for system information.  Here it locates the directory of the song  playing on MPD and uses 'find' to copy it to /tmp/covers

For the lsof method of finding the directory, it is assumed that your file structure has /Music somewhere in the path.

In other words; make sure /Music is in your path.

getcdxnoise.sh
Code: [Select]
#!/bin/bash
CURRENT_DIRECTORY_LOCATION="${HOME}/tmp/current-music-directory"
CURRENT_DIRECTORY="$(cat ${CURRENT_DIRECTORY_LOCATION})"
DIRECTORY=$(lsof -F n -c xnoise | grep /Mus | tail -c +2 | sed 's%/[^/]*$%%')
[ "$DIRECTORY" != "$CURRENT_DIRECTORY" ] && {
    find "$DIRECTORY" -iname "*.jpg" -exec cp {} /tmp/covers \; -quit
    echo "$DIRECTORY" >${CURRENT_DIRECTORY_LOCATION}
}

In this line, a combination of lsof and grep is used to find where the file is playing in all of the get cover art bash scripts like in db-cover.sh
Code: [Select]
lsof -F n -c deadbeef | grep /Mus | tail -c +2 | sed 's%/[^/]*$%%'Notice that grep is looking or a /Mus as the key variable.

If your music is in a different directory, db-cover.sh would need to be edited to find the unique flag to search for.

To find out where your directory is run this while playing your music app
Code: [Select]
lsof -F n -c deadbeef
obviously changing to what ever music app you are using.

Please feel free to contact me for help on how to do this.

With this update to the bash scripts they now only copy the cover file one time. Thanks xaos52!!!

NOTE - You must run this one time from terminal for the bash scripts to work properly:

Code: [Select]
touch $HOME/tmp/current-music-directory
Now on to the working components of this Lua layout.  I have already completely setup up both of these files (and vetted all 18 players) so you will only have to select your player.

getcover_sphere.sh

Code: [Select]
#!/bin/bash
# by larryni
# get Amarok cover art of current track and transform into an album stack
# copypasta from http://www.imagemagick.org/Usage/mapping/#spherical
# thanks to eightmillion for rewriting the original script
# http://ubuntuforums.org/showpost.php?p=8117609&postcount=9846
# modded by wlourf for use with others players
# modded by VastOne for use with others players

##choose your player here
#player="amarok"
#player="guayadeque"
#player="xnoise"
#player="exaile"
#player="quodlibet"
#player="gogglesmm"
#player="gmusicbrowser"
#player="audacious"
#player="clementine"
#player="decibel"
#player="qmmp"
#player="pogo"
#player="deadbeef"
#player="banshee"
#player="rhythmbox"
#player="vlc"
player="mpd"
#player="mocp"

# Temp directory must be full path.
tempdir="$HOME/conky/conky-music/cover/"
tempfile="${tempdir}nowplaying"

[ -d "$tempdir" ] || mkdir -p "$tempdir"  #test if $tempdir exists, if not create it.
[ -e "$tempfile" ] || touch "$tempfile"

case $player in
    "amarok")
        cover="$(dcop amarok player coverImage)";;
    "guayadeque")
        cover="$(~/conkyGuayadeque.py --datatype=CA)";;
    "xnoise")
        cover=/tmp/covers;;
    "exaile")
        cover=/tmp/covers;;
    "quodlibet")
        cover=/tmp/current.cover;;
    "pogo")
        cover=~/.config/pogo/current-cover.png;;
    "decibel")
        cover=~/.config/decibel-audio-player/current-cover.png;;
    "deadbeef")
        cover=/tmp/covers;;
    "mpd")
        cover=/tmp/covers;;
    "mocp")
        cover=/tmp/covers;;
    "audacious")
        cover=/tmp/covers;;
    "gogglesmm")
        cover=/tmp/covers;;
    "gmusicbrowser")
        cover="$(~/conkyGmusicbrowser.py --datatype=CA)";;
    "banshee")
        cover="$(~/conkyBanshee.py --datatype=CA)";;       
    "qmmp")
        cover="$(~/conkyQmmp.py --datatype=CA)";;       
    "clementine")
        cover="$(~/conkyClementine.py --datatype=CA)";;
    "vlc") 
        cover="$(~/conkyVlc.py --datatype=CA)";;
    "rhythmbox")
            cover="$(~/conkyRhythmbox.py --datatype=CA)"
        #remove \ characters from conkyRhythmbox output
            cover=${cover//\\/};;
    *) echo "wrong player selected";;
esac

   
if [ "$cover" == "" ] && [ -f "${tempdir}cover_sphere.png" ] ; then
    rm "${tempdir}cover_sphere.png"
fi

[ -z "$cover" ] && exit      #test if $cover was set, if not exit.

hash=$(ls -l "$cover" )

read oldhash < "$tempfile"

if [ "$oldhash" == "$hash" ];then
        :
else
#add " and " around ${cover} for filename with spaces
    convert "${cover}" -resize 100x100! "${tempdir}sphere_overlay.png" -compose HardLight -composite "${tempdir}sphere_mask.png" -alpha off -compose CopyOpacity -composite "${tempdir}cover_sphere.png"
   echo $hash > "$tempfile"
fi
exit



The only area of this script to worry about is this:

Code: [Select]
##choose your player here
#player="amarok"
#player="guayadeque"
#player="xnoise"
#player="exaile"
#player="quodlibet"
#player="gogglesmm"
#player="gmusicbrowser"
#player="audacious"
#player="clementine"
#player="decibel"
#player="qmmp"
#player="pogo"
#player="deadbeef"
#player="banshee"
#player="rhythmbox"
#player="vlc"
player="mpd"
#player="mocp"


Simply edit this file ~/conky/conky-music/cover/getcover_sphere.sh and uncomment the player that you use. As in my example of using MPD, it is uncommented

player.lua

Code: [Select]



--set the main parameters  here
--other parameters can be set in widgets files

--font name to use
font_name="Ubuntu-Title"

--set the colors here
--for foreground
fg_col1=0x97EF93
fg_col2=0xF61330

--for background
bg_col1=0xC9C6C6

--choose player (amarok/rhythmbox)
--for the cover, see in file get_cover.sh
--player = "amarok"
--player = "guayadeque"
--player = "xnoise"
--player = "exaile"
--player = "quodlibet"
--player = "gogglesmm"
--player = "clementine"
--player = "deadbeef"
--player = "qmmp"
--player = "pogo"
--player = "decibel"
--player = "audacious"
--player = "gmusicbrowser"
--player = "banshee"
--player = "rhythmbox"
--player = "vlc"
player = "mpd"
--player = "mocp"

--END OF PARAMETERS


--call the widgets
--or use full path if you don't call the conkyrc from it's own directory
dofile ("./rings.lua")
dofile ("./text.lua")



function conky_main()
   
    --call the functions into the widgets
    choose_player(player)
    conky_main_rings()
    conky_draw_text()
end



function choose_player(player)

    --commmands line
    --pp is for percentage played
    --ar is for artist
    --al is for album
    --ti is for title
    --for the cover, see in file get_cover.sh
    if player == "amarok" then
        amarok_ct = io.popen("dcop amarok player trackCurrentTime"):read()
        amarok_tt = io.popen("dcop amarok player trackTotalTime"):read()
        amarok_pp = 100*amarok_ct/amarok_tt
        cmd_al = "${exec dcop amarok player album}"
        cmd_ar = "${exec dcop amarok player artist}"
        cmd_ti = "${exec dcop amarok player title}"
        cmd_pp = "${if_running amarokapp}" .. amarok_pp .. "${else}0${endif}"
    elseif player == "guayadeque" then
        cmd_al = "${exec ~/conkyGuayadeque.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyGuayadeque.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyGuayadeque.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyGuayadeque.py --datatype=PP}"
    elseif player == "clementine" then
        cmd_al = "${exec ~/conkyClementine.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyClementine.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyClementine.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyClementine.py --datatype=PP}"
    elseif player == "deadbeef" then
        cmd_al = "${exec ~/conkyDeadbeef.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyDeadbeef.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyDeadbeef.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyDeadbeef.py --datatype=PP}"
    elseif player == "decibel" then
        cmd_al = "${exec ~/conkyDecibel.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyDecibel.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyDecibel.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyDecibel.py --datatype=PP}"
    elseif player == "xnoise" then
        cmd_al = "${exec ~/conkyXnoise.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyXnoise.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyXnoise.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyXnoise.py --datatype=PP}"
    elseif player == "exaile" then
        cmd_al = "${exec ~/conkyExaile.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyExaile.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyExaile.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyExaile.py --datatype=PP}"       
    elseif player == "quodlibet" then
        cmd_al = "${exec ~/conkyQuodlibet.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyQuodlibet.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyQuodlibet.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyQuodlibet.py --datatype=PP}"       
    elseif player == "gogglesmm" then
        cmd_al = "${exec ~/conkyGogglesmm.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyGogglesmm.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyGogglesmm.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyGogglesmm.py --datatype=PP}"
    elseif player == "gmusicbrowser" then
        cmd_al = "${exec ~/conkyGmusicbrowser.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyGmusicbrowser.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyGmusicbrowser.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyGmusicbrowser.py --datatype=PP}"       
    elseif player == "banshee" then
        cmd_al = "${exec ~/conkyBanshee.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyBanshee.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyBanshee.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyBanshee.py --datatype=PP}"       
    elseif player == "audacious" then
        cmd_al = "${exec ~/conkyAudacious.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyAudacious.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyAudacious.py --datatype=TI}"
        cmd_pp = "${exec audtool --current-song-output-length-seconds \/ $audtool --current-song-length-seconds}"       
    elseif player == "pogo" then
        cmd_al = "${exec ~/conkyPogo.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyPogo.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyPogo.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyPogo.py --datatype=PP}"
    elseif player == "qmmp" then
        cmd_al = "${exec ~/conkyQmmp.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyQmmp.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyQmmp.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyQmmp.py --datatype=PP}"
    elseif player == "rhythmbox" then
        cmd_al = "${exec ~/conkyRhythmbox --datatype=AL}"
        cmd_ar = "${exec ~/conkyRhythmbox --datatype=AR}"
        cmd_ti = "${exec ~/conkyRhythmbox --datatype=TI}"
        cmd_pp = "${exec ~/conkyRhythmbox --datatype=PP}"
    elseif player == "vlc" then
        cmd_al = "${exec ~/conkyVlc.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyVlc.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyVlc.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyVlc.py --datatype=PP}"
    elseif player == "mpd" then
        cmd_al = "${exec ~/conkyMpd.py --datatype=AL}"
        cmd_ar = "${exec ~/conkyMpd.py --datatype=AR}"
        cmd_ti = "${exec ~/conkyMpd.py --datatype=TI}"
        cmd_pp = "${exec ~/conkyMpd.py --datatype=PP}"
    elseif player == "mocp" then
        cmd_al = "${exec mocp -Q %album}"
        cmd_ar = "${exec mocp -Q %artist}"
        cmd_ti = "${exec mocp -Q %song}"
        cmd_pp = "${exec mocp -Q '%cs/%ts*100' | bc -l}"
    else
        print (player .. " not defined")
        cmd_ar = player
        cmd_al = " not defined"
        cmd_ti = player .. " : player unknow"
        cmd_pp =""
    end
end


The only section you need to worry about is:

Code: [Select]
--choose player (amarok/rhythmbox)
--for the cover, see in file get_cover.sh
--player = "amarok"
--player = "guayadeque"
--player = "xnoise"
--player = "exaile"
--player = "quodlibet"
--player = "gogglesmm"
--player = "clementine"
--player = "deadbeef"
--player = "qmmp"
--player = "pogo"
--player = "decibel"
--player = "audacious"
--player = "gmusicbrowser"
--player = "banshee"
--player = "rhythmbox"
--player = "vlc"
player = "mpd"
--player = "mocp"

Simply edit  ~/conky/conky-music/cover/player.lua and uncomment the player you are using. As in my example of using MPD, it is uncommented.

NOTE that in this script -- is the comment code and NOT #

launcher.sh
- MUST be used to run the LUA Sphere Method

Code: [Select]
#!/bin/bash

rm ~/conky/conky-music/cover/nowplaying
rm ~/conky/conky-music/cover/cover_sphere.png
#need to cd to avoid problems with rhythmbox.lua
cd ~/conky/conky-music/
conky -c .conkysphererc

I run it using alt F2 and this:

Code: [Select]
~/conky/conky-music/launcher.sh &
If everything is setup correctly, you should have the desired outcome.

Important Note - 07 October 2011  - If you receive this error from conky:

Code: [Select]
/usr/bin/env: python2: No such file or directory

Run this in terminal to correct it

Code: [Select]
sudo ln -s /usr/bin/python2.6 /usr/bin/python2
Contact me if this error persists.

OK, that  is it.  I have worked on this testing and retesting for 3 days.  I have enjoyed it and it has been frustrating.  There were mistakes that have been corrected. Hopefully, anyone seeing ways to improve on these methods will speak up.

I am open to any challenge to add any music apps to this process.  Please let me know of any that you want to be included in this. Please also feel free ask me anything on this process either here or in a PM.

A million thanks go to Kaivalagi and Wlourf, both I consider pure geniuses.  Also thanks to Sector11 because he challenged me to write this up and was instrumental in helping me clean it up.  Also, Ivanovnegro who challenged me to create some of these in the beginning and for his plum liqueur. :cool:

I hope it is useful to some of you.

VastOne

NOTE  - I use gmusicbrowser that has some awesome plugins for getting the cover art from several sources by just right clicking on the album, artist or track.

NOTE  - I have also found a stand alone app that does the same thing.  It is UberView 1.14 download .  I have tested this app and find it a good addition. Nice job wittfella.

Edit - 04 October 2011  -  Added MOCP - Grab the latest archive from the same link to capture these changes.

Edit - 04 October 2011  -  Added Banshee  - Grab the latest archive from the same link to capture these changes.

Edit - 07 October 2011  - Added the latest rings.lua and text.lua from wlourf..  These are more efficient versions. Grab the latest archive from the same link to capture these changes.

Edit - 08 October 2011  -  Added Exaile to the mix - Grab the latest archive from the same link to capture these changes.

Edit - 09 October 2011  -  Added Quod Libet to the mix - Grab the latest archive from the same link to capture these changes.

Edit - 13 October 2011  -  Changed the method of starting mpDris in the instructions.

Edit - 16 October 2011  -  Changed all bash scripts with new functions to copy the cover file one time, thanks xaos52!!  -  Grab the latest archive from the same link to capture these changes.

Edit - 16 October 2011  -  Changed the mpd method of getting the cover thanks to a python change.  Thanks wlourf!!   -  Grab the latest archive from the same link to capture these changes.

Edit - 17 October 2011  -  Added ImageMagick requirements.

Edit - 19 October 2011  -  Added Amarok2 - This replaces the original Amarok  - Grab the latest archive from the same link to capture these changes download musictools.tar.gz

Files added:

conkyAmarok.py
conkyAmarok.template
.conkyamarokrc
amarok.png

Updated files:

player.lua
getcover_sphere.sh

Edit - 21 October 2011  -  Did a major overhaul of all conky rc files and all templates to standardize each.    Grab the latest archive to capture these changes download musictools.tar.gz

Edit - 5 November 2011  -  Added the lsof requirements

Edit - 21 December 2011  -  Changed how all the scripts using lsof get the directory structure. All changes are here in the download musictools.tar.gz

Edit - 15 August 2012  -  Added the requirements for correctly starting mpdRis from autostart.sh or a bash script.
VSIDO      VSIDO FB     VSIDO Google+   

I dev VSIDO

statmonkey

  • Posts: 330
    • View Profile
Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps
« Reply #1 on: October 22, 2014, 05:48:36 PM »
Kicking a dead dog here but .... seems not worthy of a new thread.

As part of the reinstall for Jedi© I will be setting up my mpd and conky again.  I have a pretty nice little conky and rating script set up that uses mpdris to either display the album cover on the desktop or my preference to pop up a bunch of album info and the cover in an OSD on command.  I just noticed this:

Quote
mpDris

Note: This project is no longer maintained, please use mpDris2 instead.

mpDris is a bit of a blackbox to me.  I never really looked at how it does it.  Is it interchangeable with mpdris2? 

I was also curious since it's such a basic part of the visual aspect of VSIDO why it was never part of the install?  I think it and eyed3 are things that we all use?  I mean it would be nothing to make debs of them if there is interest and in fact could probably package them as a unit for inclusion.  FWIW.  A little late on that I guess.  This is kind of a dead dog kicking a dead dog post lol.

VastOne

  •      v-ger
  • Posts: 4191
    • View Profile
    • VSIDO Community
Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps
« Reply #2 on: October 22, 2014, 06:51:01 PM »
Wow... kicking one of my legendary How To's... Nice!   :'(

Both eyed3 and mpDris2 were a part of VSIDO at one time but were unintentionally left out in a transition between 1.2 and 2.0 VSIDO.  I will add both back on the next builds... thanks for pointing out the oversite

mpDris2 was for the new version of mpris that changed the standards... On all of my setups I just had both enabled to cover both mpris and mpris2

I think mpris just went the way of every deprecated app, there was never a need for any more updates since the protocol it was supporting died too

I see you have kicked around fluxbox now and seem to want to really check what is under the hood on VSIDO jedi... I love the hell out of mpd as well, but for a complete music app and player, you really should check out GMB... once I found it and all of it's built in powers I forgot all about other music apps (all the other 17 profiled here) and all about using conky for visual output.. GMB also has one of the coolest hands on developers ever ... Quentin Sculo is Top Shelf in my book... who I want to be when I grow up

GMB does it all and can look like any of theses apps and when you want to fill a creative urge, you can design your own look... I would really like to see a statmonkey layout!  I think jedi would also... he may be sick of the ones I have created     :-*
VSIDO      VSIDO FB     VSIDO Google+   

I dev VSIDO

jedi

  • DEFCON 1
  • Posts: 1637
  • Not all those who wander are lost.
    • View Profile
    • NixNut.com
Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps
« Reply #3 on: October 22, 2014, 08:53:00 PM »
No, not sick of them at all!!!  Seems there are enough layouts to have a new one every month.  Still, it would be cool to see some 'new' layouts I suppose.  I have to agree with your statements re; GMB.  I just finished trying out DeaDBeeF, and found it hugely disappointing.  I have yet to try any music player on Linux that comes close to doing what GMB does.  It is also cool to not have to rely on Conky to show some cool desktop info about your music!
Forum Netiquette

"No matter how smart you are you can never convince someone stupid that they are stupid."  Anonymous

statmonkey

  • Posts: 330
    • View Profile
Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps
« Reply #4 on: October 23, 2014, 02:43:04 AM »
Is QBall still around?  A really excellent developer and all round great guy.  Not to be bro-ish or anything but GMB was my first introduction to VastOne.  Those layouts are epic and I noted the designer (so I guess I started stalking you then v-ger!). 

That how to is legendary and still very useful.  I switched to MPD to serve music to my appliances (chromecast, phones, tablets etc.) but now using plex it may not be needed.  I remember some issue with playlists but it's vague I will have a look.

Yes, I really am trying to uncover the true Jedi© since the man is such an enigma  ;)

Not sure about a statmonkey layout.  I really don't know if the VastOne layouts could be any better.  They are so perfect.  I would miss all my fun little mpd scripts but I guess I am also starting to get bored with them after all these years.