LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-01-2011, 07:57 PM   #1
clifford227
Member
 
Registered: Dec 2009
Distribution: Slackware 14
Posts: 282

Rep: Reputation: 64
Obtaining IP address for conky


Hi,

I use conky to display my IP address on the desktop.

I do this by using wget in the conky config to grab the ip off of whatsmyip.org, but sometimes it seems the sites down, and conky will then not display itself while it periodically trys to get the address.

Is there a way I could do this on my own webspace?
 
Old 03-01-2011, 08:03 PM   #2
andrewthomas
Senior Member
 
Registered: May 2010
Location: Chicago Metro
Distribution: Arch, Gentoo, Slackware
Posts: 1,690

Rep: Reputation: 311Reputation: 311Reputation: 311Reputation: 311
Quote:
Originally Posted by clifford227 View Post
Hi,

I use conky to display my IP address on the desktop.

I do this by using wget in the conky config to grab the ip off of whatsmyip.org, but sometimes it seems the sites down, and conky will then not display itself while it periodically trys to get the address.

Is there a way I could do this on my own webspace?
The site is not going down, your config is either polling it too often, or you are reloading your conky configuration too often and are being temporarily blocked by whatsmyip.

You could try another:

http://checkip.dyndns.org/
Code:
wget -q -O /dev/stdout http://checkip.dyndns.org/ | cut -d : -f 2- | cut -d \< -f -1
You could also get it from your router or modem.

Last edited by andrewthomas; 03-01-2011 at 08:16 PM.
 
1 members found this post helpful.
Old 03-01-2011, 08:29 PM   #3
clifford227
Member
 
Registered: Dec 2009
Distribution: Slackware 14
Posts: 282

Original Poster
Rep: Reputation: 64
Thanks Andrew, I think you were right it was trying to often and was blocked.

Last edited by clifford227; 03-01-2011 at 08:38 PM.
 
Old 03-02-2011, 06:09 PM   #4
arizonagroovejet
Senior Member
 
Registered: Jun 2005
Location: England
Distribution: openSUSE, Fedora, CentOS
Posts: 1,093

Rep: Reputation: 197Reputation: 197
If you want conky to display your IP address, just use the addr object.

Code:
${addr eth0}
http://conky.sourceforge.net/variables.html

Even if you didn't use the addr option, using wget to hit an external website is... well it's inventive I'll give you that There are tools you can run locally that will tell you your IP address

Code:
$ /sbin/ifconfig eth0 | grep "inet addr" | cut -d "B" -f 1 | cut -d ":" -f 2 | sed 's/^ *//;s/ *$//'
If you have a DNS entry for your IP address you can use

Code:
$ hostname -i
 
Old 04-07-2015, 07:33 AM   #5
mimosinnet
Member
 
Registered: Feb 2006
Location: Barcelona, Spain
Distribution: Gentoo
Posts: 37

Rep: Reputation: 8
Get the external IP for conky:

Code:
${execi 3600 curl ifconfig.me | tail }
 
Old 04-07-2015, 09:48 AM   #6
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Yawnstown, Ohio
Distribution: Mojave
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by mimosinnet View Post
Get the external IP for conky:

Code:
${execi 3600 curl ifconfig.me | tail }
and yet another.
Code:
curl icanhazip.com
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
obtaining ip address from mac address Mastupristi Linux - Wireless Networking 8 10-12-2010 06:47 PM
problems obtaining an wireless IP address ELconkestador Linux - Wireless Networking 2 01-23-2005 01:56 PM
Help obtaining ip address colombo187 Linux - Wireless Networking 4 12-28-2004 06:29 PM
Obtaining and IP address dynamicly getatmefosho Linux - Networking 3 12-10-2002 08:48 AM
a question about obtaining address of variable ....... purpleburple Programming 3 07-06-2002 06:28 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:17 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration