5 |
# what does this plugin provide? |
# what does this plugin provide? |
6 |
provide fluxbox |
provide fluxbox |
7 |
|
|
|
# helper |
|
|
helper_rebuild_fluxbox_menu() |
|
|
{ |
|
|
local MMINCLUDE |
|
|
local CONFIG |
|
|
local file |
|
|
local ver |
|
|
|
|
|
MMINCLUDE="${MCORE_CONFIG_PATH}/fluxbox/mcore-menu-include" |
|
|
CONFIG="${MROOT}/${MMINCLUDE}" |
|
|
clearconfig |
|
|
for file in $(find ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu -type f) |
|
|
do |
|
|
[[ ! -z ${MROOT} ]] && file=$(echo ${file} | sed "s:${MROOT}::") |
|
|
addconfig "[include] (${file})" |
|
|
done |
|
|
|
|
|
# rebuild the user menu too atm |
|
|
CONFIG="${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/menu" |
|
|
if [[ ! -d ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox ]] |
|
|
then |
|
|
install -o ${MCORE_UNPRIV_USER} -o ${MCORE_UNPRIV_GROUP} -d ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox |
|
|
fi |
|
|
|
|
|
# fluxbox menu header |
|
|
clearconfig |
|
|
ver="$(< ${MROOT}/etc/mageversion)" |
|
|
addconfig "[begin] (${MCORE_DISTRIBUTION}-${ver} #${MCORE_SERIAL})" |
|
|
|
|
|
# add a newline (maybe there is no crlf in the header) |
|
|
addconfig |
|
|
|
|
|
# our specific menu include |
|
|
addconfig "[include] (${MMINCLUDE})" |
|
|
|
|
|
# fluxbox menu footer |
|
|
addconfig '[separator]' |
|
|
addconfig '[exit] (Abmelden)' |
|
|
addconfig '[exec] (Neustarten) {sudo /sbin/reboot}' |
|
|
addconfig '[exec] (Herunterfahren) {sudo /sbin/halt}' |
|
|
addconfig '[end]' |
|
|
|
|
|
# add a newline (maybe there is no crlf in the footer) |
|
|
addconfig |
|
|
} |
|
|
|
|
|
helper_rebuild_fluxbox_autostart() |
|
|
{ |
|
|
local CONFIG |
|
|
|
|
|
CONFIG="${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/apps" |
|
|
clearconfig |
|
|
for file in $(find ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/autostart -type f) |
|
|
do |
|
|
addconfig "$(< ${file})" |
|
|
done |
|
|
|
|
|
# add a newline (maybe there is no crlf in the footer) |
|
|
addconfig |
|
|
} |
|
|
|
|
8 |
help_fluxbox_menuitem() |
help_fluxbox_menuitem() |
9 |
{ |
{ |
10 |
mecho "get fluxbox.menuitem" |
mecho "get fluxbox.menuitem" |
27 |
# set_fluxbox_menuitem $name $exec $workdir $icon |
# set_fluxbox_menuitem $name $exec $workdir $icon |
28 |
set_fluxbox_menuitem() |
set_fluxbox_menuitem() |
29 |
{ |
{ |
30 |
local action="$1" |
local action="${CLASS_ARGV[0]}" |
31 |
local name="$2" |
local name="${CLASS_ARGV[1]}" |
32 |
local exec="$3" |
local exec="${CLASS_ARGV[2]}" |
33 |
local workdir="$4" |
local workdir="${CLASS_ARGV[3]}" |
34 |
local icon="$5" |
local icon="${CLASS_ARGV[4]}" |
35 |
local CONFIG |
local CONFIG |
36 |
|
|
37 |
[[ -z ${action} ]] && help_fluxbox_menuitem && return 1 |
[[ -z ${action} ]] && help_fluxbox_menuitem && return 1 |
60 |
esac |
esac |
61 |
|
|
62 |
# rebuild the menu now |
# rebuild the menu now |
63 |
helper_rebuild_fluxbox_menu |
fluxbox-rebuild-menu |
64 |
} |
} |
65 |
|
|
66 |
# get_fluxbox_menuitem |
# get_fluxbox_menuitem |
83 |
|
|
84 |
set_fluxbox_theme() |
set_fluxbox_theme() |
85 |
{ |
{ |
86 |
local theme="$1" |
local theme="${CLASS_ARGV[0]}" |
87 |
local stylesdir="@@DATADIR@@/fluxbox/styles" |
local stylesdir="@@DATADIR@@/fluxbox/styles" |
88 |
|
|
89 |
[[ -z ${theme} ]] && help_fluxbox_theme && return 1 |
[[ -z ${theme} ]] && help_fluxbox_theme && return 1 |
90 |
[[ ! -x $(which fluxbox-remote) ]] && eecho "fluxbox-remote missing! Aborted" && return 1 |
[[ ! -x $(type -P fluxbox-remote) ]] && eecho "fluxbox-remote missing! Aborted" && return 1 |
91 |
|
|
92 |
if [[ -e ${stylesdir}/${theme} ]] |
if [[ -e ${stylesdir}/${theme} ]] |
93 |
then |
then |
99 |
|
|
100 |
get_fluxbox_theme() |
get_fluxbox_theme() |
101 |
{ |
{ |
102 |
local method="$1" |
local method="${CLASS_ARGV[0]}" |
103 |
local stylesdir="@@DATADIR@@/fluxbox/styles" |
local stylesdir="@@DATADIR@@/fluxbox/styles" |
104 |
local value |
local value |
105 |
local i |
local i |