(SOLVED) Display IPAddress in Cinnamon 18.1.?

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
PlutoPup
Level 1
Level 1
Posts: 18
Joined: Tue May 16, 2017 8:45 pm

(SOLVED) Display IPAddress in Cinnamon 18.1.?

Postby PlutoPup » Fri May 19, 2017 9:26 am

Does anyone know if there is anyway to display the IP Address - either on the panel via applet or on the desktop via gadget..?

SOLVED -

I figured it out. Well actually, the help from this post and finding a web site helped and “I NOW HAVE MY EXTERNAL IP ADDRESS SHOWING ON MY PANEL.”

Laederlappen suggested I use “CommandRunner” but I couldn’t come up with a command that could find my external IP Address until I finally found this web site, “https://www.if-not-true-then-false.com/2010/linux-get-ip-address/”.

I installed a program called, “lynx” by typing, “sudo app-get install lynx”. Then from the Web Page I listed and copied then pasted the command, “lynx --dump http://ipecho.net/plain” in “CommandRunner”and viola’, my external ip address is displayed on the panel..

I want to especially thank all those involved in responding to my question and to solve this request, especially LaederLappen who suggested using CommandRunner and explained how it could be used to work for me..

Now, can someone tell me how to display this post as SOLVED.?
Last edited by PlutoPup on Fri May 26, 2017 12:55 pm, edited 2 times in total.

User avatar
austin.texas
Level 20
Level 20
Posts: 10928
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Display IPAddress in Cinnamon 18.1.?

Postby austin.texas » Fri May 19, 2017 10:13 am

How about in the terminal:

Code: Select all

wget -qO- http://ipecho.net/plain; echo

Or in your browser: http://ipaddress.com/
If you want it on your Desktop, Conky can do it.
Mint 18.1 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Microsoft-free environment since 1996

Linux Linx 2017

Cosmo.
Level 21
Level 21
Posts: 14239
Joined: Sat Dec 06, 2014 7:34 am

Re: Display IPAddress in Cinnamon 18.1.?

Postby Cosmo. » Fri May 19, 2017 10:24 am

What do you want, your public IP (as provided from your Internet provider) or your local IP (behind the router)?

PlutoPup
Level 1
Level 1
Posts: 18
Joined: Tue May 16, 2017 8:45 pm

Re: Display IPAddress in Cinnamon 18.1.?

Postby PlutoPup » Fri May 19, 2017 10:19 pm

I'd like the IP Address that's provided by my ISP to show continuously somewhere that I can see it. There is an Optional Applet for the Panel that comes with Cinnamon 18.1 called, "Location detection + Flag", but it doesn't want to work for me. (https://cinnamon-spices.linuxmint.com/applets/view/141)

This would be perfect if it worked. Just shows a blank space where it is supposed to be on the Panel. I followed the Special Instructions:

Special Requirements:

