text tools started in the background and gnome

Issues related to applications and software problems
Posts: 62
Joined: 2011/10/05 08:37:32

text tools started in the background and gnome

Postby centek1 » 2012/02/05 19:11:30

I have a vpn client which is old school text application - just asks for credentials, makes vpn connection and goes to the background.
Another tool has to be executed (simple sh script) to stop the vpn app - the script just looks for the vpn app pid
and kills it...

Everything works as expected, dont have issues to that... but yesterday I decided to put a shortcut to it on gnome desktop...

I want to have such behaviour:

1. click on vpn shortcut on desctop
2. vpn app starts, it asks for credentials in normal way, in text terminal
3. once correctly provided credentials goes to background, text terminal is closed - I am vpn connected
4. automatically there should be an icon added to system tray area, which i can double click to disconnect the vpn

how to do that? Would preffer not fancy low level programming in ASM or C...

I think everybody understand what is the need but
to be more descriptive:

i assume I should do a some kind of script started when clicked on the desctop vpn shortcut i prepared -
which in pseudo-code should look like this:

01 start_vpn_script # goes to the background fi ok, or exit 1 if fail
02 if ret == 0 then create systray icon /shortcut to the stop_vpn_script

when i click the systray icon/shortcut - the stop_Vpn_script is started and actually kills the start_vpn_script background job, and exits...

note - both start_vpn and stop_vpn scripts are available...

hope somebody has smart solution...

Posts: 62
Joined: 2011/10/05 08:37:32

Re: text tools started in the background and gnome

Postby centek1 » 2012/02/08 20:11:09


Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America

text tools started in the background and gnome

Postby pschaff » 2012/02/08 20:20:07

Readme First:

12. What to do if no one answers

Please wait for at least 24 hours. The volunteers on this forum live all over the world. If it's day time where you live, it's going to be night time somewhere else and the person able to answer your question may be sleeping, so give everyone a chance to read your question. Be sure that you have refreshed the page if you left it open - new messages do not cause an auto-refresh. Also, be sure to check your Notification Method - at the bottom of each page when logged in - as it defaults to "Private Message", not email as many people seem to expect.

If after 24 hours you haven't received any answers, then you may [color=0000ff]bump your thread by posting more information. By more information, we mean what you have tried during the last 24 hours to fix the problem. You have been trying to fix your problem, haven't you and not just waiting for someone else to fix it for you?[/color]

For text-mode things I generally just use text-mode. One can certainly create an icon that runs a script in a terminal and exits.

I have no idea how to do what you want with the systray part. You could just create another desktop icon for part 2.