Page 1 of 1
Conky and Radio Tray?
Posted: Thu May 12, 2011 10:37 am
by Carl
I've got conky up and running and I want it to display the current playing track on Radio Tray (
http://radiotray.sourceforge.net/) I'm not really sure how I'd go about this however Radio Tray does use NotifyOSD to display the current song being played on the radio station so I was wondering if I could get conky to display the last line of the NotifyOSD log?
located at: ~/.cache/notify-osd.log
so currently the last couple of lines look like this
Code: Select all
[2011-05-12T15:33:58-00:00, Radio Tray ] Radio Tray - GaydarRadio
De’ Lacy - Hideaway @GaydarRadio
so I'd want radio tray to display what’s on the second line
[Edit 1] - Okay adding the line below will get it to display the whole file but how would I get it to always display the last line and then periodically check?
Code: Select all
${execi 30 cat ~/.cache/notify-osd.log}
Re: Conky and Radio Tray?
Posted: Thu May 12, 2011 12:08 pm
by Habitual
check out "text_buffer_size" at
http://conky.sourceforge.net/docs.html
Real-life example I use:
text_buffer_size 2048
Re: Conky and Radio Tray?
Posted: Thu May 12, 2011 12:40 pm
by Carl
but unfortunately text_buffer_size has a minimum of 256 which is too much and also it shows the first lines of text from the file which are the oldest notifications
Re: Conky and Radio Tray?
Posted: Thu May 12, 2011 12:58 pm
by Habitual
Carl wrote:Code: Select all
${execi 30 cat ~/.cache/notify-osd.log}
${execi 30 cat ~/.cache/notify-osd.log| tail -1}
Re: Conky and Radio Tray?
Posted: Thu May 12, 2011 1:12 pm
by Carl
Habitual wrote:Carl wrote:Code: Select all
${execi 30 cat ~/.cache/notify-osd.log}
${execi 30 cat ~/.cache/notify-osd.log| tail -1}
yep thanks for that
after I posted about the other bit not working out I searched and found this
${execi 30 tail -4 ~/.cache/notify-osd.log}
which looks very similar to yours
now if I could sort out the text from being cut off from the right side, I know increasing the maximum width would do this but it would also make it wider then I would like... coulld not get it to squeeze onto more lines instead?
Code: Select all
#!/usr/bin/conky -d -c
## .conkyrc configuration
alignment top_left
background yes
border_margin 5
border_width 5
color0 555555 #
color1 FCAF3E # zolty
color2 2a2a2a # braz
color3 a82553 # rozowy f71f84
color4 5e1014 # bordowy
color5 64574e # braz
color6 2a2a2a # szary
color7 8888CC # (COOL)
color8 9d9c61 # zolto-szary
color9 525276 # niebiesko-szary
cpu_avg_samples 2
default_color ffffff # szary 5f5f5f
default_outline_color 000000 # Black
default_shade_color 000000 # Black
double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
gap_x 30
gap_y 80
max_specials 1024
max_user_text 10000
maximum_width 200
minimum_size 175
net_avg_samples 2
no_buffers yes
override_utf8_locale yes
own_window yes
own_window_colour 000000 # Black
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type override ## normal
pad_percents 2 # to co nizej, miejsc po przecinku
short_units yes # krotka wersja podawania wielkosci dyskow np. 612.21M/3.80G
stippled_borders 3
text_buffer_size 8000
total_run_times 0
update_interval 1.0
uppercase no
use_spacer right
use_xft yes
xftalpha 1
xftfont Freesans:pixelsize=9
lua_load /home/didisoft/.conky/lua.lua
# ${diskiograph /dev/sda 15,180 a7a7a7 a7a7a7} # wskaznik pracy dysku
# ${image /home/didisoft/.conky/didisoft.jpg -p 0,80 -s 26x28} # obrazki w conky
TEXT
${font Zegoe Light - U:pixelsize=24}${time %H:%M:%S}${font}
${font Zegoe Light - U:pixelsize=12}${time %A} - ${time %B %d, %Y}${font}
${execi 30 cat ~/.cache/notify-osd.log| tail -4}
${font Zegoe Light - U:pixelsize=24}System${font}
${offset 0}${font PizzaDude Bullets:pixelsize=12}b${font} ${font Zegoe Light - U:pixelsize=12}Uptime: $uptime_short
Power: ${battery_percent BAT0}%
Mem: $mem
Storage: ${fs_used /}
Signal: ${wireless_link_qual eth1}%
Ul: ${upspeed eth1} kb/s
Dl: ${downspeed eth1} kb/s
${font}
${font Zegoe Light - U:pixelsize=24}To Do${font}
${offset 0}${font PizzaDude Bullets:pixelsize=12}b${font} ${font Zegoe Light - U:pixelsize=12} - Phone Student Finance England
and discuss not coming back to
college next year
- Get SAC peasant fund sorted out
to help pay rent debt...
- Actually start RBGE plot and work
experience logs!
${font}
Re: Conky and Radio Tray?
Posted: Thu May 12, 2011 4:03 pm
by Habitual
Code: Select all
${font DejaVu Sans Mono:size=10} {execi 30 tail -4 ~/.cache/notify-osd.log}$font
?
Re: Conky and Radio Tray?
Posted: Thu May 12, 2011 4:34 pm
by Carl
Habitual wrote:Code: Select all
${font DejaVu Sans Mono:size=10} {execi 30 tail -4 ~/.cache/notify-osd.log}$font
?
nope don't worry about it
Thanks for your help ^^
Re: Conky and Radio Tray?
Posted: Thu May 12, 2011 8:03 pm
by Habitual
why tail -4 when all you wanted/needed was "the last line and then periodically check?"
tail -1 /path/to/file
Re: Conky and Radio Tray?
Posted: Fri May 13, 2011 3:57 pm
by Carl
Habitual wrote:why tail -4 when all you wanted/needed was "the last line and then periodically check?"
tail -1 /path/to/file
because the last line is blank in that file, and tail -4 was really the only option which made sense if the song title was quite long such as in remixes
Re: Conky and Radio Tray?
Posted: Sat Apr 14, 2012 8:32 pm
by VastOne
An easier way is to use qdbus ...
Just add this to a Conky
Code: Select all
${color #7D8C93}Radio Tray${font}
${color #7D8C93}Station
${execi 15 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray net.sourceforge.radiotray.getCurrentRadio}
${color #7D8C93}Artist & Song
${execi 15 qdbus net.sourceforge.radiotray /net/sourceforge/radiotray getCurrentMetaData| fold -s -w35}
This is what it displays with my Gmail/Google Reader Conky