Annotation of /mcore-src/trunk/mcore-tools/src/modules/fluxbox/fluxbox-rebuild-menu.in
Parent Directory | Revision Log
Revision 2456 -
(hide annotations)
(download)
Thu Sep 3 14:33:15 2015 UTC (9 years ago) by niro
File size: 1598 byte(s)
Thu Sep 3 14:33:15 2015 UTC (9 years ago) by niro
File size: 1598 byte(s)
-use the mcore-serial program
1 | niro | 2150 | #!/bin/bash |
2 | |||
3 | niro | 2253 | MCORE_LIBDIR="@@MCORE_LIBDIR@@" |
4 | niro | 2212 | source @@SYSCONFDIR@@/mcore/mcore.conf |
5 | niro | 2150 | 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 | niro | 2328 | if [ ! -d ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox ] |
25 | niro | 2150 | then |
26 | niro | 2328 | install -o ${MCORE_UNPRIV_USER} -g ${MCORE_UNPRIV_GROUP} -d ${MROOT}/${MCORE_UNPRIV_HOME}/.fluxbox |
27 | niro | 2150 | fi |
28 | |||
29 | # fluxbox menu header | ||
30 | clearconfig | ||
31 | if [ -e ${MROOT}@@SYSCONFDIR@@/os-release ] | ||
32 | then | ||
33 | niro | 2254 | ver=$(source ${MROOT}@@SYSCONFDIR@@/os-release; echo "${ID}-${Version_ID}") |
34 | niro | 2150 | 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 | niro | 2456 | addconfig "[begin] (${ver} #$(mcore-serial))" |
42 | niro | 2150 | |
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 |