You are not logged in.

#1 2015-07-13 02:53:55

j33205
Member
Registered: 2015-06-28
Posts: 38

[SOLVED] Running OpenVPN through the OpenBox right-click menu

Hello. I'm kinda trying to avoid using the Network Manager OpenVPN GUI since I haven't really had good experiences with it in the past.  I want to be able to use the command line execution of OpenVPN, but I want to be able to access it "easily" through the OpenBox right-click menu. Is there a way to accomplish this? Basically, add an item in the menu.xml and sudo execute openvpn in some way such that it loads the .ovpn file automatically but still prompts for the vpn login info and then maybe throws the openvpn output to the screen (if I can make it that far, then I don't really care if the new terminal windows closes again or not, just as long as the vpn is still connected).  Right now I'm trying to call Terminator with the right-click menu:

...<command>
   terminator -x sudo openvpn FILE
   </command>...

It opens Terminator and prompts for the sudo password but then closes the window without apparently doing anything else. Is there a way to avoid that?

I don't know, the more I think about it the more impossible it sounds. If there isn't a clear answer to this, is there some other better implementation of easily running OpenVPN?

Last edited by j33205 (2015-07-15 01:11:24)

Offline

#2 2015-07-13 17:35:25

ijanos
Member
From: Budapest, Hungary
Registered: 2008-03-30
Posts: 443

Re: [SOLVED] Running OpenVPN through the OpenBox right-click menu

Hi!

I suggest to read about pipemenus. With them you can write a dynamic menu for openbox and it can indicate the actual status of the vpn connection.
Just write a script that outputs xml. You can use the zenity --password command to query a password.


http://openbox.org/wiki/Openbox:Pipemenus
http://openbox.org/wiki/Help:Menus#Pipe_menus


But are you sure you don't want to use NetworkManager? Did you try it? I've been using it for years with openvpn and it is rock solid and super easy, just a click and it is done.

Offline

#3 2015-07-13 22:06:59

j33205
Member
Registered: 2015-06-28
Posts: 38

Re: [SOLVED] Running OpenVPN through the OpenBox right-click menu

ijanos, I've already read and have a pretty good grasp on pipemenus and that's what I have currently trying to run this. I'm not sure Zenity seems like a viable enough option, especially since I don't have Gnome. I've tried using Network Manager in the past, though not on Arch, and I can't think of a single time that it successfully connected to a VPN through OpenVPN or PPTP. But I think I'll give it try.

Offline

#4 2015-07-13 22:22:43

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [SOLVED] Running OpenVPN through the OpenBox right-click menu

Does running "terminator -x sudo openvpn FILE" from terminal window work as expected, or do you get the same behavior?

you could try if something like "terminator -x /bin/sh sudo openvpn FILE" worked any better.

Offline

#5 2015-07-13 23:27:08

j33205
Member
Registered: 2015-06-28
Posts: 38

Re: [SOLVED] Running OpenVPN through the OpenBox right-click menu

ooo, I tried running the same command that I'm trying to run from menu.xml in Terminator and I got a different result. By running

terminator -x sudo openvpn FILE

from a Terminator session I get prompted for sudo passwd in another Terminator session and it proceeds to run OpenVPN (prompt for VPN login and all of the resulting output and the screen stays once it's done)...

UPDATE: it turns out that that command actually works in menu.xml and has the same functionality as the one I did manually.  Apparently in the script file I was trying to reference a file in the local directory (where I had 'cd'ed to in the bash script for the pipemenu) and I forgot that the command I was passing via 'echo' to OpenBox contained no information of the directory change. Now it works, with an absolute file reference. Stupid mistake.

Also ijanos, I'm still trying to use NetworkManager, but I'm having trouble installing it. I'm reading the wiki and I have the base package, the openvpn package, and (since I have OpenBox WITHOUT Gnome) I also have "xfce4-notifyd" and "gnome-icon-theme". My problem is accessing the system tray applet / NM GUI. (Btw I have Tint2 alongside OpenBox) My problem is getting the applet/GUI to run so I can easily access the openvpn plugin, and I don't seem to have

nm-applet

as referenced in the wiki, I don't know what it is and I can't run it since it was not found. Is it supposed to be apart of the NM packages? Any suggestions?

Offline

#6 2015-07-14 00:57:10

ooo
Member
Registered: 2013-04-10
Posts: 1,638

Re: [SOLVED] Running OpenVPN through the OpenBox right-click menu

you need to install network-manager-applet from official repositories for nm-applet.

Offline

#7 2015-07-14 03:14:07

j33205
Member
Registered: 2015-06-28
Posts: 38

Re: [SOLVED] Running OpenVPN through the OpenBox right-click menu

Thank you ooo, skipped that part about Gnome setup.

And I remembered by I didn't use NM in the first place, it doesn't support .ovpn files, and that's really annoying considering that the command line OpenVPN does very easily. I suppose I could try to extract the certificate info from the ovpn file but I'd rather not. Looking into gopenvpn, but sounds sketchy.

Offline

Board footer

Powered by FluxBB