Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Need help displaying selective eth info in Conky

  1. #11
    Join Date
    Jun 2006
    Location
    Columbus, Ohio
    Beans
    123
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Need help displaying selective eth info in Conky

    Quote Originally Posted by MikeBrown View Post
    I did check for the file in each directory, and yes it does show up. I also searched and found that I also have the eth0 eth1 lo and pan0 folders.

    I tried to open up the operstate file but it gives me a "no such device" error.

    Would it also be important to note that I copy and pasted your original code straight into my conky?

    I assumed that it was written in way that is pretty common. I have the same file structure in my system, but it could be that I need to change the paths.

    I am still playing with it, but nothing is giving me a positive result.
    Basically you should replace every instance of wlan0 with eth1. That is if I'm correct in my assumption that when you're connected to LAN /sys/class/net/eth0/operstate is 'up' and when you're connected to wireless /sys/class/net/eth1/operstate is 'up'.

    This should work for you if the above statement is true.
    Code:
    ${color gold}NETWORK ${hr 2}
    ${alignc}${color red}${if_existing /sys/class/net/eth0/operstate up}WIRED${else}${if_existing /sys/class/net/eth1/operstate up}Wi-Fi$endif$endif
    ${offset 5}${color cornflowerblue}Hostname${color}${alignr}$nodename
    ${offset 5}${color cornflowerblue}User${color}${alignr}${execi 1000 whoami}
    ${offset 5}${color cornflowerblue}Public IP${alignr}${color}${execi 1000 wget -O - http://whatismyip.org/ | tail}
    ${offset 5}${color cornflowerblue}${if_existing /sys/class/net/eth0/operstate up}Private IP$color$alignr${addr eth0}$else${if_existing /sys/class/net/eth1/operstate up}Private IP$color$alignr ${addr eth1}$endif$endif
    ${offset 5}${color cornflowerblue}${if_existing /sys/class/net/eth0/operstate up}Down: $color${downspeed eth0} k/s${color cornflowerblue}{$alignr}Total: $color${totaldown eth0}$else${if_existing /sys/class/net/eth1/operstate up}MAC $color$alignr ${wireless_ap eth1}$endif$endif
    ${offset 5}${if_existing /sys/class/net/eth0/operstate up}${downspeedgraph eth0 000000 ffffff}$else${if_existing /sys/class/net/eth1/operstate up}${wireless_essid eth1}${alignr}${wireless_bitrate eth1} ${wireless_link_qual_perc eth1}%$endif$endif
    ${offset 5}${color cornflowerblue}${if_existing /sys/class/net/eth0/operstate up}Up: $color${upspeed eth0} k/s${color cornflowerblue}${alignr}Total: $color${totalup eth0}$else${if_existing /sys/class/net/eth1/operstate up}Down: $color${downspeed eth1} k/s${color cornflowerblue}$alignr Total: $color${totaldown eth1}$endif$endif
    ${offset 5}${if_existing /sys/class/net/eth0/operstate up}${upspeedgraph eth0 000000 ffffff}$else${if_existing /sys/class/net/eth1/operstate up}${downspeedgraph eth1 000000 ffffff}$endif$endif
    ${offset 5}${color cornflowerblue}${if_existing /sys/class/net/eth1/operstate up}Up: $color${upspeed eth1} k/s${color cornflowerblue}${alignr}Total: $color${totalup eth1}
    ${offset 5}${upspeedgraph eth1 000000 ffffff}$endif

  2. #12
    Join Date
    Oct 2007
    Location
    Indianapolis, IN
    Beans
    60
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Need help displaying selective eth info in Conky

    /facepalm

    Eureka! That worked! *happy dance*

    You rock dude!

    Tested on both wireless and "hard wired" (as I call it).

    Works great! Thanks A Lot!
    Last edited by MikeBrown; May 5th, 2009 at 04:24 AM.
    Tregrix: HP Pavilion dv9000 Laptop with an AMD Turion 64 x2 TL-64 2.20 GHz Processors, 2 Gigs RAM, Nvidia GeForce Go 6150 Graphics card, Dual Booting Windows Vista and Ubuntu 9.04

    Twitter?

  3. #13
    Join Date
    Jun 2006
    Location
    Columbus, Ohio
    Beans
    123
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Need help displaying selective eth info in Conky

    Quote Originally Posted by MikeBrown View Post
    /facepalm

    Eureka! That worked! *happy dance*

    You rock dude!

    Tested on both wireless and "hard wired" (as I call it).

    Works great! Thanks A Lot!
    Awesome! You're welcome.

  4. #14
    Join Date
    Oct 2007
    Location
    Indianapolis, IN
    Beans
    60
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Need help displaying selective eth info in Conky

    I have one final question: is there a way to delay the whatismyip command, because that takes a lot longer than it should and prevents conky from launching right away.

    I would like for conky to launch at start up and then load my programs THEN get the internet information. Is that possible?
    Tregrix: HP Pavilion dv9000 Laptop with an AMD Turion 64 x2 TL-64 2.20 GHz Processors, 2 Gigs RAM, Nvidia GeForce Go 6150 Graphics card, Dual Booting Windows Vista and Ubuntu 9.04

    Twitter?

  5. #15
    Join Date
    Jun 2006
    Location
    Columbus, Ohio
    Beans
    123
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Need help displaying selective eth info in Conky

    Quote Originally Posted by MikeBrown View Post
    I have one final question: is there a way to delay the whatismyip command, because that takes a lot longer than it should and prevents conky from launching right away.

    I would like for conky to launch at start up and then load my programs THEN get the internet information. Is that possible?
    I had to start conky up later sometimes as well. What you can do is in your startup script that starts conky
    Code:
    sleep 60 && conky;
    So when conky is started, it will "sleep" (wait) 60 seconds before it runs conky. You can adjust the '60' accordingly.

  6. #16
    Join Date
    Oct 2007
    Location
    Indianapolis, IN
    Beans
    60
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Need help displaying selective eth info in Conky

    roger, thanks again!
    Tregrix: HP Pavilion dv9000 Laptop with an AMD Turion 64 x2 TL-64 2.20 GHz Processors, 2 Gigs RAM, Nvidia GeForce Go 6150 Graphics card, Dual Booting Windows Vista and Ubuntu 9.04

    Twitter?

Page 2 of 2 FirstFirst 12

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •