Magellan Linux

Diff of /alx-src/branches/alxconf-060/functions/config_sessions.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2400 by niro, Tue Jun 14 13:51:20 2011 UTC revision 2401 by niro, Wed Jun 15 12:43:55 2011 UTC
# Line 123  generate_icon() Line 123  generate_icon()
123   local iheight   local iheight
124   local deficon   local deficon
125   local CONFIG   local CONFIG
126     local utility
127    
128   # very basic getops   # very basic getops
129   for i in $*   for i in $*
# Line 142  generate_icon() Line 143  generate_icon()
143   done   done
144    
145   # some sanity checks:   # some sanity checks:
146    
147   # abort if name or command not given   # abort if name or command not given
148   [[ -z ${name} ]] && return 1   [[ -z ${name} ]] && return 1
149   [[ -z ${command} ]] && return 1   [[ -z ${command} ]] && return 1
150    
151     # which utility are we using idesk|xtdesk ?
152     if [ -x /usr/bin/idesk ]
153     then
154     utility="idesk"
155     [[ -z ${dest} ]] && dest="${ALX_UNPRIV_HOME}/.idesktop/${name}.lnk"
156     else
157     utility="xtdesk"
158     [[ -z ${dest} ]] && dest="${ALX_UNPRIV_HOME}/.xtdesktop/${name}.lnk"
159     fi
160    
161   # use some defaults for icon, dest, {x,y}res   # use some defaults for icon, dest, {x,y}res
162   [[ -z ${xres} ]] && xres=30   [[ -z ${xres} ]] && xres=30
163   [[ -z ${yres} ]] && xres=30   [[ -z ${yres} ]] && xres=30
  [[ -z ${dest} ]] && dest="${ALX_UNPRIV_HOME}/.xtdesktop/${name}.lnk"  
