- supports submenus and separators
- you can specify a custom icon
- persistent mode or quit after executing command
For now the tool doesn't support specifying a timeout after which it should quit, but this feature might be added in the future.
The script takes input from stdin and when you select an entry, the whole path is printed to stdout. Here's working example that will create an AppIndicator for Y PPA Manager:
echo "Add Advanced List Search Settings" | ./cappind.py -p -i y-ppa-manager | while read s; do case "$s" in Add ) y-ppa-cmd add ;; Advanced ) y-ppa-cmd advanced ;; List ) y-ppa-cmd list ;; Search ) y-ppa-cmd search ;; Settings ) y-ppa-cmd settings ;; esac done
- "-p" makes the indicator persistent and adds a quit menu item at the end - without it, the indicator quits after executing the select action.
- "-i" specifies an icon from the current icon theme (don't use an exact path to an icon, it won't work. Just enter an icon name).
Here's another example, this time with submenus (just for the sake of this example) and a separator above the "Media" menu item that creates an AppIndicator for Nautilus (for opening Downloads, Music folders, etc.):
echo "Home Folder Documents Downloads Pictures Media:Music Media:Videos" | ./cappind.py -p -i nautilus | sed -u 's/Media://g' | while read s; do case "$s" in Home* ) nautilus ;; Documents ) nautilus ~/Documents/ ;; Downloads ) nautilus ~/Downloads/ ;; Pictures ) nautilus ~/Pictures/ ;; Music ) nautilus ~/Music/ ;; Videos ) nautilus ~/Videos/ ;; esac done
More examples and download
Thanks to Réda for the tip!