Annotation of /mcore-src/trunk/mcore-tools/src/modules/fluxbox/fluxbox-rebuild-menu.in
Parent Directory | Revision Log
Revision 2859 -
(hide annotations)
(download)
Wed Jul 15 06:40:10 2020 UTC (3 years, 9 months ago) by niro
File size: 2581 byte(s)
Wed Jul 15 06:40:10 2020 UTC (3 years, 9 months ago) by niro
File size: 2581 byte(s)
-always generate desktop icons if possible
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 | niro | 2761 | install -d ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu |
10 | niro | 2150 | fi |
11 | |||
12 | MMINCLUDE="${MCORE_CONFIG_PATH}/fluxbox/mcore-menu-include" | ||
13 | CONFIG="${MROOT}/${MMINCLUDE}" | ||
14 | clearconfig | ||
15 | for file in $(find ${MROOT}/${MCORE_CONFIG_PATH}/fluxbox/menu -type f) | ||
16 | do | ||
17 | [[ ! -z ${MROOT} ]] && file=$(echo ${file} | sed "s:${MROOT}::") | ||
18 | addconfig "[include] (${file})" | ||
19 | done | ||
20 | |||
21 | # rebuild the user menu too atm | ||
22 | niro | 2711 | CONFIG="${MROOT}/${MCORE_UNPRIV_HOME}/@@FLUXBOX_USER_CONFIG_DIR@@/menu-activated" |
23 | niro | 2621 | if [ ! -d ${MROOT}/${MCORE_UNPRIV_HOME}/@@FLUXBOX_USER_CONFIG_DIR@@ ] |
24 | niro | 2150 | then |
25 | niro | 2621 | install -o ${MCORE_UNPRIV_USER} -g ${MCORE_UNPRIV_GROUP} -d ${MROOT}/${MCORE_UNPRIV_HOME}/@@FLUXBOX_USER_CONFIG_DIR@@ |
26 | niro | 2150 | fi |
27 | |||
28 | # fluxbox menu header | ||
29 | clearconfig | ||
30 | if [ -e ${MROOT}@@SYSCONFDIR@@/os-release ] | ||
31 | then | ||
32 | niro | 2254 | ver=$(source ${MROOT}@@SYSCONFDIR@@/os-release; echo "${ID}-${Version_ID}") |
33 | niro | 2150 | elif [ -e ${MROOT}@@SYSCONFDIR@@/mageversion ] |
34 | then | ||
35 | ver="$(< ${MROOT}@@SYSCONFDIR@@/mageversion)" | ||
36 | ver="${MCORE_DISTRIBUTION}-${ver}" | ||
37 | else | ||
38 | ver="${MCORE_DISTRIBUTION}" | ||
39 | fi | ||
40 | niro | 2456 | addconfig "[begin] (${ver} #$(mcore-serial))" |
41 | niro | 2150 | |
42 | # add a newline (maybe there is no crlf in the header) | ||
43 | addconfig | ||
44 | |||
45 | # our specific menu include | ||
46 | addconfig "[include] (${MMINCLUDE})" | ||
47 | |||
48 | # fluxbox menu footer | ||
49 | addconfig '[separator]' | ||
50 | niro | 2715 | #addconfig '[exit] (Abmelden)' |
51 | niro | 2150 | addconfig '[exec] (Neustarten) {sudo @@SBINDIR@@/reboot}' |
52 | addconfig '[exec] (Herunterfahren) {sudo @@SBINDIR@@/poweroff}' | ||
53 | addconfig '[end]' | ||
54 | |||
55 | # add a newline (maybe there is no crlf in the footer) | ||
56 | addconfig | ||
57 | niro | 2711 | |
58 | niro | 2780 | # systemd provides this via tmpfiles.d |
59 | if [[ ! -e @@DATADIR@@/factory/${MCORE_UNPRIV_HOME}/@@FLUXBOX_USER_CONFIG_DIR@@/menu-deactivated ]] | ||
60 | then | ||
61 | # add a menu for an deactivated client | ||
62 | CONFIG="${MROOT}/${MCORE_UNPRIV_HOME}/@@FLUXBOX_USER_CONFIG_DIR@@/menu-deactivated" | ||
63 | clearconfig | ||
64 | addconfig "[begin] (${ver} #$(mcore-serial))" | ||
65 | addconfig | ||
66 | addconfig '[separator]' | ||
67 | #addconfig '[exit] (Abmelden)' | ||
68 | addconfig '[exec] (Neustarten) {sudo @@SBINDIR@@/reboot}' | ||
69 | addconfig '[exec] (Herunterfahren) {sudo @@SBINDIR@@/poweroff}' | ||
70 | addconfig '[end]' | ||
71 | addconfig | ||
72 | fi | ||
73 | niro | 2711 | |
74 | # activate the normal client menu | ||
75 | niro | 2712 | install -o ${MCORE_UNPRIV_USER} -g ${MCORE_UNPRIV_GROUP} \ |
76 | -m0644 ${MROOT}/${MCORE_UNPRIV_HOME}/@@FLUXBOX_USER_CONFIG_DIR@@/menu-activated \ | ||
77 | ${MROOT}/${MCORE_UNPRIV_HOME}/@@FLUXBOX_USER_CONFIG_DIR@@/menu | ||
78 | niro | 2859 | |
79 | # rebuild all icons | ||
80 | if [[ -x ${MCORE_LIBDIR}/idesk-generate-all-desktop-icons ]] | ||
81 | then | ||
82 | ${MCORE_LIBDIR}/idesk-generate-all-desktop-icons | ||
83 | fi |