You are not logged in.
After playing a lot with Statler on my test partition, I decided to start from the beginning with a fresh install. So everything is up and running now (and some issues still unsolved on this particular machine).
But conky doesn't work as expected. The problem seems to be in the if_existing - endif section of my config file.
background yes
double_buffer yes
use_xft yes
xftfont Sans:size=8
override_utf8_locale yes
update_interval 4
own_window no
maximum_width 160
draw_shades no
draw_outline no
draw_borders no
default_color gray75
alignment bottom_right
gap_x 12
gap_y 30
no_buffers yes
uppercase no
TEXT
uptime $alignr $uptime_short
cpu $alignr ${cpu cpu1}% $alignr ${acpitemp}°
${if_existing /proc/net/route wlan0}wireless $alignr ${wireless_essid wlan0} $alignr ${wireless_link_qual_perc wlan0}%
up $alignr ${upspeed wlan0}
down $alignr ${downspeed wlan0}${endif}
public $alignr ${execi 600 whatip}
${if_existing /proc/net/route wlan0}local $alignr ${addr wlan0}${endif}Any ideas what's wrong?
Edit: Moderators: if this is the wrong forum please move my post to Tips, Tricks & Scripts/Conky Help. Thank you!
Last edited by gruen (2010-03-29 09:39:04)
Samsung N220 | Ubuntu 10.04 LTS | #! 11 "Waldorf" & Xfce
http://twitter.com/herrgruen
Offline
I had this on one of my old Conkys. It told me I had a problem with endifs as well regarding my wireless script.
Not being that much of a Conky hacker, I just used a different setup and it's ok.
Here is the offending code (which usually works ok)
WIRELESS ${hr 2}
${if_existing /proc/net/route wlan0}
${voffset -6}${font PizzaDude Bullets:size=14}O${font} Up: ${upspeed
wlan0} kb/s ${alignr}${upspeedgraph wlan0 8,60 BEBEBE BEBEBE}
${voffset 4}${font PizzaDude Bullets:size=14}U${font} Down: ${downspeed wlan0$
BEBEBE}
${voffset 4}${font PizzaDude Bullets:size=14}N${font} Upload: ${alignr}${tota$
${voffset 4}${font PizzaDude Bullets:size=14}T${font} Download: ${alignr}${to$
${voffset 4}${font PizzaDude Bullets:size=14}Z${font} Signal: ${wireless_link$
${voffset 4}${font PizzaDude Bullets:size=14}a${font} Essid: ${alignr}${wirel$
${voffset 4}${font PizzaDude Bullets:size=14}a${font} Local Ip: ${alignr}${ad$
${else}${if_existing /proc/net/route wlan0}
${endif}${else}So I would also be interested to see if the more experienced Conky hackers know why this happens on Conky 1.8
Offline
I had this break in Statler also, and I use conky 1.8.0 in 9.04 also so I'm not certain that it's a conky thing...
I was able to get around the ${if_existing ...} by using ${if_up wlan0} instead.
--
...old school #! user now running Arch
jpope.org
Offline
I had this break in Statler also, and I use conky 1.8.0 in 9.04 also so I'm not certain that it's a conky thing...
I was able to get around the ${if_existing ...} by using ${if_up wlan0} instead.
That did it 
I also had the /proc/net/route to remove as well as the ${if_existing ...}.
Changed to - ${if_up wlan0} and bingo!
I think we'll probably see a few changed commands in the new Conky, I may have to keep a cheat sheet posted somewhere.
Thanks for the help jpope!
@gruen
I don't actually see any "if_existing" or "endif" arguments in the code you posted. Can you copy and paste the full .conkyrc ?
Last edited by rich (2010-03-29 13:57:11)
Offline
I had this break in Statler also, and I use conky 1.8.0 in 9.04 also so I'm not certain that it's a conky thing...
I was able to get around the ${if_existing ...} by using ${if_up wlan0} instead.
That does it, thanks! 
@richs-lxh The complete code is already there!
Samsung N220 | Ubuntu 10.04 LTS | #! 11 "Waldorf" & Xfce
http://twitter.com/herrgruen
Offline
jpope wrote:I had this break in Statler also, and I use conky 1.8.0 in 9.04 also so I'm not certain that it's a conky thing...
I was able to get around the ${if_existing ...} by using ${if_up wlan0} instead.
That does it, thanks!
@richs-lxh The complete code is already there!
Mybad! 
I'm using a light theme, and I didn't see the scrollbar on the code box to see the hidden code at the bottom. I just scrolled down and saw what you meant. Sorry about that.
Offline
I may have to keep a cheat sheet posted somewhere.
Something like this?
Note: ** Please read before posting **
BTW if you wish to contact me, send me an e-mail instead of a PM.
Offline
I don't understand this and have tried everything I can think of to 'fix it'
But, for the past 2 days my single-line across the top Conky has switched from being on the top to being on the bottom, behind tint2.
I have gone in and changed the settings in .Conkyrc files and I just plain deleted the whole Conky file, re-booted and made a new .Conkyrc file.
alignment top_center
gap_x 80
gap_y 00
Nothing has worked so far. Still on the bottom behind tint2.
I did change the gap 'y' and 'x' parts of the Conky source files so that Conky is just above tint2 now.
I have used the same Conky files for months ... this has not happened until now.
Advice on how to fix/change this, back to having my Conky on the top of the screen?
Last edited by vrkalak (2010-04-01 03:57:45)
Registered Linux User: #497030
DeviantART page | Ask.Debian
#!Crunchbang 'Waldorf' (Openbox) -- Mint-Debian Fluxbox Edition
Offline
replacing ${if_existing /proc/net/route wlan0} by ${if_up wlan0} worked for me as well.
what to do with ${if_existing /proc/net/route eth0} ? Anyone has a replacement for that (apart from looking if a cable is attached to my laptop)?
thanks...
sed 's/stress/relaxation/g'
Privacy & Security on #!
Offline
replacing ${if_existing /proc/net/route wlan0} by ${if_up wlan0} worked for me as well.
what to do with ${if_existing /proc/net/route eth0} ? Anyone has a replacement for that (apart from looking if a cable is attached to my laptop)?thanks...
Maybe i'm simplifying this too much, but ${if_up eth0} ?
Offline
richs-lxh wrote:I may have to keep a cheat sheet posted somewhere.
Something like this?
Yeah, similar, but with a little more information 
Actually, I meant a cheat sheet with the more common variables that my humble, basic Conkys I use.
Thanks for the link, bookmarked. 
Last edited by rich (2010-04-03 19:13:28)
Offline
I use this setup to print the ethernet or wireless or no network info:
alignment top_right
background yes
border_inner_margin 0
border_outer_margin 0
cpu_avg_samples 2
default_color white
default_shade_color black
default_outline_color white
double_buffer yes
draw_borders no
draw_graph_borders no
draw_outline no
draw_shades no
short_units yes
gap_x 12
gap_y 12
maximum_width 500
max_port_monitor_connections 64
max_specials 512
max_user_text 16384
minimum_size 204 224
net_avg_samples 2
no_buffers yes
out_to_console no
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_transparent yes
own_window_type desktop
own_window yes
update_interval 1.0
uppercase no
use_spacer none
use_xft yes
xftalpha 0.8
xftfont Santana:size=10:style=bold
override_utf8_locale yes
if_up_strictness address
TEXT
${if_up eth0}${font dearjoe 5 CASUAL trial:size=26:style=bold}$alignc}Ethernet$font
$alignc}IP: ${addr eth0}
$alignc}GW: $gw_ip
${offset 75}${font RsbillsDng :size=14}w$font} ${upspeed eth0}/s
${offset 75}${font RsbillsDng :size=14}F$font} ${downspeed eth0}/s $else
${if_up wlan0}${font dearjoe 5 CASUAL trial:size=22:style=bold}$alignc}Wifi$font
${voffset 5}${font Webdings:size=6}$alignc${if_match ${wireless_link_qual_perc wlan0} >= 80}${color green}nnnnn$else${if_match ${wireless_link_qual_perc wlan0} >= 60}${color light green}nnnn$else${if_match ${wireless_link_qual_perc wlan0} >= 40}${color yellow}nnn$else${if_match ${wireless_link_qual_perc wlan0} >= 20}${color orange}nn$else${if_match ${wireless_link_qual_perc wlan0} >= 0}${color red}n$endif$endif$endif$endif$endif$font$color
$alignc}${wireless_essid wlan0}
$alignc}IP: ${addr wlan0}
$alignc}GW: $gw_ip
${offset 75}${font RsbillsDng :size=14}w$font} ${upspeed wlan0}/s
${offset 75}${font RsbillsDng :size=14}F$font} ${downspeed wlan0}/s$else
${font dearjoe 5 CASUAL trial:size=22:style=bold}$alignc}No network$font$endifOffline
Tunafish wrote:replacing ${if_existing /proc/net/route wlan0} by ${if_up wlan0} worked for me as well.
what to do with ${if_existing /proc/net/route eth0} ? Anyone has a replacement for that (apart from looking if a cable is attached to my laptop)?thanks...
Maybe i'm simplifying this too much, but ${if_up eth0} ?
that's what i thought, but it doesn't work... i gave up on this one...
sed 's/stress/relaxation/g'
Privacy & Security on #!
Offline
Maybe it's not that clear on my post but the key with if_up is the "if_up_strictness address" on the settings (above TEXT). then you can use this template:
${if_up eth0} YOUR SETUP FOR eth0 $else
${if up wlan0} YOUR SETUP FOR wlan0 $else
YOUR SETUP FOR NO NETWORK$endif
[EDIT]
This way if you have an ethernet cable connected you'll get the setup for eth0, if you're connected to wlan0 you'll get the wlan0 setup, and if you are not connected to either of them you can get something like "no network". If you are connecting to both networks simultaneously you have to change it like that:
${if_up eth0} YOUR SETUP FOR eth0 $else}No ethernet connection$endif
${if up wlan0} YOUR SETUP FOR wlan0 $else}No wireless connection$endif
[/EDIT]
When I get the 1.8.0rc1 conky, a couple of months ago, my setup with if_existing stopped to work and then I noticed the if_up strictness.
I hope this will work for you too
Last edited by slapfish (2010-04-04 12:22:08)
Offline
My conky also stopped working just now after Synaptic upgraded it, but the if_up trick worked for me: many thanks!
Slapfish: Can you give us a little more information on what the if_up_strictness command does? It seems to be important, but I can't quite work out what exactly it does.
Also, does anybody know if it's possible in conky to do some sort of OR test? That is, would it be possible to have something like ${if_up wlan0 OR eth0} ?
Offline
I'm quoting from the conky documentation:
How strict should if_up be when testing an interface for being up? The value is one of up, link or address, to check for the interface being solely up, being up and having link or being up, having link and an assigned IP address.
If I remember right without the strictness address I was always getting the setup between if_up and endif because the (eth0) interface was up but without address.
The OR thing you are asking is what you get with the else part. If eth0 is up then do "This" else if wlan0 is up then do "That" else (if none of them is up) do "something else" and if somewhere in the middle or in the end you have done anything continue after the endif.
My English isn't that good so I really hope I was clear enough.
Glad I could help in the first place anyway...
Offline
Thanks, I didn't notice the if_up_strictness command in your setup.
Tonijn
sed 's/stress/relaxation/g'
Privacy & Security on #!
Offline
Slapfish: your English is excellent! I was just asking if there was a proper OR command to avoid writing the same code more than once. If OR doesn't exist, it's not a big deal - it just would have been nice. Thanks again.
Offline
Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.