VaryOnApplet is a pushbutton process-control applet for Gnome.
After VaryOnApplet is installed, you will need to logout and log back into Gnome, or you can force the panel to reload by killing it:
As soon as the panel recovers, you can add the VaryOnApplet to it by right clicking on the panel and selecting Add: Utility: VaryOn Applet.
Initially, it will look like a red "X" Checkbox.
To make it do something, you will need to right click on it and set Preferences, as follows:
Applet Title is the text to show beside the checkbox on the panel.
Start and Stop are shell commands to bring up and take down the process that you want VaryOnApplet to control. When you left click on it, the applet plays the role of a toggle to vary the process on and off. Note: VaryOnApplet won't try to bring a process down if it doesn't believe the process is running.
For example, in my Beyond Linux from Scratch (BLFS) configuration:
... starts the *dhcpcd* process, which opens my DSL line. Thus, my Applet Title is "DSL," and my Start Command is as above. My Stop Command is "/etc/rc.d/init.d/network stop."
In VaryOnApplet's Preferences, Lock is the name of a file (any file) created by the process.
Now, I happen to know that, as soon as *dhcpcd* starts, it creates a file called /var/run/dhcpcd-eth0.pid on my machine, so that's what I put in Lock File.
Check is to confirm that the Lock File belongs to the Process.
If Check is False, then, whenever Lock File is present, VaryOnApplet changes from a red "X" to a green "V". Every three seconds, VaryOnApplet makes sure the Lock File is still there. No further checks are done, and this is fine so long as the process doesn't crash leaving the Lock File behind.
Process Name is (not) always obvious. You can find out what it should be. First *cat* out the contents of Lock File. If it is a process ID (pid) number, then you can print the name of the process that "owns" it like this:
ps --pid 999 --format ucmd --no-headers
... where 999 is the process ID.
In VaryOnApplet's Preferences, set Process Name to the Lock File owner. In my case, this is "dhcpcd," but I already knew that. Now, if you want VaryOnApplet continually to be sure that the Lock File owner is alive, set Check Process.
Of course, VaryOnApplet is a general-purpose toggle. It doesn't insist that there be any particular content in the Lock File if you don't set Check Process. Thus, there doesn't have to be a running process that owns it. There doesn't have to be any special relationship between the presence of the Lock File and the Start and Stop Commands. There don't have to be any Start/Stop commands, for that matter.
There doesn't even have to be a Lock File. Then VaryOnApplet will just sit there looking like a red "X."
· GTK+ version 2.2.x
· Python 2.3
What's New in This Release:
· Accommodate name changes in the gnomeapplet module.