application icongmusicbrowser

Conky : how to show gmusicbrowser playing information

This How-To has been conceived after the experiments on Ubuntu (Feisty Fawn - 7.04), a debian-based distribution, and by Quentin Sculo on a Mandriva 2007.

What is conky ?

Conky is “a light-weight system monitor”, deeply configurable ; conky enables you to display lots of different information such as date, hour, disk occupation, networking status and traffic, system information (CPU, RAM, …)… on your screen.

Conky can also display music playing information from a few music players / jukebox like bmp, audacious, mpd.

Without the patch

loomsen has posted on the ubuntu forum a method to display the info in conky without patching it. see this post

The advantage of this method is that it works with the current conky versions (1.6 and future versions)

The disadvantage is that it needs to run a small program for each update, so it's a bit less cpu-friendly.

With the patch

Quentin Sculo has developed a patch for conky (version for conky-1.5.1 is available here) to display the gmusicbrowser playing information into conky.

Sadly, this patch requires a lot of modification for using it with conky version 1.6 and higher. So currently you'll have to use the method above without the patch.

Download and patch conky

After downloading the patch, create the conkypatch directory into your /home :

mkdir conkypatch

and move the patch you have just downloaded into it :

 mv downloaddirectory/conky-1.5.1_gmb.patch.gz conkypatch

to make the future operations easier.

