You are not logged in.

#1 2009-08-02 18:08:24

Mr.Cat
Member
Registered: 2008-09-27
Posts: 79

Netcfg openbox menu

I've started tweaking my openbox box and the first thing to do was a simple script to run netcfg from openbox menu. You can grab it here: http://gist.github.com/160147. It can only activate an inactive profile or deactivate an active one (it's enough for me).

And I've encountered a strange issue. You may notice that I use xterm for desplaying netcfg output and in case of success xterm waits for 2 seconds to close. Without that after putting the profile down from menu subsequent calls to netcfg may claim that the corresponding interface is busy and fail. Even with that delay often subsequent calls to netcfg will complain of the interface being busy but will succeed. So, what am I doing wrong? What is the safe way to run netcfg in my case?

Offline

#2 2009-08-04 11:02:44

Mr.Cat
Member
Registered: 2008-09-27
Posts: 79

Re: Netcfg openbox menu

Btw, doesn't netcfg call something in background before returning success? Something, that might be killed by bash when xterm is closed?

Offline

#3 2009-08-06 20:36:20

Mr.Cat
Member
Registered: 2008-09-27
Posts: 79

Re: Netcfg openbox menu

Well, I hope, that was not my fault: http://bbs.archlinux.org/viewtopic.php?pid=596519

UPD: Still, I should try something like

bash -c ". /usr/lib/network/network; . /etc/rc.d/functions; profile_up ...

UPD: Just the same issue with the above command. And netcfg-tray often hangs the interface too.

Last edited by Mr.Cat (2009-08-06 23:04:26)

Offline

#4 2009-08-07 07:20:27

jelly
Administrator
From: /dev/null
Registered: 2008-06-10
Posts: 714

Re: Netcfg openbox menu

how are you going to handle the root permissions  to start netcfg ? Using gksu or gksudo ?

Offline

#5 2009-08-07 22:21:04

Mr.Cat
Member
Registered: 2008-09-27
Posts: 79

Re: Netcfg openbox menu

You may grab the new version here: http://bitbucket.org/mr_cat/openbox-netcfg
It can be configured via editing appropriate variables in .py files.

Offline

#6 2009-08-08 00:34:55

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Netcfg openbox menu

You could re-use the netcfg-tray-helper app in netcfg-tray. Feel free to copy it and modify it as suits you to include in your menu.

Then with dzen2 you can run for example:

output="$(netcfg-tray-helper up ethernet)"
echo $output|dzen2 -p 10

Last edited by iphitus (2009-08-08 00:35:21)

Offline

#7 2009-08-08 01:18:15

Shapeshifter
Member
Registered: 2008-03-11
Posts: 230

Re: Netcfg openbox menu

Can you elaborate? Like, post a screenshot of it, please?

Offline

#8 2009-08-08 16:00:46

Mr.Cat
Member
Registered: 2008-09-27
Posts: 79

Re: Netcfg openbox menu

Iphitus, thanks, I've used netcfg-tray as a "cheat-sheet", maybe, I should take a more close look at it.

Shapeshifter: The menu itself is just a list of netcfg profiles with those that are currently active marked. But I've posted a couple of shots on a project's bitbucket wiki page: http://bitbucket.org/mr_cat/openbox-netcfg/wiki/

Last edited by Mr.Cat (2009-08-08 16:17:36)

Offline

#9 2009-08-08 16:09:06

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Netcfg openbox menu

Mr. Cat, looks nice, I'm gonna try this out. Any way you could move out the variables to a separate configuration file? Would be easier to keep track of upgrades too, that way.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

#10 2009-08-08 16:23:07

Mr.Cat
Member
Registered: 2008-09-27
Posts: 79

Re: Netcfg openbox menu

Yes. A separate config file is on my todo list.

Offline

#11 2009-08-08 16:23:39

.:B:.
Forum Fellow
Registered: 2006-11-26
Posts: 5,819
Website

Re: Netcfg openbox menu

Cool smile.


Got Leenucks? :: Arch: Power in simplicity :: Get Counted! Registered Linux User #392717 :: Blog thingy

Offline

Board footer

Powered by FluxBB