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