You are not logged in.
Is there a way to make a conky config that will check to see it your wlan card is on/off. When it is on, it should show some set of information that you choose. When it is off, none of that information should be shown.
I like to see:
Link Quality
SSID
Up
Down
Upload
Download
IP Address
I know that conky has if-elseif-endif statements, but I assume that those go through the config once, and then don't go through it again.
I guess that it could be done with an external script as well, but I am no programmer, so I am not sure about that.
Thoughts?
Michael
OpenArch = Dell Dimension 4300 with Arch Linux and Openbox3
Offline
This is a snip from my .conkyrc
${if_existing /proc/net/route wlan0}
${color0}Wireless
${color0}IP Address:${alignr}${color1}${addr wlan0}
${color0}Download:${alignr}${color1}${downspeed wlan0}k/s
${color0}Upload:${alignr}${color1}${upspeed wlan0}k/s
${color0}Strength:${wireless_link_bar wlan0}
${endif}
Are you familiar with our Forum Rules, and How To Ask Questions The Smart Way?
BlueHackers // fscanary // resticctl
Offline
Another way to do this is to use conky if_up condition -- see man conky for details.
Offline
Here is mine:
NETWORK ${hr 2}
${if_existing /proc/net/route eth0}
${alignc}Wired
Up: ${upspeed eth0} kb/s ${alignr}${upspeedgraph eth0 8,60 789E2D A7CC5C}
Down: ${downspeed eth0} kb/s ${alignr}${downspeedgraph eth0 8,60 789E2D A7CC5C}
Upload: ${alignr}${totalup eth0}
Download: ${alignr}${totaldown eth0}
Local IP: ${alignr}${addr eth0}
${else}
${if_existing /proc/net/route eth1}
${alignc}Wireless
Signal: ${wireless_link_qual eth1}% ${alignr}${wireless_link_bar 8,60 eth1}
Attached to:${alignr}${wireless_essid eth1}
Up: ${upspeed eth1} kb/s ${alignr}${upspeedgraph eth1 8,60 789E2D A7CC5C}
Down: ${downspeed eth1} kb/s ${alignr}${downspeedgraph eth1 8,60 789E2D A7CC5C}
Upload: ${alignr}${totalup eth1}
Download: ${alignr}${totaldown eth1}
Local IP: ${alignr}${addr eth1}
${endif}
But when I 'Enable Wireless', the Wireless section does not refresh in conky to add it to my screen.
I was looking for more of a realtime monitor of my wireless stats.
Michael
OpenArch = Dell Dimension 4300 with Arch Linux and Openbox3
Offline
Here is mine:
NETWORK ${hr 2} ${if_existing /proc/net/route eth0} ${alignc}Wired Up: ${upspeed eth0} kb/s ${alignr}${upspeedgraph eth0 8,60 789E2D A7CC5C} Down: ${downspeed eth0} kb/s ${alignr}${downspeedgraph eth0 8,60 789E2D A7CC5C} Upload: ${alignr}${totalup eth0} Download: ${alignr}${totaldown eth0} Local IP: ${alignr}${addr eth0} ${else} ${if_existing /proc/net/route eth1} ${alignc}Wireless Signal: ${wireless_link_qual eth1}% ${alignr}${wireless_link_bar 8,60 eth1} Attached to:${alignr}${wireless_essid eth1} Up: ${upspeed eth1} kb/s ${alignr}${upspeedgraph eth1 8,60 789E2D A7CC5C} Down: ${downspeed eth1} kb/s ${alignr}${downspeedgraph eth1 8,60 789E2D A7CC5C} Upload: ${alignr}${totalup eth1} Download: ${alignr}${totaldown eth1} Local IP: ${alignr}${addr eth1} ${endif}
just an observation
if your first $if_existing is always true (eth0 exists) then the $else condition will never be run.
i'd reverse your statements and you may find it works as you want.
//github/
Offline
michaelramm wrote:Here is mine:
NETWORK ${hr 2} ${if_existing /proc/net/route eth0} ${alignc}Wired Up: ${upspeed eth0} kb/s ${alignr}${upspeedgraph eth0 8,60 789E2D A7CC5C} Down: ${downspeed eth0} kb/s ${alignr}${downspeedgraph eth0 8,60 789E2D A7CC5C} Upload: ${alignr}${totalup eth0} Download: ${alignr}${totaldown eth0} Local IP: ${alignr}${addr eth0} [b]${else}[/b] ${if_existing /proc/net/route eth1} ${alignc}Wireless Signal: ${wireless_link_qual eth1}% ${alignr}${wireless_link_bar 8,60 eth1} Attached to:${alignr}${wireless_essid eth1} Up: ${upspeed eth1} kb/s ${alignr}${upspeedgraph eth1 8,60 789E2D A7CC5C} Down: ${downspeed eth1} kb/s ${alignr}${downspeedgraph eth1 8,60 789E2D A7CC5C} Upload: ${alignr}${totalup eth1} Download: ${alignr}${totaldown eth1} Local IP: ${alignr}${addr eth1} ${endif}
just an observation
if your first $if_existing is always true (eth0 exists) then the $else condition will never be run.
i'd reverse your statements and you may find it works as you want.
Thanks for the insight!
I took out the else that is bolded above, and it is rocking along just how I want it to. Wireless section goes away when I turn off wireless and it reappears when I turn it on!
Thanks,
Michael
OpenArch = Dell Dimension 4300 with Arch Linux and Openbox3
Offline
Another one:
${if_up wlan0}
${color 9AB7DC}Wireless:
${color a4a4a4}${wireless_essid wlan0} $alignr(${wireless_link_qual_perc wlan0}%)
${color 9AB7DC}Up:${color a4a4a4}${alignr}${upspeed wlan0}KB/s
${color 668ABF}${upspeedgraph wlan0 10,85 668ABF 9AB7DC}
${color 9AB7DC}Total: ${color a4a4a4}${totalup wlan0}
${color 9AB7DC}Down:${color a4a4a4}${alignr}${downspeed wlan0}KB/s
${color 668ABF}${downspeedgraph wlan0 10,85 668ABF 9AB7DC}
${color 9AB7DC}Total: ${color a4a4a4}${totaldown wlan0}
${endif}
${if_up eth0}
${color 9AB7DC}Network:
${color 9AB7DC}Up:${color a4a4a4}${alignr}${upspeed eth0}KB/s
${color 668ABF}${upspeedgraph eth0 10,85 668ABF 9AB7DC}
${color 9AB7DC}Total: ${color a4a4a4}${totalup eth0}
${color 9AB7DC}Down:${color a4a4a4}${alignr}${downspeed eth0}KB/s
${color 668ABF}${downspeedgraph eth0 10,85 668ABF 9AB7DC}
${color 9AB7DC}Total: ${color a4a4a4}${totaldown eth0}
${endif}
Offline
and another (shortened) one, using the kill switch condition:
Wireless ESSID: ${if_existing /sys/bus/pci/drivers/iwl3945/0000:0c:00.0/rfkill:rfkill0/state 2}Kill switch enabled${endif}${if_existing /sys/bus/pci/drivers/iwl3945/0000:0c:00.0/rfkill:rfkill0/state 1}${wireless_essid wlan0}${alignr}${color}Link Quality:${color #B3B3B3} ${wireless_link_qual wlan0}${endif}
Prints "Kill switch enabled" if rfkill is 2, and prints "some_essid $alignr Link Quality: some_quality" when rfkill is 1.
Though I think I messed something up with the numbers as I switched from ipw to iwl. Haven't taken care of it since.
Last edited by Shapeshifter (2008-12-08 22:48:52)
Offline
I took out the else that is bolded above, and it is rocking along just how I want it to
glad i could help, you didn't really have to remove the else; if it were me i'd just reverse them like this
${if_existing /wireless/path}
--wireless info--
$else
${if_existing /wired/path}
--wired info--
$endif
that way you get wireless info only when your wireless and wired info only if your wired.
i'm glad you got me thinking on this; i might implement a similar amarok/mpd if/else switch for my "Now Playing" section in my conky
//github/
Offline
michaelramm wrote:I took out the else that is bolded above, and it is rocking along just how I want it to
glad i could help, you didn't really have to remove the else; if it were me i'd just reverse them like this
${if_existing /wireless/path} --wireless info-- $else ${if_existing /wired/path} --wired info-- $endif
that way you get wireless info only when your wireless and wired info only if your wired.
i'm glad you got me thinking on this; i might implement a similar amarok/mpd if/else switch for my "Now Playing" section in my conky
Once again, you are right. I hooked up to a wlan without a lan, and the bottom of the graph was gone. So I swapped the wlan and lan stmts and we are cooking with gas now!
Once again, my thanks to you!
Michael
OpenArch = Dell Dimension 4300 with Arch Linux and Openbox3
Offline