For this, go to the conky project homepage on sourceforge.net (http://conky.sourceforge.net/) and download conky-1.5.1 sources in the .tar.bz2 format .

Move the tar archive into the conkypatch directory :

mv downloaddirectory/conky-1.5.1.tar.bz2 conkypatch

Move into the conkypatch directory :

cd conkypatch

Untar the conky-1.5.1.tar.bz2 archive :

tar xjfv conky-1.5.1.tar.bz2

Go into the conky-1.5.1 directory (created with the untar) :

cd conky-1.5.1

Apply the patch :

zcat ../conky_gmb.patch5_1.5.1_new.gz |patch -p1

Compile conky

First, check you have these packages installed on your system : gcc, make, automake1.9, autoconf, build-essential, checkinstall :

sudo aptitude install gcc automake1.9 autoconf build-essential checkinstall

Then in the /home/login/conkypatch/conky-1.5.1 directory (where you certainly are), do :

./autogen

.

The terminal is quite informative ; if there are some errors or warnings, the messages it sends enable you to install the right packages. Personally, on Ubuntu Feisty Fawn, I had a conflict with several “automake” versions and I had to uninstall these packages : automake, automake1.4, automake1.7 et automake1.8 and only have automake1.9 installed.

Once the autogen is done, it's time to achieve the compilation of conky. You can personalize this process (the ”./configure”) very much and make your “own conky”. This is why I advise you to go to the homepage project and more specifically to the "man" where you can find all the possibilities / options. I have been much inspired by the “configure” they propose in the “man” except I have not used these three options : –enable-bmp, –enable-audacious and –enable-xmms which give the support for the jukebox of the same name. (It seems that you can benefit the mpd support without adding the –enable-mpd option).

Thus, I have launched this command :

./configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --enable-xft --enable-own-window --enable-proc-uptime --enable-hddtemp --enable-mpd --enable-imlib2 --enable-portmon --enable-debug --enable-double-buffer --enable-xdamage --enable-x11  --enable-gmb

Whatever the options you choose, don't forget to add the option ”–enable-gmb” which gives the gmusicbrowser support in conky.

For this too, the terminal gives you much information which enables you to install the proper packages ; do keep in mind the -dev packages.

Once the “configure” is achieved, you have to do :

make

and then :

sudo checkinstall

I prefer using “checkinstall” instead of “make install” for the reasons explained there.

Configure conky

For those who have just discovered conky, you must know that configuring conky means editing the conky configuration file which is a hidden file in your /home ; to edit that file, in a terminal, do :

gedit /home/login/.conkyrc

replacing “login” by your own login and “gedit” by the command of the text editor of your choice.

The patch we have just applied enables these next variables : $gmb_artist, $gmb_album, $gmb_bar, $gmb_elapsed, $gmb_length, $gmb_percent, $gmb_title, $gmb_track.

Here is an example of conky configuration and the corresponding capture (under Ubuntu Gutsy) :

Nothing was found.
# set to yes if you want Conky to be forked in the background
background no

cpu_avg_samples 2
net_avg_samples 2

out_to_console no

override_utf8_locale yes

# X font when Xft is disabled, you can pick one with program xfontsel
#font 8x10
#font 7x13
#font 8x13
#font 7x12
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*
#font -artwiz-snap-normal-r-normal-*-*-100-*-*-p-*-iso8859-1
#font -*-luxi sans-medium-r-normal-*-13-*-*-*-*-*-iso8859-2
#font -*-helvetica-medium-r-normal-*-12-*-100-100-*-*-iso8859-2
#font -*-lucidatypewriter-medium-r-*-*-14-*-100-100-*-*-iso8895-2
#font -*-courier-medium-r-normal-*-14-*-100-100-*-*-iso8859-2
#font -*-lucida-medium-r-normal-*-13-*-*-*-*-*-iso8859-2

# Use Xft?
use_xft yes

# Xft font when Xft is enabled
#xftfont monospace-8
xftfont Sans -8.5



# Text alpha when using Xft
xftalpha 0.8


# mail spool
mail_spool $MAIL

# Update interval in seconds
update_interval 1

# Create own window instead of using desktop (required in nautilus)
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
#own_window_colour black
own_window yes
own_window_type override

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 5
maximum_width 220

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Stippled borders?
stippled_borders 0

# border margins
border_margin 0

# border width
border_width 0

# drawn 1 pixel border around graphs or not
draw_graph_borders yes

# Default colors and also border colors
default_color black
default_shade_color black
default_outline_color black

# Text alignment, other possible values are commented
#alignment top_left
#alignment top_right
#alignment bottom_left
alignment bottom_right

# Gap between borders of screen and text

gap_x 0
gap_y 5 #margines gorny

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer yes

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# boinc (seti) dir
# seti_dir /opt/seti

# Possible variables to be used:
#
#      Variable         Arguments                  Description                
#  acpiacadapter                     ACPI ac adapter state.                   
#  acpifan                           ACPI fan state                           
#  acpitemp                          ACPI temperature.                        
#  adt746xcpu                        CPU temperature from therm_adt746x       
#  adt746xfan                        Fan speed from therm_adt746x             
#  battery           (num)           Remaining capasity in ACPI or APM        
#                                    battery. ACPI battery number can be      
#                                    given as argument (default is BAT0).     
#  buffers                           Amount of memory buffered                
#  cached                            Amount of memory cached                  
#  color             (color)         Change drawing color to color            
#  cpu                               CPU usage in percents                    
#  cpubar            (height)        Bar that shows CPU usage, height is      
#                                    bar's height in pixels                   
#  downspeed         net             Download speed in kilobytes              
#  downspeedf        net             Download speed in kilobytes with one     
#                                    decimal                                  
#  exec              shell command   Executes a shell command and displays    
#                                    the output in torsmo. warning: this      
#                                    takes a lot more resources than other    
#                                    variables. I'd recommend coding wanted   
#                                    behaviour in C and posting a patch :-).  
#  execi             interval, shell Same as exec but with specific interval. 
#                    command         Interval can't be less than              
#                                    update_interval in configuration.        
#  fs_bar            (height), (fs)  Bar that shows how much space is used on 
#                                    a file system. height is the height in   
#                                    pixels. fs is any file on that file      
#                                    system.                                  
#  fs_free           (fs)            Free space on a file system available    
#                                    for users.                               
#  fs_free_perc      (fs)            Free percentage of space on a file       
#                                    system available for users.              
#  fs_size           (fs)            File system size                         
#  fs_used           (fs)            File system used space                   
#  hr                (height)        Horizontal line, height is the height in 
#                                    pixels                                   
#  i2c               (dev), type, n  I2C sensor from sysfs (Linux 2.6). dev   
#                                    may be omitted if you have only one I2C  
#                                    device. type is either in (or vol)       
#                                    meaning voltage, fan meaning fan or temp 
#                                    meaning temperature. n is number of the  
#                                    sensor. See /sys/bus/i2c/devices/ on     
#                                    your local computer.                     
#  kernel                            Kernel version                           
#  loadavg           (1), (2), (3)   System load average, 1 is for past 1     
#                                    minute, 2 for past 5 minutes and 3 for   
#                                    past 15 minutes.                         
#  machine                           Machine, i686 for example                
#  mails                             Mail count in mail spool. You can use    
#                                    program like fetchmail to get mails from 
#                                    some server using your favourite         
#                                    protocol. See also new_mails.            
#  mem                               Amount of memory in use                  
#  membar            (height)        Bar that shows amount of memory in use   
#  memmax                            Total amount of memory                   
#  memperc                           Percentage of memory in use              
#  new_mails                         Unread mail count in mail spool.         
#  nodename                          Hostname                                 
#  outlinecolor      (color)         Change outline color                     
#  pre_exec          shell command   Executes a shell command one time before 
#                                    torsmo displays anything and puts output 
#                                    as text.                                 
#  processes                         Total processes (sleeping and running)   
#  running_processes                 Running processes (not sleeping),        
#                                    requires Linux 2.6                       
#  shadecolor        (color)         Change shading color                     
#  stippled_hr       (space),        Stippled (dashed) horizontal line        
#                    (height)        
#  swapbar           (height)        Bar that shows amount of swap in use     
#  swap                              Amount of swap in use                    
#  swapmax                           Total amount of swap                     
#  swapperc                          Percentage of swap in use                
#  sysname                           System name, Linux for example           
#  time              (format)        Local time, see man strftime to get more 
#                                    information about format                 
#  totaldown         net             Total download, overflows at 4 GB on     
#                                    Linux with 32-bit arch and there doesn't 
#                                    seem to be a way to know how many times  
#                                    it has already done that before torsmo   
#                                    has started.                             
#  totalup           net             Total upload, this one too, may overflow 
#  updates                           Number of updates (for debugging)        
#  upspeed           net             Upload speed in kilobytes                
#  upspeedf          net             Upload speed in kilobytes with one       
#                                    decimal                                  
#  uptime                            Uptime                                   
#  uptime_short                      Uptime in a shorter format               
#
#  seti_prog                         [email protected] current progress
#  seti_progbar      (height)        [email protected] current progress bar
#  seti_credit                       [email protected] total user credit


# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument
#${font Dungeon:style=Bold:pixelsize=10}I can change the font as well
#${font Verdana:size=10}as many times as I choose
#${font Perry:size=10}Including UTF-8,
#${font Luxi Mono:size=10}justo como este texto que o google traduz fĂ?ÂŞz o portuguĂ?ÂŞs
# stuff after 'TEXT' will be formatted on screen

TEXT
${font Verdana:size=12}$alignc${color #DBAA82}${Time %d %B %Y} - ${color #FFFB00}${time %H:%M:%S}${font Sans:size=8.5}










${color #FF000C}${font Verdana:size=10}Moniteur Système :${font Sans:size=8.5}
${color #DBAA82}$sysname, ${color #565868}$kernel ${color #DBAA82}on ${color #565868}$machine
${color #DBAA82}Fréquence CPU : ${color #FFFB00}$freq_g ${color #DBAA82}GHz
${color #DBAA82}Uptime : ${color #B6A291}$uptime
${color #DBAA82}Temp. : ${color #B6A291}CPU : ${color #FFFB00}${acpitemp}°C ${color #DBAA82}| ${color #B6A291}DD : ${color #FFFB00}${execi 10 hddtemp -n /dev/sda}°C

${color #DBAA82}Adaptateur : ${color #FFFB00}${acpiacadapter}
${color #DBAA82}Autonomie : ${battery BAT1} ${battery_time BAT1}

${color #DBAA82}cpu: ${color #FFFB00}${cpu}% ${color #344299}$cpubar
${color #FFFFFF}${cpugraph DBAA82 344299}
${color #DBAA82}ram : ${color #3652FF}$mem ${color #DBAA82}/ $memmax - ${color #FFFB00}$memperc% ${color #344299}$membar
${color #DBAA82}swap : ${color #3652FF}$swap ${color #DBAA82}/ $swapmax - ${color #FFFB00}$swapperc% ${color #344299}$swapbar

${color #FFFB00}.: ${top name 1}
${color #DBAA82}PID: ${color #FFFB00}${top pid 1} ${color #DBAA82}%cpu : ${color #FFFB00}${top cpu 1}
${color #565868}.: ${top name 2}
${color #DBAA82}PID: ${color #3652FF}${top pid 2} ${color #DBAA82}%cpu : ${color #344299}${top cpu 2}
${color #565868}.: ${top name 3}
${color #DBAA82}PID: ${color #3652FF}${top pid 3} ${color #DBAA82}%cpu : ${color #344299}${top cpu 3} 

${color #FF000C}${font Verdana:size=10}Disques :${font Sans:size=8.5}
${color #DBAA82}/ : ${color #3652FF}${fs_used /} ${color #DBAA82}/ ${fs_size /} (${color #FFFB00}${fs_free_perc /}% ${color #DBAA82}free)
${color #344299}${fs_bar /}
${color #DBAA82}/home : ${color #3652FF}${fs_used /home} ${color #DBAA82}/ ${fs_size /home} (${color #FFFB00}${fs_free_perc /home}% ${color #DBAA82}free)
${color #344299}${fs_bar /home}
${color #DBAA82}/Musique : ${color #3652FF}${fs_used /Musique} ${color #DBAA82}/ ${fs_size /Musique} (${color #FFFB00}${fs_free_perc /Musique}% ${color #DBAA82}free)
${color #344299}${fs_bar /Musique}

${color #FF000C}${font Verdana:size=10}Réseau :${font Sans:size=8.5}
${color #DBAA82}down: ${color #FFFB00}${downspeedf eth1} k/s        ${color #DBAA82}up: ${color #FFFB00}${upspeedf eth1} k/s
${color #FFFFFF}${downspeedgraph eth1 25,100 DBAA82 344299}    ${color #FFFFFF}${upspeedgraph eth1 25,100 344299 DBAA82}

${color #FF000C}${font Verdana:size=10}Musique :${font Sans:size=8.5}
${color #800080}${gmb_title}
${color #4682B4}${gmb_artist}
${color #008B8B}${gmb_album}
${color #FFFB00}${gmb_elapsed}${color #DBAA82}/${gmb_length}  ${color #344299}${gmb_bar}${color #DBAA82}

You can also have something like that :

${color #FF000C}${font Lexia:size=10}Musique :${font Sans:size=8.5}${color0}
${if_existing /home/bbrice/.config/gmusicbrowser/gmusicbrowser.fifo}${gmb_title}
${gmb_artist}
${gmb_album}
${color #002939}${gmb_bar 18}${color0}
$alignc${voffset -21}${gmb_elapsed}/${gmb_length}$endif${if_empty $mpd_smart}$else${mpd_title}
${mpd_artist}
${mpd_album}
${color #002939}${mpd_bar 18}${color0}
$alignc${voffset -21}${mpd_elapsed}/${mpd_length}$endif

but in this case, you have to be careful to the location of the gmusicbrowser.fifo on your computer. In Ubuntu (Gutsy) you find this file here : ~/.gmusicbrowser/gmusicbrowser.fifo but in Debian Lenny, this file is “hidden” here : ~/.config/gmusicbrowser/gmusicbrowser.fifo.

For some other examples and tips and tricks you can visit this page on the Ubuntu-fr forum.

third_party_apps/conky.txt · Last modified: 2013/04/03 06:29 (external edit)
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0