164   if [[ -z ${icon} ]] || [ ! -f ${icon} ]   if [[ -z ${icon} ]] || [ ! -f ${icon} ]
165   then   then
166   # if no default icon is given use default.png   # if no default icon is given use default.png
# Line 162  generate_icon() Line 172  generate_icon()
172   clearconfig   clearconfig
173    
174   addconfig 'table Icon'   addconfig 'table Icon'
175   addconfig '  Type: Program'   [[ ${utility} = xtdesk ]] && addconfig '  Type: Program'
176   addconfig "  Caption: ${name}"   addconfig "  Caption: ${name}"
177   addconfig "  Command: ${command}"   addconfig "  Command: ${command}"
178   addconfig "  Icon: ${icon}"   addconfig "  Icon: ${icon}"
# Line 172  generate_icon() Line 182  generate_icon()
182   # add these only if not zero   # add these only if not zero
183   if [[ ! -z ${iwidth} ]] && [[ ! -z ${iheight} ]]   if [[ ! -z ${iwidth} ]] && [[ ! -z ${iheight} ]]
184   then   then
185   addconfig "  IconWidth: ${iwidth}"   if [[ ${utility} = xtdesk ]]
186   addconfig "  IconHeight: ${iheight}"   then
187     addconfig "  IconWidth: ${iwidth}"
188     addconfig "  IconHeight: ${iheight}"
189     fi
190     if [[ ${utility} = idesk ]]
191     then
192     addconfig "  Width: ${iwidth}"
193     addconfig "  Height: ${iheight}"
194     fi
195   fi   fi
196    
197   addconfig 'end'   addconfig 'end'
198    fi
199  }  }
200    
201  generate_all_desktop_icons()  generate_all_desktop_icons()
# Line 191  generate_all_desktop_icons() Line 210  generate_all_desktop_icons()
210   local i   local i
211   local name   local name
212   local progsh_path   local progsh_path
213     local utility
214     local dest
215     local rc
216    
217     # which utility are we using idesk|xtdesk ?
218     if [ -x /usr/bin/idesk ]
219     then
220     utility="idesk"
221     dest="${ALX_UNPRIV_HOME}/.idesktop"
222     rc="${ALX_UNPRIV_HOME}/.ideskrc"
223     else
224     utility="xtdesk"
225     dest="${ALX_UNPRIV_HOME}/.xtdesktop"
226     rc="${ALX_UNPRIV_HOME}/.xtdeskrc"
227     fi
228    
229    
230   # progsh path   # progsh path
231   progsh_path="${ALX_UNPRIV_HOME}/.alxprogs"   progsh_path="${ALX_UNPRIV_HOME}/.alxprogs"
# Line 208  generate_all_desktop_icons() Line 243  generate_all_desktop_icons()
243   yres="$(( ${yres} - 80 ))"   yres="$(( ${yres} - 80 ))"
244    
245   # clean desktop icon location   # clean desktop icon location
246   [ -d ${ALX_UNPRIV_HOME}/.xtdesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.xtdesktop   [ -d ${dest} ] && rm -rf ${dest}
247   install -d ${ALX_UNPRIV_HOME}/.xtdesktop   [ -f ${rc} ] && rm -f ${rc}
248     install -d ${dest}
249    
250    if [[ ${utility} = xtdesk ]]
251    then
252   # basic config   # basic config
253   cat ${ALX_SKELETONS}/xtdesktop/xtdeskrc > ${ALX_UNPRIV_HOME}/.xtdesktop/xtdeskrc   cat ${ALX_SKELETONS}/xtdesktop/xtdeskrc > ${ALX_UNPRIV_HOME}/.xtdesktop/xtdeskrc
254    fi
255    
256   # default settings   # default settings
257   declare -i x=30   declare -i x=30
# Line 248  generate_all_desktop_icons() Line 287  generate_all_desktop_icons()
287   --name "${cfg_sessions_session}" \   --name "${cfg_sessions_session}" \
288   --command "nice -n 19 wfica ${ALX_ICA_SESSIONS}/$(fix_whitespaces ${cfg_sessions_filename})" \   --command "nice -n 19 wfica ${ALX_ICA_SESSIONS}/$(fix_whitespaces ${cfg_sessions_filename})" \
289   --icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_sessions_session}).png" \   --icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_sessions_session}).png" \
290   --dest "${ALX_UNPRIV_HOME}/.xtdesktop/$(fix_whitespaces ${cfg_sessions_session}).lnk" \   --dest "${dest}/$(fix_whitespaces ${cfg_sessions_session}).lnk" \
291   --xres "${x}" \   --xres "${x}" \
292   --yres "${y}"   --yres "${y}"
293    
# Line 284  generate_all_desktop_icons() Line 323  generate_all_desktop_icons()
323   --name "${cfg_other_menuitems_name}" \   --name "${cfg_other_menuitems_name}" \
324   --command "${progsh_path}/$(fix_whitespaces ${cfg_other_menuitems_name})" \   --command "${progsh_path}/$(fix_whitespaces ${cfg_other_menuitems_name})" \
325   --icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_other_menuitems_name}).png" \   --icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_other_menuitems_name}).png" \
326   --dest "${ALX_UNPRIV_HOME}/.xtdesktop/$(fix_whitespaces ${cfg_other_menuitems_name}).lnk" \   --dest "${dest}/$(fix_whitespaces ${cfg_other_menuitems_name}).lnk" \
327   --xres "${x}" \   --xres "${x}" \
328   --yres "${y}" \   --yres "${y}" \
329   --default-icon "default_item.png"   --default-icon "default_item.png"
# Line 314  generate_all_desktop_icons() Line 353  generate_all_desktop_icons()
353   --name "${sysinfo}" \   --name "${sysinfo}" \
354   --command "exit 0" \   --command "exit 0" \
355   --icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \   --icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \
356   --dest "${ALX_UNPRIV_HOME}/.xtdesktop/sysinfo.lnk" \   --dest "${dest}/sysinfo.lnk" \
357   --xres "${xres}" \   --xres "${xres}" \
358   --yres "${yres}" \   --yres "${yres}" \
359   --icon-width "1" \   --icon-width "1" \

Legend:
Removed from v.2400  
changed lines
  Added in v.2401