Joined: 05 May 2004
|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:
if $(ip link show | grep -q ",UP>")
if $(ip link show | grep -q tun0)
echo "<click>/usr/bin/sudo /etc/init.d/openvpn stop</click>"
echo "<click>/usr/bin/sudo /etc/init.d/openvpn start</click>"
The icons used were things already installed and easy to explain to my wife.
.sigs waste space and bandwidth