From f746aa55e16099bb9ba03ec94b6f4d5c9a87e990 Mon Sep 17 00:00:00 2001 From: Jon Gjengset Date: Fri, 6 Sep 2013 10:57:33 +0100 Subject: Make example standalone --- example.sh | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 example.sh (limited to 'example.sh') diff --git a/example.sh b/example.sh new file mode 100755 index 0000000..9660ddd --- /dev/null +++ b/example.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Set up tray icon +mkfifo /tmp/$$.icon +./mktrayicon /tmp/$$.icon & + +# Manipulate tray icon + +# Click handling +echo "c xterm -e /bin/sh -c 'iwconfig; read'" > /tmp/$$.icon + +# Change the icon and tooltip +for i in none weak ok good excellent; do + echo "i network-wireless-signal-$i-symbolic" > /tmp/$$.icon + echo "t Signal strength: $i" > /tmp/$$.icon + sleep 1 +done + +# Remove tooltip and click handler +echo "c" > /tmp/$$.icon +echo "t" > /tmp/$$.icon + +# Toggle the visibility of the icon for a bit +for i in {1..3}; do + for j in h s; do + echo $j > /tmp/$$.icon + sleep .5s + done +done + +# Remove tray icon +echo "q" > /tmp/$$.icon +rm /tmp/$$.icon -- cgit