SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-10-04 04:48:44

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

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:

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:

screenshot-10212011-085305pm.php

And the wlourf LUA Sphere running mpd:

screenshot-10022011-042232pm.png

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.

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:

python /usr/bin/mpDris --path=/media/storage/Music/mp3new &

or depending on how it was installed:

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.

(python /usr/bin/mpDris --path=/media/storage/Music/mp3new) &

or depending on how it was installed:

(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.

 # .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

${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:

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

# -- 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:

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

#!/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

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

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:

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

#!/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:

##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

--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:

--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

#!/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:

~/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:

/usr/bin/env: python2: No such file or directory

Run this in terminal to correct it

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 at the request of psvage - Grab the latest archive from the same link to capture these changes.

Edit - 04 October 2011  -  Added Banshee at the request of Unia - 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 as the requested by convergent.  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.  Thanks to Sector11 for writing and proofing the conky rc  standards  -  Grab the latest archive to capture these changes download musictools.tar.gz

Edit - 5 November 2011  -  Added the lsof requirements - Thanks to Sector11 for pointing this requirement out.

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.

Last edited by VastOne (2011-12-24 17:57:23)


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

Be excellent to each other!

#2 2011-10-04 12:49:11

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,426

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

Thank you for all your work for the community VastOne, I appreciate it. This is a great source.

Offline

#3 2011-10-04 14:27:01

Sector11
77345 ¡#
From: SR11 Cockpit
Registered: 2010-05-05
Posts: 11,986
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

OH MY!  That's ... jaw dropping.  I have a hard time trying to remember when I challenged you to do this, but I'm glad I did.

Excellent work VastOne - pure brilliance!


To #! or not to #!?  That is the question! | #! Forum Moderator
#! Conky = 16 Threads & the Conky Archives | Conky PitStop | OTHCG'er
StartPage -  protect your privacy   |   LinuxBBQ

Offline

#4 2011-10-04 14:42:16

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

@ ivanovnegro - Thanks Bro!

@ Sector11 - lol, you and that memory...  I appreciate the challenge even if you do not remember it... Thanks Bro!

Last edited by VastOne (2011-10-04 14:50:17)


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#5 2011-10-04 16:39:40

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,486

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

@VastOne:  Excellent work, dude!  Except you left out mocp. tongue  I'll post something for that sometime soon if I get a chance.


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#6 2011-10-04 16:47:30

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

pvsage wrote:

@VastOne:  Excellent work, dude!  Except you left out mocp. tongue  I'll post something for that sometime soon if I get a chance.


Thanks pvsage!

I will take a look at mocp.. I thought it was under the mpd umbrella but I was wrong in that assumption..

What is the actual debian package name?

Edit - Found moc

Last edited by VastOne (2011-10-04 16:50:04)


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#7 2011-10-04 17:03:58

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

pvsage wrote:

@VastOne:  Excellent work, dude!  Except you left out mocp. tongue  I'll post something for that sometime soon if I get a chance.

OK, From this

${font}${color}${if_running mocp}${alignc}${exec mocp -Q %song}  ${color2}${font Humanoid:size=9}o${font}${color} ${exec mocp -Q %artist} ${color2}${font Humanoid:size=9}o${font}${color} ${exec mocp -Q %album}${font}${else}${endif}

I see that are tools to display what is needed...

Can you please run this from terminal and tell me if it shows the location of the song while playing?

lsof -F n -c mocp 

OR

lsof -F n -c moc 

Whichever one is actually the playing player...  lol

Edit - I loaded moc, and tested it ... looks like I can do everything and add it to this How To.. 

Should have it updated in a couple of hours after thoroughly testing it.

Thanks again pvsage!

Last edited by VastOne (2011-10-04 17:17:06)


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#8 2011-10-04 18:31:55

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,486

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

In mocp, %file gives you the current song's filename and complete path...


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#9 2011-10-04 18:32:38

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

pvsage wrote:

In mocp, %file gives you the current song's filename and complete path...

That is even better...

Thanks..

Should have it done in a wee bit


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#10 2011-10-04 18:35:31

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

pvsage wrote:

In mocp, %file gives you the current song's filename and complete path...

Do you have a good source for mocp commands and examples?


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#11 2011-10-04 18:40:54

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 3,956

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

Is there anything for Banshee? tongue


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Github

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#12 2011-10-04 18:41:43

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

Unia wrote:

Is there anything for Banshee? tongue

Will incorporate banshee ... do not know how I missed it... tongue


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#13 2011-10-04 18:45:32

Unia
#! Octo-portal-pussy
From: The Netherlands
Registered: 2010-07-17
Posts: 3,956

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

Awesome!


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres
Github

I am a #! forum moderator. Feel free to send me a PM with any question you have!

Offline

#14 2011-10-04 18:47:37

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,426

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

VastOne wrote:

Do you have a good source for mocp commands and examples?

Press h to see all the possible commands if you mean that.

Offline

#15 2011-10-04 18:50:15

pvsage
Internal Affairs
From: North Carolina
Registered: 2009-10-18
Posts: 12,486

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

ivanovnegro wrote:
VastOne wrote:

Do you have a good source for mocp commands and examples?

Press h to see all the possible commands if you mean that.

Everything I know about MoCP (well, *almost* everything) I read in the man page.


I'm a moderator here.  How are we doing?  Feedback is encouraged.

Offline

#16 2011-10-04 19:03:03

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

@ ivanovnegro - Thanks!

@ pvsage - I have the Python Method of mocp done and am now working on the LUA version ..  Question, once this mocp one is done, will it cover any of the other moc clients as well?  If there are other moc clients.

Last edited by VastOne (2011-10-04 19:03:26)


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#17 2011-10-04 20:35:52

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

@pvsage - mocp done and added

Now on to Banshee

Last edited by VastOne (2011-10-04 20:36:36)


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#18 2011-10-04 20:54:40

ElderV.LaCoste
#! Die Hard
From: Equarico
Registered: 2010-07-15
Posts: 817

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

@VastOne - A massive aura of "coolness" surrounds you.


Things are not as they seem, nor are they otherwise.
- Lankavatara Sutra

Offline

#19 2011-10-04 20:56:22

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

ElderV.LaCoste wrote:

@VastOne - A massive aura of "coolness" surrounds you.


I am actually blushing and grinning ear to ear absorbing that aura...

Thank you ElderV.LaCoste!!


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#20 2011-10-04 21:42:18

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

Unia wrote:

Is there anything for Banshee? tongue

Banshee is completed and added


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#21 2011-10-04 22:09:15

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,426

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

^ Now you could write a review about every single music app for Linux. lol

Offline

#22 2011-10-04 22:13:11

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

ivanovnegro wrote:

^ Now you could write a review about every single music app for Linux. lol

I was thinking about doing just that...

Sector11 has recently made the same suggestion..

I am impressed with MPD MOC and Qmmp


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#23 2011-10-04 22:14:59

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,163
Website

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

ivanovnegro wrote:

^ Now you could write a review about every single music app for Linux. lol

I am sure you noticed the one I did include...  big_smile roll


VSIDO | Words That Build Or Destroy

We do not run from challenges, they become new innovations within VSIDO!

Offline

#24 2011-10-04 22:24:28

ivanovnegro
Ivan #000000
From: unstable madness
Registered: 2011-06-02
Posts: 5,426

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

^ Yup, I did. smile

Yes, I like also MOC but recently am stuck with Qmmp.

Maybe grandmaster Koraco could say me how this strange EQ works under MOC.

Offline

Be excellent to each other!

#25 2011-10-05 09:21:41

ElderV.LaCoste
#! Die Hard
From: Equarico
Registered: 2010-07-15
Posts: 817

Re: How To - Conky/Lua, Music and Cover Art - 2 Methods for 18 Apps

I am using the Lua method for Moc but I keep getting this error:

ls: cannot access /tmp/covers: No such file or directory
find: cannot search `': No such file or directory

I'm probably missing something obvious.  Do I need to create this file?


Things are not as they seem, nor are they otherwise.
- Lankavatara Sutra

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo