depontius Advocate
Joined: 05 May 2004 Posts: 3509
|
Posted: Sat Feb 13, 2016 8:13 pm Post subject: XFCE4 "toggle applet" [SOLVED] |
|
|
Is anyone aware of a "toggle applet" for xfce4?
Picture a "stateful button" that has two icons. Normally, you see Icon-A, and pressing the button performs Action-A. Also, when you press the button and perform Action-A, it changes the button to Icon-B. At that point, pressing the button performs Action-B and changes the icon back to Icon-A.
In other words, a push-on, push-off switch.
I'm thinking in terms of an easy interface for my wife to start and stop OpenVPN on our laptop. I don't (won't?) run NetworkManager, right now I'm handling networking just using dhcpcd and dhcpcd-ui, which doesn't handle VPNs. (Nor does WICD.)
I found "xfce4-extra/xfce4-genmon-plugin". It's not precisely what I'd like, but it's capable of doing what I need - really what my wife needs. It's a monitor, so it's a bit inefficient, but it works. Here's the script I attach to it:
Code: | #!/bin/bash
if $(ip link show | grep -q ",UP>")
then
if $(ip link show | grep -q tun0)
then
echo "<img>/usr/share/icons/hicolor/48x48/apps/gcr-key-pair.png</img>"
echo "<click>/usr/bin/sudo /etc/init.d/openvpn stop</click>"
else
echo "<img>/usr/share/icons/hicolor/48x48/apps/gcr-key.png</img>"
echo "<click>/usr/bin/sudo /etc/init.d/openvpn start</click>"
fi
else
echo "<img>/usr/share/icons/hicolor/48x48/apps/gcr-gnupg.png</img>"
echo "<click>/bin/true</click>"
fi |
The icons used were things already installed and easy to explain to my wife. _________________ .sigs waste space and bandwidth |
|