For the basic facilities the gir1.2-gtop-2.0 library must be installed or the applet will not load. It can be installed by the synaptic package manager or with the terminal command: sudo apt-get install gir1.2-gtop-2.0
For full facilities including notifications, audible alerts and statistics the gir1.2-gtop-2.0 vnstat vnstati zenity sox libsox-fmt-mp3 libraries must be installed. They can be installed by the synaptic package manager or with the terminal command: `sudo apt-get install gir1.2-gtop-2.0 vnstat vnstati zenity sox libsox-fmt-mp3
Cinnamon Version 1.8 or higher as it make comprehensive use of the new Cinnamon Settings Interface for Applets and Desklets.


My IP changes so this would be a huge comfort to have or something like it..

PlutoPup
Level 1
Level 1
Posts: 18
Joined: Tue May 16, 2017 8:45 pm

Re: Display IPAddress in Cinnamon 18.1.?

Postby PlutoPup » Fri May 19, 2017 10:42 pm

I'd like to have "conky showoff'. I had lots of Gadgets on my desktop in Windows. I didn't know they had them for Linux.

It's late so I'll look for them tomorrow.

PlutoPup
Level 1
Level 1
Posts: 18
Joined: Tue May 16, 2017 8:45 pm

Re: Display IPAddress in Cinnamon 18.1.?

Postby PlutoPup » Fri May 19, 2017 10:44 pm

PlutoPup wrote:I'd like to have "conky showoff'. I had lots of Gadgets on my desktop in Windows. I didn't know they had them for Linux.

It's late so I'll look for them tomorrow.
Thanks Austin.Texas!

PlutoPup
Level 1
Level 1
Posts: 18
Joined: Tue May 16, 2017 8:45 pm

Re: Display IPAddress in Cinnamon 18.1.?

Postby PlutoPup » Fri May 19, 2017 10:44 pm

PlutoPup wrote:
PlutoPup wrote:I'd like to have "conky showoff'. I had lots of Gadgets on my desktop in Windows. I didn't know they had them for Linux.

It's late so I'll look for them tomorrow.
Thanks Austin.Texas!

Cosmo.
Level 21
Level 21
Posts: 14239
Joined: Sat Dec 06, 2014 7:34 am

Re: Display IPAddress in Cinnamon 18.1.?

Postby Cosmo. » Sat May 20, 2017 6:51 am

Here is another applet you might try.

User avatar
laederlappen
Level 1
Level 1
Posts: 13
Joined: Fri May 19, 2017 11:34 pm
Location: Germany

Re: Display IPAddress in Cinnamon 18.1.?

Postby laederlappen » Sat May 20, 2017 12:09 pm

You can use the applet "CommandRunner" to pin your current IP address to the panel. (automatic update)

Right Click Panel -> Add Applets -> Available Applets (Online) -> Search "Command" -> Install CommandRunner

CommandRunner shows the output of a simple command on the panel.
For complex commands you have to create a script and hand it to CommandRunner.

If you only have one network interface which connects to the internet and only uses IPv4 without IPv6
you can use the simple command "hostname -I" otherwise write a little script.

Open a new text file and write the following command.
enp6s0 is the name of an interface, to get the name of your interface use the command ifconfig on a terminal.

Code: Select all

/sbin/ifconfig enp6s0 | awk '/inet addr/{print substr($2,6)}'


Save your new file and make it executable - use file manager or terminal (chmod +x file)

Now open the preferences of CommandRunner and tell the applet where your script is. (for example /home/user/.showmyip.sh)
Last edited by laederlappen on Sun May 21, 2017 6:20 am, edited 1 time in total.

PlutoPup
Level 1
Level 1
Posts: 18
Joined: Tue May 16, 2017 8:45 pm

Re: Display IPAddress in Cinnamon 18.1.?

Postby PlutoPup » Sat May 20, 2017 7:11 pm

I was unable to get anything to work and I have found no screenlets or desklets that will install with this error as a result - ''This PPA does not support xenial''

User avatar
piggyuniform
Level 1
Level 1
Posts: 9
Joined: Sat May 20, 2017 10:56 am

Re: Display IPAddress in Cinnamon 18.1.?

Postby piggyuniform » Sat May 20, 2017 9:00 pm

Sometimes the ping command will give you your public IP if you need it:

Code: Select all

ping www.linuxmint.com


Take note that it will give you some extra info too like your Duhh..., ping information and your ISP :)

PlutoPup
Level 1
Level 1
Posts: 18
Joined: Tue May 16, 2017 8:45 pm

Re: Display IPAddress in Cinnamon 18.1.?

Postby PlutoPup » Sat May 20, 2017 11:04 pm

Cosmo:
Location Detection + Flags is what I first started out trying. it doesn't work, just a blank space on the panel. If it worked it would be Perfect..

Austin Texas:
I was not able to get Conky to work. http://www.noobslab.com/2012/07/conky-c ... linux.html - did everything the web site told me to do. Finally got a garbled mess I had to remove.

The other ideas Failed also. Tried to set up "CommandRunner." That might have worked if I knew what I was doing with it.

I keep searching for a way.........

User avatar
laederlappen
Level 1
Level 1
Posts: 13
Joined: Fri May 19, 2017 11:34 pm
Location: Germany

Re: Display IPAddress in Cinnamon 18.1.?

Postby laederlappen » Sun May 21, 2017 12:24 am

PlutoPup wrote:The other ideas Failed also. Tried to set up "CommandRunner." That might have worked if I knew what I was doing with it.
I keep searching for a way.........


If you go back and try a little harder to understand my previous post, I can guarantee you it will work. :)

User avatar
blockhead47
Level 1
Level 1
Posts: 36
Joined: Wed Jun 15, 2016 4:50 pm

Re: Display IPAddress in Cinnamon 18.1.?

Postby blockhead47 » Sun May 21, 2017 9:55 am

This is what I use in my .conkyrc file for conky.

Code: Select all

WAN IP: ${alignr}${exec /usr/bin/curl v4.ident.me}

PlutoPup
Level 1
Level 1
Posts: 18
Joined: Tue May 16, 2017 8:45 pm

Re: Display IPAddress in Cinnamon 18.1.?

Postby PlutoPup » Sun May 21, 2017 9:41 pm

http://www.webupd8.org/2017/02/screenle ... d-for.html

This has solved my Question.

But I also want to get CommandRunner to work. I known it was explained, I'm just not getting it.

PlutoPup
Level 1
Level 1
Posts: 18
Joined: Tue May 16, 2017 8:45 pm

Re: Display IPAddress in Cinnamon 18.1.?

Postby PlutoPup » Mon May 22, 2017 12:08 am

Laederlappen:

Austin.Texas - posted here to me this command to use in the Terminal -
wget -qO- http://ipecho.net/plain; echo

The result is the IP address I want to show on my Panel.
Using “CommandRunner” and the “hostname -I” put in the command box
yields the IP address just like you get from ifconfig. Not what I want on the panel. Lots of numbers.

Do you know and can you tell me how do I get the IP Address I get in the Terminal by putting
- wget -qO- http://ipecho.net/plain; echo – in the Terminal
to show up in CommandRunner.?

This is what I am looking for. I got the Screenlets are working, but, they do not show the IP Address I am wanting to see.

User avatar
laederlappen
Level 1
Level 1
Posts: 13
Joined: Fri May 19, 2017 11:34 pm
Location: Germany

Re: Display IPAddress in Cinnamon 18.1.?

Postby laederlappen » Mon May 22, 2017 8:27 am

When you look at your wget line, you see a foreign server "http://ipecho.net".
You are asking an external source to get your own IP.
On default CommandRunner executes your command every second.
I don't want you to permanently connect to ipecho.net.

The command which I mentioned in my first post, ifconfig, is a basic / essential tool
to configure - and to show informations about your network interfaces.
ifconfig shows the IP that was given from your internet service provider. (I assume your're not behind a NAT)

On a terminal simply run ifconfig and you see a list of your interfaces.
On the left side you see the names of your interfaces, for example enp6s0.
You already know how to get your ip address, so on that list look at the interface which
shows your ip address. This is how you get the name of the interface which you use to connect to the internet.
The name of your interface is important when you execute my command.

ifconfig enp6s0 | awk '/inet addr/{print substr($2,6)}'

replace enp6s0 with the name of your interface.

Now the problem is, you can not easily run this command in CommandRunner (or at least I don't know how), so you have to write a script. After that you only tell CommandRunner the location to your script and it works in CommandRunner.

In short, a script basicly is an executable "text" file. So you have to create a text file and make it executable.

Open your Text Editor, put in this command:

ifconfig enp6s0 | awk '/inet addr/{print substr($2,6)}'

again, replace enp6s0 with the name of your interface.

Now save your file.

Open your File Manager. Right Click on your file -> Properties -> Permissions -> click on "allow executing file as program"

Next, open the preferences of CommandRunner and add the path of your file.
For example if your user name is Joe and you file "showmyip.sh" simply lies in your home directory,
the path would be /home/Joe/showmyip.sh


PS:as mentioned above CommandRunner executes your file every second. This is really unnecessary. You should set a higher interval
in the preferences.

PlutoPup
Level 1
Level 1
Posts: 18
Joined: Tue May 16, 2017 8:45 pm

Re: Display IPAddress in Cinnamon 18.1.?

Postby PlutoPup » Mon May 22, 2017 8:22 pm

Laederlappen:

I think the reason I am having a hard time following your instructions is because:

I was under the impression that there were only two IP addresses, ext – from the isp and
internal – home network.

I was wrong – there is a lo, tun0-00,wlp4s0 (which is my internal ip) and Bcast
all of which I got from ifconfig. There are more. Non of which is the external IP that I a
m looking for as it shows up in a web browser when I ask what’s my IP.

To be clear. Ifconfig does not show that number. So therefor I have nothing to - replace enp6s0 with the name of your interface -

I am so confused why ifconfig does not show that number I get from - wget -qO- http://ipecho.net/plain; echo

PlutoPup
Level 1
Level 1
Posts: 18
Joined: Tue May 16, 2017 8:45 pm

Unable to get correct IP Address with ifconfig

Postby PlutoPup » Fri May 26, 2017 11:47 am

Please explain to me why -

when I type in Firefox search “http://ipecho.net”, I receive back a reply of an IP Address of a number that “ifconfig” does not show..

This does not happen in windows. When I do a search in my browser running Windows to find my IP Address, it is always the same as the results I get from typing “ipconfig” in Run..

In windows I have two IP Addresses; the Home network IP (192.168.?.?) and the IP Address that the ISP gives me.

I am very confused as to why when running Linux Mint Cinnamon 18.1 and I open Firefox and enter the following, “http://ipecho.net” it yields an IP Address that “ifconfig” doesn’t show.

After running Windows on the same ISP as Linux, I can verify to all that the IP Address obtained from “http://ipecho.net” is the correct IP Address and “ifconfig” only yeilds the correct Internal Home network address of 192.167.?.?.
Last edited by karlchen on Fri May 26, 2017 1:05 pm, edited 1 time in total.
Reason: Merged 2 threads about the same question, "(SOLVED) Display IPAddress in Cinnamon 18.1.?" and "Unable to get correct IP Address with ifconfig"

User avatar
MintBean
Level 6
Level 6
Posts: 1142
Joined: Fri Aug 07, 2015 6:54 am

Re: Unable to get correct IP Address with ifconfig

Postby MintBean » Fri May 26, 2017 12:21 pm

ifconfig reports only the adapter's address on the local network, not the external IP assigned by your ISP. The reasoning for this is probably that it's only designed to report information about the configuration of your network card. The public IP, as you understand, is something assigned by an external system run by your ISP and hence is not part of that configuration information.

If you want to find your external ip from the command line, use something like:

Code: Select all

curl ipecho.net/plain; echo
Last edited by MintBean on Fri May 26, 2017 12:58 pm, edited 1 time in total.


Return to “Cinnamon”

Who is online

Users browsing this forum: Gofer83 and 1 guest