Originally Posted by
kingbirdy
Two questions: what code do you use for the visualizer (or is it a program you have) and what is the name of the tray you're using at the bottom?
The audio visualizer is wlourf's http://ubuntuforums.org/showpost.php...&postcount=175. I combined it with the album art pulled from Amarok. Here's how I done it:
First my directory structure:
~/bin
~/conky/spiral/cover
The bash script for the album art goes into the bin folder, save it as getcover_sphere and make it executable:
Code:
#!/bin/bash
# by larryni
# get Amarok cover art of current track and transform into a sphere
# 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
# Temp directory must be full path.
tempdir="$HOME/conky/spiral/cover/"
tempfile="${tempdir}nowplaying"
[ -d "$tempdir" ] || mkdir -p "$tempdir" #test if $tempdir exists, if not create it.
[ -e "$tempfile" ] || touch "$tempfile"
cover="$(dcop amarok player coverImage)"
[ -z "$cover" ] && exit #test if $cover was set, if not exit.
hash=$(echo "$cover" | md5sum | cut -d" " -f 1) #Generate hash for current song.
read oldhash < "$tempfile"
if [ "$oldhash" == "$hash" ];then
:
else
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
To achieve the button effect for the cover art you need the 2 files attached below, save them in the cover folder. Save the first one as sphere_overlay.png and the other as sphere_mask.png.
Download wlourf's script and extract the files in to ~/conky/spiral
And the conky script to pull it all together:
Code:
# -- 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 -- #
own_window no
own_window_type desktop
own_window_transparent yes
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
#own_window_title audio spectrum for conky
border_inner_margin 0
border_outer_margin 0
minimum_size 400 400
alignment br
gap_x 0
gap_y 0
# -- Graphics settings -- #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# -- Text settings -- #
use_xft yes
xftfont Santana:size=12
xftalpha 0.8
uppercase no
default_color FFFFFF
# -- Lua Load -- #
#set FULL path of the script
lua_load $HOME/conky/spiral/audio_spectrum.lua
#arguments for the spectrum function are:
#theme : default, circle or widget
#x, y : (from top left corner of conky window)
#x,y are left bottom of graph for default or widget
#x,y are center of circle for circle _equalizer
#fft : (0/1) 1 to perfom a FTT analysis on audio
#nb_cols : (1-255)
#col_width : (>0)
#col_spacing: (>=0)
#nb_rows : (>0)
#row_height : (>0)
#row_spacing: (>=0),
#next arguments are only for default and circle
#bar_color : color of bars in the graph
#bar_alpha : (0-1) alpha of bars in the graph
#peak_color : color for peak in the graph
#peak_alpha :(0-1)
#next argument is only for circle and for widget on circle
#radius : (>0) radius of circle
# reminder, arguments on one line:
# x,y, fft, nb_cols, col_width,col_spacing,nb_rows,row_height,row_spacing [,bar_color,bar_alpha,peak_color, peak_alpha [, radius]]
##### DON'T USE TABULATION BETWEEN ARGUMENTS, JUST SPACES #####
lua_draw_hook_pre spectrum circle 1720 880 1 100 10 2 75 2 2 000000 0.5 000000 1 50
TEXT
${if_running amarokapp}${execi 10 getcover_sphere}${image ~/conky/spiral/cover/cover_sphere.png -p 151,150}
${else}${endif}
This is for my screen resolution 1920x1080, you will need to play around with the position for your resolution.
The album art 'button' looks great most of the time. If the album art is not really square to begin with then the end result can look a bit off - you'll see what I mean once you try it Edit3: This is now fixed
Edit: The tray I use is part of the awn dock with the lucido style. See this post for install instructions http://www.webupd8.org/2010/06/awn-l...s-own-ppa.html
Edit2: the cover script only works for Amarok 1.4.
Bookmarks