Magellan Linux

Contents of /mcore-src/trunk/mcore-tools/src/modules/fluxbox/fluxbox-autostart.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2625 - (show annotations) (download)
Fri Sep 25 13:31:20 2015 UTC (8 years, 7 months ago) by niro
File size: 992 byte(s)
-drop useless comment
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 esac
19 shift
20 done
21
22 [[ -n ${method} ]] || die "No method given"
23
24 case "${method}" in
25 add)
26 [[ -n ${name} ]] || die "No name given"
27 [[ -n ${exec} ]] || die "No exec given"
28 CONFIG="${MROOT}/${AUTOSTARTCONFDIR}/${name}"
29 clearconfig
30 addconfig "[startup] {${exec}}"
31 ;;
32
33 del)
34 if [[ -n ${name} ]]
35 then
36 if [[ -f ${MROOT}/${AUTOSTARTCONFDIR}/${name} ]]
37 then
38 rm ${MROOT}/${AUTOSTARTCONFDIR}/"${name}"
39 fi
40 else
41 # delete all items
42 find ${MROOT}/${AUTOSTARTCONFDIR} -type f | xargs --no-run-if-empty rm
43 fi
44 ;;
45
46 print) list_files_in_directory ${MROOT}/${AUTOSTARTCONFDIR} ;;
47 esac