#!/bin/bash

# Toggle between two images with genmon.
# Set the genmon plugin update period to 1 second.
# When there is no text displayed and the label is not displayed,
# the plugin cannot be configured by right-clicking on the image.

SECONDS=$(date +%s)
CHOICE=$(( $SECONDS % 2 ))

# Uncomment to display text.
#echo -e "<txt>$SECONDS: $CHOICE</txt>"

if [ $CHOICE -eq "0" ]; then
	echo "<img>/usr/share/icons/gnome/8x8/emblems/emblem-default.png</img>"
	echo "<click>zenity --info --text '$SECONDS: $CHOICE'</click>"
else
	echo "<img>/usr/share/icons/gnome/8x8/emblems/emblem-new.png</img>"
	echo "<click>zenity --info --text '$SECONDS: $CHOICE'</click>"
fi

echo "<tool>choice is $CHOICE</tool>"

exit 0

