12 |
local CONFIG |
local CONFIG |
13 |
|
|
14 |
MMINCLUDE="${MCORE_CONFIG_PATH}/fluxbox/mcore-menu-include" |
MMINCLUDE="${MCORE_CONFIG_PATH}/fluxbox/mcore-menu-include" |
15 |
CONFIG="${MMINCLUDE}" |
CONFIG="${MROOT}/${MMINCLUDE}" |
16 |
clearconfig |
clearconfig |
17 |
|
for file in $(find ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu -type f) |
|
for file in ${MCORE_CONFIG_PATH}/fluxbox/menu/* |
|
18 |
do |
do |
19 |
|
[[ ! -z ${MROOT} ]] && file=$(echo ${file} | sed "s:${MROOT}::") |
20 |
addconfig "[include] (${file})" |
addconfig "[include] (${file})" |
21 |
done |
done |
22 |
|
|
23 |
# rebuild the user menu too atm |
# rebuild the user menu too atm |
24 |
CONFIG="${MCORE_UNPRIV_HOME}/.fluxbox/menu" |
CONFIG="${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/menu" |
25 |
if [[ ! -d ${MCORE_UNPRIV_HOME}/.fluxbox ]] |
if [[ ! -d ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox ]] |
26 |
then |
then |
27 |
install -o ${MCORE_UNPRIV_USER} -o ${MCORE_UNPRIV_GROUP} -d ${MCORE_UNPRIV_HOME}/.fluxbox |
install -o ${MCORE_UNPRIV_USER} -o ${MCORE_UNPRIV_GROUP} -d ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox |
28 |
fi |
fi |
29 |
|
|
30 |
# fluxbox menu header |
# fluxbox menu header |
31 |
clearconfig |
clearconfig |
32 |
local ver="$(< /etc/mageversion)" |
local ver="$(< ${MROOT}/etc/mageversion)" |
33 |
addconfig "[begin] (mCore-${ver} #${MCORE_SERIAL})" |
addconfig "[begin] (mCore-${ver} #${MCORE_SERIAL})" |
34 |
|
|
35 |
# add a newline (maybe there is no crlf in the header) |
# add a newline (maybe there is no crlf in the header) |
49 |
addconfig |
addconfig |
50 |
} |
} |
51 |
|
|
52 |
|
helper_rebuild_fluxbox_autostart() |
53 |
|
{ |
54 |
|
local CONFIG |
55 |
|
|
56 |
|
CONFIG="${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/apps" |
57 |
|
clearconfig |
58 |
|
for file in $(find ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/autostart -type f) |
59 |
|
do |
60 |
|
addconfig "$(< ${file})" |
61 |
|
done |
62 |
|
|
63 |
|
# add a newline (maybe there is no crlf in the footer) |
64 |
|
addconfig |
65 |
|
} |
66 |
|
|
67 |
help_fluxbox_menuitem() |
help_fluxbox_menuitem() |
68 |
{ |
{ |
69 |
mecho "get fluxbox.menuitem" |
mecho "get fluxbox.menuitem" |
99 |
add) |
add) |
100 |
[[ -z ${name} ]] && help_fluxbox_menuitem && return 1 |
[[ -z ${name} ]] && help_fluxbox_menuitem && return 1 |
101 |
[[ -z ${exec} ]] && help_fluxbox_menuitem && return 1 |
[[ -z ${exec} ]] && help_fluxbox_menuitem && return 1 |
102 |
CONFIG="${MCORE_CONFIG_PATH}/fluxbox/menu/${name}" |
CONFIG="${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/${name}" |
103 |
clearconfig |
clearconfig |
104 |
addconfig "[exec] (${name}) {${exec}}" |
addconfig "[exec] (${name}) {${exec}}" |
105 |
;; |
;; |
106 |
del) |
del) |
107 |
if [[ -f ${MCORE_CONFIG_PATH}/fluxbox/menu/${name} ]] |
if [[ -f ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/${name} ]] |
108 |
then |
then |
109 |
rm ${MCORE_CONFIG_PATH}/fluxbox/menu/"${name}" |
rm ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/"${name}" |
110 |
elif [[ -z ${name} ]] |
elif [[ -z ${name} ]] |
111 |
then |
then |
112 |
# delete all items |
# delete all items |
113 |
rm ${MCORE_CONFIG_PATH}/fluxbox/menu/* |
rm ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu/* |
114 |
fi |
fi |
115 |
;; |
;; |
116 |
*) |
*) |
125 |
# get_fluxbox_menuitem |
# get_fluxbox_menuitem |
126 |
get_fluxbox_menuitem() |
get_fluxbox_menuitem() |
127 |
{ |
{ |
128 |
local i |
list_files_in_directory ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu |
|
local item |
|
|
|
|
|
for i in $(find ${MCORE_CONFIG_PATH}/fluxbox/menu -type f | sort) |
|
|
do |
|
|
item="${item} $(basename ${i})" |
|
|
done |
|
|
|
|
|
rvecho "${item}" |
|
129 |
} |
} |
130 |
|
|
131 |
help_fluxbox_theme() |
help_fluxbox_theme() |
167 |
|
|
168 |
case "${method}" in |
case "${method}" in |
169 |
system) |
system) |
170 |
for i in $(find ${stylesdir} -mindepth 1 -maxdepth 1 | sort) |
list_files_in_directory -type d -mindepth 1 -maxdepth 1 ${MROOT}/${stylesdir} |
|
do |
|
|
value="${value} $(basename ${i})" |
|
|
done |
|
|
rvecho "${value}" |
|
171 |
;; |
;; |
172 |
|
|
173 |
current) |
current) |
174 |
value=$(grep -i '^session.stylefile' ${MCORE_UNPRIV_HOME}/.fluxbox/init | sed 's:.*/\(.*\):\1:') |
value=$(grep -i '^session.stylefile' ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/init | sed 's:.*/\(.*\):\1:') |
175 |
rvecho "${value}" |
rvecho "${value}" |
176 |
;; |
;; |
177 |
*) help_fluxbox_theme && return 1 ;; |
*) help_fluxbox_theme && return 1 ;; |