# $Id$ # what does this plugin provide? provide fluxbox # helper helper_session_rebuild_fluxbox_menu() { :> ${SETTINGSPATH}/fluxbox/alxmenu for file in ${SETTINGSPATH}/fluxbox/menu/* do echo "[include] (${file})" >> ${SETTINGSPATH}/fluxbox/alxmenu done # rebuild the user menu too atm cat ${ALX_SKELETONS}/fluxbox/menu.header > ${ALX_UNPRIV_HOME}/.fluxbox/menu # now fix it with proper messages :P local ver="$(< /etc/mageversion)" sed -i "s:@CHANGEME@:tinyALX-${ver} #${ALX_SERIAL}:g" ${ALX_UNPRIV_HOME}/.fluxbox/menu # add a newline (maybe there is no crlf in the header) echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu # our specific include echo "[include] (${SETTINGSPATH}/fluxbox/alxmenu)" >> ${ALX_UNPRIV_HOME}/.fluxbox/menu # fluxbox menu footer cat ${ALX_SKELETONS}/fluxbox/menu.footer >> ${ALX_UNPRIV_HOME}/.fluxbox/menu # add a newline (maybe there is no crlf in the footer) echo >> ${ALX_UNPRIV_HOME}/.fluxbox/menu } help_session_addmenuitem() { mecho "set session.addmenuitem [name] [exec] [workdir] [icon]" mecho " adds a fluxbox menu entry" mecho " name - menu entry name" mecho " exec - executable to start" mecho " workdir - working directory for the executable - optional" mecho " icon - pixmap icon of the entry - optional" } # set_session_addmenuitem $name $exec $workdir $icon set_session_addmenuitem() { local name="$1" local exec="$2" local workdir="$3" local icon="$4" echo "[exec] (${name}) {${exec}}" > ${SETTINGSPATH}/fluxbox/menu/${name} # rebuild the menu now helper_session_rebuild_fluxbox_menu } help_session_delmenuitem() { mecho "set session.delmenuitem [name]" mecho " deletes a fluxbox menu entry" mecho " name - menu entry name" } # set_session_delmenuitem [$name] set_session_delmenuitem() { local name="$1" if [[ -f ${SETTINGSPATH}/fluxbox/menu/${name} ]] then rm ${SETTINGSPATH}/fluxbox/menu/${name} elif [[ -z ${name} ]] then # delete all items rm ${SETTINGSPATH}/fluxbox/menu/* fi # rebuild the menu now helper_session_rebuild_fluxbox_menu }