# $Id$ # todo wallpaper? # what does this plugin provide? provide fluxbox help_fluxbox_menuitem() { mecho "get fluxbox.menuitem" mecho " Shows all custom added menuitems of fluxbox." mecho mecho "set fluxbox.menuitem [action] [name] [exec] [workdir] [icon]" mecho " Adds or deletes a fluxbox menu entry." mecho " Actions:" mecho " add - adds a menuitem" mecho " del - deletes a menuitem" mecho 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" mecho mecho " If no [name] given, all entries will be deleted." } # set_fluxbox_menuitem $name $exec $workdir $icon set_fluxbox_menuitem() { local action="${CLASS_ARGV[0]}" local name="${CLASS_ARGV[1]}" local exec="${CLASS_ARGV[2]}" local workdir="${CLASS_ARGV[3]}" local icon="${CLASS_ARGV[4]}" local CONFIG [[ -z ${action} ]] && help_fluxbox_menuitem && return 1 case "${action}" in add) [[ -z ${name} ]] && help_fluxbox_menuitem && return 1 [[ -z ${exec} ]] && help_fluxbox_menuitem && return 1 ${MCORE_LIBDIR}/fluxbox-menuitem --add --name "${name}" --exec "${exec}" ;; del) if [[ -n ${name} ]] then ${MCORE_LIBDIR}/fluxbox-menuitem --del --name "${name}" else # delete all items ${MCORE_LIBDIR}/fluxbox-menuitem --del fi ;; *) help_fluxbox_menuitem && return 1 ;; esac # rebuild the menu now ${MCORE_LIBDIR}/fluxbox-rebuild-menu } # get_fluxbox_menuitem get_fluxbox_menuitem() { ${MCORE_LIBDIR}/fluxbox-menuitem --print } help_fluxbox_autostart() { mecho "get fluxbox.autostart" mecho " Shows all custom added autostarts of fluxbox." mecho mecho "set fluxbox.autostart [action] [name] [exec]" mecho " Adds or deletes a fluxbox autostart entry." mecho " Actions:" mecho " add - adds an autostart entry" mecho " del - deletes an autostart entry" mecho mecho " name - autostart entry name" mecho " exec - executable to start" mecho mecho " If no [name] given, all entries will be deleted." } # set_fluxbox_autostart $name $exec set_fluxbox_autostart() { local action="${CLASS_ARGV[0]}" local name="${CLASS_ARGV[1]}" local exec="${CLASS_ARGV[2]}" local CONFIG [[ -z ${action} ]] && help_fluxbox_autostart && return 1 case "${action}" in add) [[ -z ${name} ]] && help_fluxbox_autostart && return 1 [[ -z ${exec} ]] && help_fluxbox_autostart && return 1 ${MCORE_LIBDIR}/fluxbox-autostart --add --name "${name}" --exec "${exec}" ;; del) if [[ -n ${name} ]] then ${MCORE_LIBDIR}/fluxbox-autostart --del --name "${name}" else # delete all items ${MCORE_LIBDIR}/fluxbox-autostart --del fi ;; *) help_fluxbox_autostart && return 1 ;; esac # rebuild the autostart now ${MCORE_LIBDIR}/fluxbox-rebuild-autostart } # get_fluxbox_autostart get_fluxbox_autostart() { ${MCORE_LIBDIR}/fluxbox-autostart --print } help_fluxbox_theme() { mecho "get fluxbox.theme [method]" mecho " Displays current installed or system-wide available themes." mecho " Methods:" mecho " system - shows systemwide available themes" mecho " current - shows current selected theme" mecho mecho "set fluxbox.theme [theme]" mecho " Sets a default theme for fluxbox." } set_fluxbox_theme() { local theme="${CLASS_ARGV[0]}" local stylesdir="@@DATADIR@@/fluxbox/styles" [[ -z ${theme} ]] && help_fluxbox_theme && return 1 [[ ! -x $(type -P fluxbox-remote) ]] && eecho "fluxbox-remote missing! Aborted" && return 1 if [[ -e ${stylesdir}/${theme} ]] then x11runas "fluxbox-remote 'SetStyle ${stylesdir}/${theme}'" else eecho "Theme '${theme}' does not exist!" fi } get_fluxbox_theme() { local method="${CLASS_ARGV[0]}" local stylesdir="@@DATADIR@@/fluxbox/styles" local value local i [[ -z ${method} ]] && help_fluxbox_theme && return 1 case "${method}" in system) list_files_in_directory -type d -mindepth 1 -maxdepth 1 ${MROOT}/${stylesdir} ;; current) value=$(grep -i '^session.stylefile' ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/init | sed 's:.*/\(.*\):\1:') rvecho "${value}" ;; *) help_fluxbox_theme && return 1 ;; esac }