--- alx-src/branches/alxconf-060/functions/config_sessions.sh 2011/06/15 12:41:40 2400 +++ alx-src/branches/alxconf-060/functions/config_sessions.sh 2011/06/15 12:43:55 2401 @@ -123,6 +123,7 @@ local iheight local deficon local CONFIG + local utility # very basic getops for i in $* @@ -142,15 +143,24 @@ done # some sanity checks: - + # abort if name or command not given [[ -z ${name} ]] && return 1 [[ -z ${command} ]] && return 1 + # which utility are we using idesk|xtdesk ? + if [ -x /usr/bin/idesk ] + then + utility="idesk" + [[ -z ${dest} ]] && dest="${ALX_UNPRIV_HOME}/.idesktop/${name}.lnk" + else + utility="xtdesk" + [[ -z ${dest} ]] && dest="${ALX_UNPRIV_HOME}/.xtdesktop/${name}.lnk" + fi + # use some defaults for icon, dest, {x,y}res [[ -z ${xres} ]] && xres=30 [[ -z ${yres} ]] && xres=30 - [[ -z ${dest} ]] && dest="${ALX_UNPRIV_HOME}/.xtdesktop/${name}.lnk" if [[ -z ${icon} ]] || [ ! -f ${icon} ] then # if no default icon is given use default.png @@ -162,7 +172,7 @@ clearconfig addconfig 'table Icon' - addconfig ' Type: Program' + [[ ${utility} = xtdesk ]] && addconfig ' Type: Program' addconfig " Caption: ${name}" addconfig " Command: ${command}" addconfig " Icon: ${icon}" @@ -172,11 +182,20 @@ # add these only if not zero if [[ ! -z ${iwidth} ]] && [[ ! -z ${iheight} ]] then - addconfig " IconWidth: ${iwidth}" - addconfig " IconHeight: ${iheight}" + if [[ ${utility} = xtdesk ]] + then + addconfig " IconWidth: ${iwidth}" + addconfig " IconHeight: ${iheight}" + fi + if [[ ${utility} = idesk ]] + then + addconfig " Width: ${iwidth}" + addconfig " Height: ${iheight}" + fi fi addconfig 'end' +fi } generate_all_desktop_icons() @@ -191,6 +210,22 @@ local i local name local progsh_path + local utility + local dest + local rc + + # which utility are we using idesk|xtdesk ? + if [ -x /usr/bin/idesk ] + then + utility="idesk" + dest="${ALX_UNPRIV_HOME}/.idesktop" + rc="${ALX_UNPRIV_HOME}/.ideskrc" + else + utility="xtdesk" + dest="${ALX_UNPRIV_HOME}/.xtdesktop" + rc="${ALX_UNPRIV_HOME}/.xtdeskrc" + fi + # progsh path progsh_path="${ALX_UNPRIV_HOME}/.alxprogs" @@ -208,11 +243,15 @@ yres="$(( ${yres} - 80 ))" # clean desktop icon location - [ -d ${ALX_UNPRIV_HOME}/.xtdesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.xtdesktop - install -d ${ALX_UNPRIV_HOME}/.xtdesktop + [ -d ${dest} ] && rm -rf ${dest} + [ -f ${rc} ] && rm -f ${rc} + install -d ${dest} +if [[ ${utility} = xtdesk ]] +then # basic config cat ${ALX_SKELETONS}/xtdesktop/xtdeskrc > ${ALX_UNPRIV_HOME}/.xtdesktop/xtdeskrc +fi # default settings declare -i x=30 @@ -248,7 +287,7 @@ --name "${cfg_sessions_session}" \ --command "nice -n 19 wfica ${ALX_ICA_SESSIONS}/$(fix_whitespaces ${cfg_sessions_filename})" \ --icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_sessions_session}).png" \ - --dest "${ALX_UNPRIV_HOME}/.xtdesktop/$(fix_whitespaces ${cfg_sessions_session}).lnk" \ + --dest "${dest}/$(fix_whitespaces ${cfg_sessions_session}).lnk" \ --xres "${x}" \ --yres "${y}" @@ -284,7 +323,7 @@ --name "${cfg_other_menuitems_name}" \ --command "${progsh_path}/$(fix_whitespaces ${cfg_other_menuitems_name})" \ --icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_other_menuitems_name}).png" \ - --dest "${ALX_UNPRIV_HOME}/.xtdesktop/$(fix_whitespaces ${cfg_other_menuitems_name}).lnk" \ + --dest "${dest}/$(fix_whitespaces ${cfg_other_menuitems_name}).lnk" \ --xres "${x}" \ --yres "${y}" \ --default-icon "default_item.png" @@ -314,7 +353,7 @@ --name "${sysinfo}" \ --command "exit 0" \ --icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \ - --dest "${ALX_UNPRIV_HOME}/.xtdesktop/sysinfo.lnk" \ + --dest "${dest}/sysinfo.lnk" \ --xres "${xres}" \ --yres "${yres}" \ --icon-width "1" \