Magellan Linux

Contents of /mcore-src/trunk/mcore-tools/src/modules/idesk/idesk-generate-icon-info.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2359 - (show annotations) (download)
Tue Aug 25 09:57:37 2015 UTC (8 years, 8 months ago) by niro
File size: 1610 byte(s)
-fixed a typo
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 GLOBAL_PIXMAPS_PATH="@@GLOBAL_PIXMAPS_PATH@@"
8 LOCAL_PIXMAPS_PATH="${MCORE_CONFIG_PATH}/icons/default"
9
10 ICON_INFO_PATH="${MCORE_CONFIG_PATH}/icons/info"
11 ICON_INFO_SUFFIX="@@ICON_INFO_SUFFIX@@"
12
13 # very basic getops
14 for i in $*
15 do
16 case $1 in
17 --name|-n) shift; name="$1" ;;
18 --command|-c) shift; command="$1" ;;
19 --icon|-i) shift; icon="$1" ;;
20 --filename|-f) shift; filename="$1" ;;
21 --xres|-x) shift; xres="$1" ;;
22 --yres|-y) shift; yres="$1" ;;
23 --icon-width|-w) shift; iwidth="$1" ;;
24 --icon-height|-h) shift; iheight="$1" ;;
25 --default-icon) shift; deficon="$1" ;;
26 esac
27 shift
28 done
29
30 # some sanity checks:
31
32 # abort if name or command not given
33 [[ -z ${name} ]] && die "No name given"
34 [[ -z ${command} ]] && die "No command given"
35
36 [[ -z ${filename} ]] && filename="${name}"
37
38 # use some defaults for icon, dest, {x,y}res
39 [[ -z ${xres} ]] && xres=50
40 [[ -z ${yres} ]] && xres=50
41 if [[ -z ${icon} ]]
42 then
43 # if no default icon is given use default.png
44 [[ -z ${deficon} ]] && deficon="default.png"
45 icon="${deficon}"
46 fi
47
48 CONFIG="${ICON_INFO_PATH}/${filename}.${ICON_INFO_SUFFIX}"
49 clearconfig
50
51 addconfig "name=\"${name}\""
52 addconfig "command=\"${command}\""
53 addconfig "icon=\"${icon}\""
54 addconfig "deficon=\"${deficon}\""
55 addconfig "xres=\"${xres}\""
56 addconfig "yres=\"${yres}\""
57 if [[ -z ${iwidth} ]]
58 then
59 addconfig "iwidth=0"
60 else
61 addconfig "iwidth=\"${iwidth}\""
62 fi
63
64 if [[ -z ${iheight} ]]
65 then
66 addconfig="iheight=0"
67 else
68 addconfig "iheight=\"${iheight}\""
69 fi