[K12OSN] bash script: generate icewm menus
Peter Hartmann
ascensiontech at gmail.com
Tue Oct 28 15:09:01 UTC 2008
icewm-menu-gnome2 never satisfied me because it leaves out all of the
kde applications. Then I discovered icewm-xdg-menu which is great
except it has a tendency to hang the users session for 20 seconds
after authentication. I put together this script that uses
icewm-xdg-menu to output a formatted file ready to be added to
/usr/share/icewm/menu. I hope some other icewm users find this
usefull.
-Peter
http://hartmanncomputer.com/generate-ice-menu
#!/bin/bash
Today="`date +%F`"
#This will generate a formatted file that can me added to /usr/share/icewm/menu.
echo "menu Applications folder {" > icemenu-$Today
icewm-xdg-menu | awk -F / '{print $1}' | grep menu | sed 's/prog//' |
while read line
do
echo $line { >> icemenu-$Today
# Carefull, sometimes the category names don't agree.
# Run icewm-xdg-menu on the command line and make sure that
# the second word is the same as the word after "--root-folder".
# If not, add more sed statements in a similar fashion.
name=$( echo "$line" | awk -F'"' '{print $2}'| sed -e s'/SMART\
Board\ Software/smarttech-software/' -e s'/Sound\ &\
Video/Multimedia/' -e s'/Programming/Development/' )
/usr/bin/icewm-xdg-menu --root-folder "$name" >> icemenu-$Today
echo } >> icemenu-$Today
done
echo } >> icemenu-$Today
More information about the K12OSN
mailing list