#!/bin/bash
#
# VL Modifications for IceWM. Use xdgmenumaker to create the menu.

# run the menu maker and tweak the output to a temp file
xdgmenumaker -i -f icewm --no-submenu |sed '/ prog "" _none_ /d' > /tmp/$USER-icewm-appmenu
# remove progams listed in ~/.icewm/menu-excludes
cat ~/.icewm/menu-excludes |sed '/^#/d'|sed 's/^ *//g'|sed 's/ *$//g'| while read line;do echo excluding $line;sed -i /"$line"/d /tmp/$USER-icewm-appmenu;done
# move file to home dir
mv /tmp/$USER-icewm-appmenu $HOME/.icewm/appmenu
# tell user it is done
if [ ! "$1" == "quiet" ];then zenity --info --text "Menu created" --title "xdgmenu" --timeout 1;fi
