Search Members Help

» Welcome Guest
[ Log In :: Register ]

Mini-ITX Boards Sale, Fanless BareBones Mini-ITX, Bootable 1G DSL USBs, 533MHz Fanless PC <-- SALE $200 each!
Get The Official Damn Small Linux Book. DSL Market , Great VPS hosting provided by Tektonic
 

[ Track this topic :: Email this topic :: Print this topic ]

reply to topic new topic new poll
Topic: HowTo: Show IP of network interfaces on desktop, in torsmo (for DSL 2.1)< Next Oldest | Next Newest >
ruserious Offline





Group: Members
Posts: 23
Joined: Dec. 2005
Posted: Dec. 15 2005,12:29 QUOTE

torsmo is the system monitor on your desktop (starting with DSL 2.1). It can be customized to show plenty of additional stuff, I'll show how to customize it so it displays the IP(s) of your networkinterfaces.

Granted not very exciting, but I find it helpful, especially when I have to remote administer friends' DSL installs via ssh.

1. First we create a little shell script that outputs the IP for a given interface. Create a file ~/.myip with this content:
Code Sample

#!/bin/sh
ifconfig  $1 2>&1 | awk '/inet/ { gsub(/[a-z:[:space:]]/,"",$2);printf $2}'


2. chmod 775 ~/.myip to make it executable

3. Test if it's working with: ~/.myip eth0 or if you are on a PPPoE connection try ~/.myip ppp0
This should return one IP-Adress and the shell-prompt should appear right next to it.

4. If the above is ok, you can edit your torsmo-config file  ~/.torsmorc and add the output of this script to it. For example find the line that reads:
Code Sample

${color grey}Uptime$color $uptime

and replace it with:
Code Sample

${color grey}Uptime$color $uptime    IP: ${execi 60 ~/.myip eth0}

execi 60 will refresh the value every 60 seconds. Also we are passing the name of the interface, so if you wanted to, you could show multiple interfaces.

5. If you want to immediately see the changes you can pkill torsmo and restart it torsmo&
Back to top
Profile PM 
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: Dec. 15 2005,18:04 QUOTE

Torsmo sounds like a really cool program that can be customized in endless ways if you think creatively like ruserious here.

Thank you for introducing me to both the specific tweak and also for opening my eyes a little more to the concept of tweaking this program.
Back to top
Profile PM 
roberts Offline





Group: Members
Posts: 4983
Joined: Oct. 2003
Posted: Dec. 15 2005,19:32 QUOTE

dsl-2.1RC2 already has such a script.
Look for .torsmo_ip and the execi in the .torsmorc
See change log for dsl-2.1RC2.

But a good and thorough explaination.


Edited by roberts on Dec. 15 2005,19:34
Back to top
Profile PM WEB 
ruserious Offline





Group: Members
Posts: 23
Joined: Dec. 2005
Posted: Dec. 15 2005,21:39 QUOTE

Oh, man! I feel officially stupid now. I had downloaded RC1, but hadn't had the time to play with it. And then I downloaded RC2, and when I finally had time to experiment, I was using RC1 thinking I was using RC2... :laugh:

Ok, give me some time, I'll find some way to give back to this great community. ;)
Back to top
Profile PM 
cbagger01 Offline





Group: Members
Posts: 4264
Joined: Oct. 2003
Posted: Dec. 17 2005,03:53 QUOTE

You already have.

Just because it has already been done does not invalidate the effort, especially when it shows the other forum readers "how to do it" in concept.
Back to top
Profile PM 
4 replies since Dec. 15 2005,12:29 < Next Oldest | Next Newest >

[ Track this topic :: Email this topic :: Print this topic ]

 
reply to topic new topic new poll
Quick Reply: HowTo: Show IP of network interfaces on desktop

Do you wish to enable your signature for this post?
Do you wish to enable emoticons for this post?
Track this topic
View All Emoticons
View iB Code