Zenity for appindicators
Tools like zenity and yad can easily make simple scripts completely graphical, by providing many GUI elements easily accessible by command line.
However, none of them supports ubuntu appindicators (yet).
This little script does just that.
it's in the attachements
cappind.py is the actual tool.
gapping.py is a simple zenity based menu creator, it creates basic appindicator shell scripts.
Also, a few example scripts can be found in the examples page
How to use
The tool takes input from stdin as multiple lines with the format
an empty entry meaning a separator
The implied menu structure is automatically created (so no need for a hierarchical input, each line specifies the whole path).
When an entry is selected by the user, the whole path is printed to stdout, which must be piped to something that will execute the actual menu actions.
By default, the menu will close when an entry is selected, the -p flag can make the menu persistant, adding a "
" element at the end (the suit menu doesnt print anything, it just closes the program (and its stdout :) ).
Theres also the
option to choose the display icon, this should be the name of an icon from the theme - not a path to an image file, default is "
" (cause this is invoked from a script),
to add a label next to the indicator icon (which i wouldn't recommend since a lot of label indicators would quickly fill the top panel),
to specify a timeout in seconds (the indicator will disappear after that).
- Simple menu example, notice how "
_" will underline the next character
) | ./cappind.py --persist | while read s; do
case "$s" in
_Aa ) echo hello ;;
b:1 ) echo big ;;
b:2 ) echo small ;;
c ) echo world ;;
- same command (yes that was a single shell command) without the