WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Add an icon to launch a script to wbar  (Read 2404 times)

Offline magnus

  • Newbie
  • *
  • Posts: 2
Add an icon to launch a script to wbar
« on: November 19, 2010, 07:53:56 AM »
Hi all,
excuse me for my english but I'm Italian...  :)

I tried to add a shortcut to wbar but the latter don't work.

I do this in tce.icons:

i: /usr/local/pixmaps/appbrowser.png
t: Get IP
c: exec ifconfig

I can see the icon but if I click on it command ifconfig isn't launched.

Why?

Thanks!

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: Add an icon to launch a script to wbar
« Reply #1 on: November 19, 2010, 03:30:35 PM »
ifconfig is launched but:
- if you want to see it in an aterm, you need to run it in that (i.e. aterm -e)
- it is probably done very quickly (if using an aterm, you will probably need to pause at the end)

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: Add an icon to launch a script to wbar
« Reply #2 on: November 19, 2010, 05:20:01 PM »
Umm, how would you use 'exec ifconfig' to launch a script when 'ifconfig' is an existing executable in PATH (which without any additional option would produce informational output)?
Do I miss something here?   ???
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: Add an icon to launch a script to wbar
« Reply #3 on: November 19, 2010, 06:11:59 PM »
If the purpose is for a GUI to display IP with wbar you could do something like this:
Code: [Select]
i: /usr/share/pixmaps/appbrowser.png                             
t: GetIP                                                         
c: exec  popup $(ifconfig eth0 | awk '/inet addr/{print "ip" $2}')
10+ Years Contributing to Linux Open Source Projects.