Contents of /mcore-src/trunk/mcore-tools/src/modules/fluxbox/fluxbox-autostart.in
Parent Directory | Revision Log
Revision 2282 -
(show annotations)
(download)
Tue Jan 14 14:55:42 2014 UTC (10 years, 3 months ago) by niro
File size: 1028 byte(s)
Tue Jan 14 14:55:42 2014 UTC (10 years, 3 months ago) by niro
File size: 1028 byte(s)
-added fluxbox-autostart helper
1 | #!/bin/bash |
2 | |
3 | MCORE_LIBDIR="@@MCORE_LIBDIR@@" |
4 | source @@SYSCONFDIR@@/mcore/mcore.conf |
5 | source ${MCORE_LIBDIR}/include/common.global.class |
6 | |
7 | AUTOSTARTCONFDIR="${MCORE_CONFIG_PATH}/fluxbox/autostart" |
8 | |
9 | die() { echo "ERROR: $@"; exit 1; } |
10 | |
11 | # very basic getops |
12 | for argv in $* |
13 | do |
14 | case $1 in |
15 | --add|--del|--print) method="${1//--}" ;; |
16 | --name) shift; name="$1" ;; |
17 | --exec) shift; exec="$1" ;; |
18 | --comment) shift; comment="$1" ;; |
19 | esac |
20 | shift |
21 | done |
22 | |
23 | [[ -n ${method} ]] || die "No method given" |
24 | |
25 | case "${method}" in |
26 | add) |
27 | [[ -n ${name} ]] || die "No name given" |
28 | [[ -n ${exec} ]] || die "No exec given" |
29 | CONFIG="${MROOT}/${AUTOSTARTCONFDIR}/${name}" |
30 | clearconfig |
31 | addconfig "[startup] {${exec}}" |
32 | ;; |
33 | |
34 | del) |
35 | if [[ -n ${name} ]] |
36 | then |
37 | if [[ -f ${MROOT}/${AUTOSTARTCONFDIR}/${name} ]] |
38 | then |
39 | rm ${MROOT}/${AUTOSTARTCONFDIR}/"${name}" |
40 | fi |
41 | else |
42 | # delete all items |
43 | find ${MROOT}/${AUTOSTARTCONFDIR} -type f | xargs --no-run-if-empty rm |
44 | fi |
45 | ;; |
46 | |
47 | print) list_files_in_directory ${MROOT}/${AUTOSTARTCONFDIR} ;; |
48 | esac |