Contents of /mcore-src/trunk/mcore-tools/src/modules/fluxbox/fluxbox-rebuild-menu.in
Parent Directory | Revision Log
Revision 2212 -
(show annotations)
(download)
Fri Jan 10 23:19:49 2014 UTC (10 years, 5 months ago) by niro
File size: 1571 byte(s)
Fri Jan 10 23:19:49 2014 UTC (10 years, 5 months ago) by niro
File size: 1571 byte(s)
-renamed config.rc to mcore.conf
1 | #!/bin/bash |
2 | |
3 | MCLIBDIR="@@MCORE_LIBDIR@@" |
4 | source @@SYSCONFDIR@@/mcore/mcore.conf |
5 | source ${MCORE_LIBDIR}/include/common.global.class |
6 | |
7 | if [ ! -d ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu ] |
8 | then |
9 | echo "'${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu' does not exist." |
10 | exit 1 |
11 | fi |
12 | |
13 | MMINCLUDE="${MCORE_CONFIG_PATH}/fluxbox/mcore-menu-include" |
14 | CONFIG="${MROOT}/${MMINCLUDE}" |
15 | clearconfig |
16 | for file in $(find ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu -type f) |
17 | do |
18 | [[ ! -z ${MROOT} ]] && file=$(echo ${file} | sed "s:${MROOT}::") |
19 | addconfig "[include] (${file})" |
20 | done |
21 | |
22 | # rebuild the user menu too atm |
23 | CONFIG="${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox/menu" |
24 | if [[ ! -d ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox ]] |
25 | then |
26 | install -o ${MCORE_UNPRIV_USER} -o ${MCORE_UNPRIV_GROUP} -d ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox |
27 | fi |
28 | |
29 | # fluxbox menu header |
30 | clearconfig |
31 | if [ -e ${MROOT}@@SYSCONFDIR@@/os-release ] |
32 | then |
33 | ver=$(source ${MROOT}; echo "${ID}-${Version_ID}") |
34 | elif [ -e ${MROOT}@@SYSCONFDIR@@/mageversion ] |
35 | then |
36 | ver="$(< ${MROOT}@@SYSCONFDIR@@/mageversion)" |
37 | ver="${MCORE_DISTRIBUTION}-${ver}" |
38 | else |
39 | ver="${MCORE_DISTRIBUTION}" |
40 | fi |
41 | addconfig "[begin] (${ver} #${MCORE_SERIAL})" |
42 | |
43 | # add a newline (maybe there is no crlf in the header) |
44 | addconfig |
45 | |
46 | # our specific menu include |
47 | addconfig "[include] (${MMINCLUDE})" |
48 | |
49 | # fluxbox menu footer |
50 | addconfig '[separator]' |
51 | addconfig '[exit] (Abmelden)' |
52 | addconfig '[exec] (Neustarten) {sudo @@SBINDIR@@/reboot}' |
53 | addconfig '[exec] (Herunterfahren) {sudo @@SBINDIR@@/poweroff}' |
54 | addconfig '[end]' |
55 | |
56 | # add a newline (maybe there is no crlf in the footer) |
57 | addconfig |