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 2161 by niro, Wed May 18 14:35:13 2011 UTC revision 6765 by niro, Tue Jul 21 12:18:38 2015 UTC
# Line 19  generate_ica_session_file() Line 19  generate_ica_session_file()
19   local ses_domain   local ses_domain
20   local ses_password   local ses_password
21   local ses_browseradrs   local ses_browseradrs
22     local ses_colors
23   local CONFIG   local CONFIG
24    
25   # very basic getops   # very basic getops
# Line 31  generate_ica_session_file() Line 32  generate_ica_session_file()
32   --password) shift; ses_password="$1" ;;   --password) shift; ses_password="$1" ;;
33   --domain) shift; ses_domain="$1" ;;   --domain) shift; ses_domain="$1" ;;
34   --server) shift; ses_browseradrs="$1" ;;   --server) shift; ses_browseradrs="$1" ;;
35           esac   --colordepth) shift; ses_colors="$1" ;;
36     esac
37   shift   shift
38   done   done
39    
# Line 57  generate_ica_session_file() Line 59  generate_ica_session_file()
59   # the first address must be named TcpBrowserAddress, but not TcpBrowserAddress1 !!   # the first address must be named TcpBrowserAddress, but not TcpBrowserAddress1 !!
60   [[ ${i} -eq 1 ]] && num=""   [[ ${i} -eq 1 ]] && num=""
61   addconfig "TcpBrowserAddress${num}=${server}"   addconfig "TcpBrowserAddress${num}=${server}"
62     addconfig "HttpBrowserAddress${num}=${server}"
63   done   done
64    
65   addconfig 'ScreenPercent=0'   addconfig 'ScreenPercent=0'
# Line 65  generate_ica_session_file() Line 68  generate_ica_session_file()
68   addconfig "[${ses_session}]"   addconfig "[${ses_session}]"
69   addconfig "Address=${ses_session}"   addconfig "Address=${ses_session}"
70   addconfig "InitialProgram=#${ses_session}"   addconfig "InitialProgram=#${ses_session}"
71    
72     # convert to ica session file values
73     case ${ses_colors} in
74     24|32) ses_colors="8";;
75     16) ses_colors="4";;
76     8) ses_colors="2";;
77     *) ses_colors="4";; # default to 16bit
78     esac
79     addconfig "DesiredColor=${ses_colors}"
80   addconfig 'TransportDriver=TCP/IP'   addconfig 'TransportDriver=TCP/IP'
81   addconfig 'WinStationDriver=ICA 3.0'   addconfig 'WinStationDriver=ICA 3.0'
82   addconfig "ClearPassword=${ses__password}"   addconfig "ClearPassword=${ses_password}"
83   addconfig "Username=${ses_username}"   addconfig "Username=${ses_username}"
84   addconfig "Domain=${ses_domain}"   addconfig "Domain=${ses_domain}"
85   addconfig 'UseFullScreen=Yes'   addconfig 'UseFullScreen=Yes'
86   addconfig 'NoWindowManager=True'   addconfig 'NoWindowManager=True'
87  }  }
88    
89    generate_storefront_sh()
90    {
91     local server
92     local ses_session
93     local ses_filename
94     local ses_username
95     local ses_domain
96     local ses_password
97     local ses_browseradrs
98    
99     # very basic getops
100     for i in $*
101     do
102     case $1 in
103     --session) shift; ses_session="$1" ;;
104     --filename) shift; ses_filename="$1" ;;
105     --username) shift; ses_username="$1" ;;
106     --password) shift; ses_password="$1" ;;
107     --domain) shift; ses_domain="$1" ;;
108     --server) shift; ses_browseradrs="$1" ;;
109     esac
110     shift
111     done
112    
113     generate_program_sh \
114     --name "${ses_session}" \
115     --exec "storefront-resolver" \
116     --param "launch '${ses_username}' '${ses_password}' '${ses_domain}' '${ses_session}'" \
117     --dest "${ALX_UNPRIV_HOME}/.alxprogs/$(fix_whitespaces ${ses_filename})" \
118     --environment "STORE=${ses_browseradrs}"
119    }
120    
121  # generates a sh file to start programs  # generates a sh file to start programs
122  generate_program_sh()  generate_program_sh()
123  {  {
# Line 93  generate_program_sh() Line 137  generate_program_sh()
137   --param|-p) shift; param="$1" ;;   --param|-p) shift; param="$1" ;;
138   --dest|-d) shift; dest="$1" ;;   --dest|-d) shift; dest="$1" ;;
139   --workdir|-w) shift; workdir="$1" ;;   --workdir|-w) shift; workdir="$1" ;;
140           esac   --environment|-e)  shift; environment="$1" ;;
141     esac
142   shift   shift
143   done   done
144    
# Line 104  generate_program_sh() Line 149  generate_program_sh()
149    
150   CONFIG="${dest}"   CONFIG="${dest}"
151   addconfig "#!/bin/sh"   addconfig "#!/bin/sh"
152   [ -n "${workdir}" ] && addconfig "cd ${workdir}"   [[ -n ${environment} ]] && addconfig "export ${environment}"
153     [[ -n ${workdir} ]] && addconfig "cd ${workdir}"
154   addconfig "exec ${exec} ${param}"   addconfig "exec ${exec} ${param}"
155    
156   chmod 0755 "${dest}"   chmod 0755 "${dest}"
# Line 123  generate_icon() Line 169  generate_icon()
169   local iheight   local iheight
170   local deficon   local deficon
171   local CONFIG   local CONFIG
172     local utility
173    
174   # very basic getops   # very basic getops
175   for i in $*   for i in $*
# Line 137  generate_icon() Line 184  generate_icon()
184   --icon-width|-w) shift; iwidth="$1" ;;   --icon-width|-w) shift; iwidth="$1" ;;
185   --icon-height|-h) shift; iheight="$1" ;;   --icon-height|-h) shift; iheight="$1" ;;
186   --default-icon) shift; deficon="$1" ;;   --default-icon) shift; deficon="$1" ;;
187           esac   esac
188   shift   shift
189   done   done
190    
191   # some sanity checks:   # some sanity checks:
192    
193   # abort if name or command not given   # abort if name or command not given
194   [[ -z ${name} ]] && return 1   [[ -z ${name} ]] && return 1
195   [[ -z ${command} ]] && return 1   [[ -z ${command} ]] && return 1
196    
197     [[ -z ${dest} ]] && dest="${ALX_UNPRIV_HOME}/.idesktop/${name}.lnk"
198    
199   # use some defaults for icon, dest, {x,y}res   # use some defaults for icon, dest, {x,y}res
200   [[ -z ${xres} ]] && xres=30   [[ -z ${xres} ]] && xres=50
201   [[ -z ${yres} ]] && xres=30   [[ -z ${yres} ]] && xres=50
  [[ -z ${dest} ]] && dest="${ALX_UNPRIV_HOME}/.xtdesktop/${name}.lnk"  
202   if [[ -z ${icon} ]] || [ ! -f ${icon} ]   if [[ -z ${icon} ]] || [ ! -f ${icon} ]
203   then   then
204   # if no default icon is given use default.png   # if no default icon is given use default.png
# Line 162  generate_icon() Line 210  generate_icon()
210   clearconfig   clearconfig
211    
212   addconfig 'table Icon'   addconfig 'table Icon'
  addconfig '  Type: Program'  
213   addconfig "  Caption: ${name}"   addconfig "  Caption: ${name}"
214   addconfig "  Command: ${command}"   addconfig "  Command: ${command}"
215   addconfig "  Icon: ${icon}"   addconfig "  Icon: ${icon}"
# Line 172  generate_icon() Line 219  generate_icon()
219   # add these only if not zero   # add these only if not zero
220   if [[ ! -z ${iwidth} ]] && [[ ! -z ${iheight} ]]   if [[ ! -z ${iwidth} ]] && [[ ! -z ${iheight} ]]
221   then   then
222   addconfig "  IconWidth: ${iwidth}"   addconfig "  Width: ${iwidth}"
223   addconfig "  IconHeight: ${iheight}"   addconfig "  Height: ${iheight}"
224   fi   fi
225    
226   addconfig 'end'   addconfig 'end'
# Line 183  generate_all_desktop_icons() Line 230  generate_all_desktop_icons()
230  {  {
231   local session_list="$1"   local session_list="$1"
232   local other_menuitem_list="$2"   local other_menuitem_list="$2"
233     local plugin_list="$3"
234   local res   local res
235   local xres   local xres
236   local yres   local yres
# Line 191  generate_all_desktop_icons() Line 239  generate_all_desktop_icons()
239   local i   local i
240   local name   local name
241   local progsh_path   local progsh_path
242     local utility
243     local dest
244     local rc
245    
246     dest="${ALX_UNPRIV_HOME}/.idesktop"
247     rc="${ALX_UNPRIV_HOME}/.ideskrc"
248    
249   # progsh path   # progsh path
250   progsh_path="${ALX_UNPRIV_HOME}/.alxprogs"   progsh_path="${ALX_UNPRIV_HOME}/.alxprogs"
# Line 200  generate_all_desktop_icons() Line 254  generate_all_desktop_icons()
254    
255   # split res to x & y   # split res to x & y
256   xres="${res%x*}"   xres="${res%x*}"
257   xres="${res#*x}"   yres="${res#*x}"
258    
259   # top left edge of the icon is given in config file   # top left edge of the icon is given in config file
260   # remove a little bit to simulate the bottom-right edge   # remove a little bit to simulate the bottom-right edge
261   xres="$(( ${xres} - 120 ))"   xres="$(( ${xres} - 120 ))"
262   yres="$(( ${yres} - 80 ))"   yres="$(( ${yres} - 80 ))"
263    
  # basic config  
  cat ${ALX_SKELETONS}/xtdesktop/xtdeskrc > ${ALX_UNPRIV_HOME}/.xtdeskrc  
   
264   # clean desktop icon location   # clean desktop icon location
265   [ -d ${ALX_UNPRIV_HOME}/.xtdesktop ] && rm -rf ${ALX_UNPRIV_HOME}/.xtdesktop   [ -d ${dest} ] && rm -rf ${dest}
266   install -d ${ALX_UNPRIV_HOME}/.xtdesktop   [ -f ${rc} ] && rm -f ${rc}
267     install -d ${dest}
268    
269   # default settings   # default settings
270   declare -i x=30   declare -i x=50
271   declare -i y=30   declare -i y=50
272    
273   # ica icons   # ica icons
274   for i in ${session_list}   for i in ${session_list}
# Line 230  generate_all_desktop_icons() Line 282  generate_all_desktop_icons()
282   # new line if x > xres   # new line if x > xres
283   if [ ${x} -ge ${xres} ]   if [ ${x} -ge ${xres} ]
284   then   then
285   x=30   x=50
286   y=$((${y} + 80))   y=$((${y} + 80))
287   fi   fi
288    
# Line 238  generate_all_desktop_icons() Line 290  generate_all_desktop_icons()
290   if [ ${y} -ge ${yres} ]   if [ ${y} -ge ${yres} ]
291   then   then
292   x=$((${x} + 120))   x=$((${x} + 120))
293   y=30   y=50
294    
295   # re-check x   # re-check x
296   [ ${x} -ge ${xres} ] && x=30   [ ${x} -ge ${xres} ] && x=50
297   fi   fi
298    
299   generate_icon \   generate_icon \
300   --name "${cfg_session_session}" \   --name "${cfg_sessions_session}" \
301   --command "nice -n 19 wfica ${ALX_ICA_SESSIONS}/$(fix_whitespaces ${cfg_session_filename})" \   --command "${progsh_path}/$(fix_whitespaces ${cfg_sessions_filename})" \
302   --icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_session_session}).png" \   --icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_sessions_session}).png" \
303   --dest "${ALX_UNPRIV_HOME}/.xtdesktop/$(fix_whitespaces ${cfg_session_session}).lnk" \   --dest "${dest}/$(fix_whitespaces ${cfg_sessions_session}).lnk" \
304   --xres "${x}" \   --xres "${x}" \
305   --yres "${y}"   --yres "${y}"
306    
# Line 266  generate_all_desktop_icons() Line 318  generate_all_desktop_icons()
318   # new line if x > xres   # new line if x > xres
319   if [ ${x} -ge ${xres} ]   if [ ${x} -ge ${xres} ]
320   then   then
321   x=30   x=50
322   y=$((${y} + 80))   y=$((${y} + 80))
323   fi   fi
324    
# Line 274  generate_all_desktop_icons() Line 326  generate_all_desktop_icons()
326   if [ ${y} -ge ${yres} ]   if [ ${y} -ge ${yres} ]
327   then   then
328   x=$((${x} + 120))   x=$((${x} + 120))
329   y=30   y=50
330    
331   # re-check x   # re-check x
332   [ ${x} -ge ${xres} ] && x=30   [ ${x} -ge ${xres} ] && x=50
333   fi   fi
334    
335   generate_icon \   generate_icon \
336   --name "${cfg_other_menuitems_name}" \   --name "${cfg_other_menuitems_name}" \
337   --command "${progsh_path}/$(fix_whitespaces ${cfg_other_menuitems_exec})" \   --command "${progsh_path}/$(fix_whitespaces ${cfg_other_menuitems_name})" \
338   --icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_other_menuitems_name}).png" \   --icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_other_menuitems_icon}).png" \
339   --dest "${ALX_UNPRIV_HOME}/.xtdesktop/$(fix_whitespaces ${cfg_other_menuitems_name}).lnk" \   --dest "${dest}/$(fix_whitespaces ${cfg_other_menuitems_name}).lnk" \
340   --xres "${x}" \   --xres "${x}" \
341   --yres "${y}" \   --yres "${y}" \
342   --default-icon "default_item.png"   --default-icon "default_item.png"
343    
344   y=$((${y} + 80))   y=$((${y} + 80))
345   done   done
346    
347     for i in ${plugin_list}
348     do
349     # abort if empty
350     [[ -z ${i} ]] && continue
351    
352     evaluate_table cfg_plugins "where serial='${ALX_SERIAL}' and id='${i}'"
353     if [[ -x ${ALX_PLUGINS}/${cfg_plugins_plugin}/plugin.sh ]]
354     then
355     eval $(${ALX_PLUGINS}/${cfg_plugins_plugin}/plugin.sh menuitem)
356    
357     # abort if name or exec is empty
358     [[ -z ${PLUGIN_MENUITEM_NAME} ]] && continue
359     [[ -z ${PLUGIN_MENUITEM_EXEC} ]] && continue
360    
361     # new line if x > xres
362     if [ ${x} -ge ${xres} ]
363     then
364     x=50
365     y=$((${y} + 80))
366     fi
367    
368     # new row if y > yres
369     if [ ${y} -ge ${yres} ]
370     then
371     x=$((${x} + 120))
372     y=50
373    
374     # re-check x
375     [ ${x} -ge ${xres} ] && x=50
376     fi
377    
378     generate_icon \
379     --name "${PLUGIN_MENUITEM_NAME}" \
380     --command "${progsh_path}/$(fix_whitespaces ${PLUGIN_MENUITEM_NAME})" \
381     --icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${PLUGIN_MENUITEM_NAME}).png" \
382     --dest "${dest}/$(fix_whitespaces ${PLUGIN_MENUITEM_NAME}).lnk" \
383     --xres "${x}" \
384     --yres "${y}" \
385     --default-icon "default_item.png"
386    
387     y=$((${y} + 80))
388     fi
389    
390     # unset all variables
391     unset PLUGIN_MENUITEM_NAME
392     unset PLUGIN_MENUITEM_EXEC
393     unset PLUGIN_MENUITEM_PARAM
394     unset PLUGIN_MENUITEM_WORKDIR
395     unset PLUGIN_MENUITEM_ICON
396     done
397    
398     # add shutdown, reboot icons
399     for i in shutdown reboot
400     do
401     # new line if x > xres
402     if [ ${x} -ge ${xres} ]
403     then
404     x=50
405     y=$((${y} + 80))
406     fi
407    
408     # new row if y > yres
409     if [ ${y} -ge ${yres} ]
410     then
411     x=$((${x} + 120))
412     y=50
413    
414     # re-check x
415     [ ${x} -ge ${xres} ] && x=50
416     fi
417    
418     case ${i} in
419     shutdown) name="Herunterfahren" ;;
420     reboot) name="Neustarten" ;;
421     esac
422    
423     generate_icon \
424     --name "${name}" \
425     --command "/usr/lib/alxconfig-ng/bin/user_${i}.sh" \
426     --icon "${ALX_SESSIONS_ICONS}/${i}.png" \
427     --dest "${dest}/${i}.lnk" \
428     --xres "${x}" \
429     --yres "${y}" \
430     --icon-width "40" \
431     --icon-height "40"
432    
433     y=$((${y} + 80))
434     done
435    
436   # last but not least gen a icon with some sys informations   # last but not least gen a icon with some sys informations
437   local sysinfo   local sysinfo
# Line 314  generate_all_desktop_icons() Line 455  generate_all_desktop_icons()
455   --name "${sysinfo}" \   --name "${sysinfo}" \
456   --command "exit 0" \   --command "exit 0" \
457   --icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \   --icon "${ALX_SESSIONS_ICONS}/sysinfo.png" \
458   --dest "${ALX_UNPRIV_HOME}/.xtdesktop/sysinfo.lnk" \   --dest "${dest}/sysinfo.lnk" \
459   --xres "${xres}" \   --xres "${xres}" \
460   --yres "${yres}" \   --yres "${yres}" \
461   --icon-width "1" \   --icon-width "1" \
# Line 328  config_sessions() Line 469  config_sessions()
469   local all_other_ids   local all_other_ids
470   local CONFIG   local CONFIG
471   local screensaver_passwd_cmd   local screensaver_passwd_cmd
472     local fbinit
473     local fbkeys
474     local progsh_path
475    
476     progsh_path="${ALX_UNPRIV_HOME}/.alxprogs"
477    
478   # get all session ids from database   # get all session ids from database
479   all_ses_ids=$(mysqldo "select id from cfg_sessions where serial='${ALX_SERIAL}'")   all_ses_ids=$(mysqldo "select id from cfg_sessions where serial='${ALX_SERIAL}'")
480   # get all other_menutiem ids from database   # get all other_menuitem ids from database
481   all_other_ids=$(mysqldo "select id from cfg_other_menuitems where serial='${ALX_SERIAL}'")   all_other_ids=$(mysqldo "select id from cfg_other_menuitems where serial='${ALX_SERIAL}'")
482     # get all plugin ids from database
483     all_plugin_ids=$(mysqldo "select id from cfg_plugins where serial='${ALX_SERIAL}'")
484    
485   # get screensaver settings   # get screensaver settings
486   evaluate_table cfg_screensaver   evaluate_table cfg_screensaver
487   # get autostart settings   # get autostart settings
488   evaluate_table cfg_autostart   evaluate_table cfg_autostart
489     # get current color depth
490     evaluate_table cfg_graphic
491    
492   # now setup fluxbox for user station   # now setup fluxbox for user station
493    
# Line 348  config_sessions() Line 498  config_sessions()
498   # now generate fluxbox config files   # now generate fluxbox config files
499    
500   # fluxbox main config   # fluxbox main config
501   cat ${ALX_SKELETONS}/fluxbox/init > ${ALX_UNPRIV_HOME}/.fluxbox/init   if [ -f ${ALX_SKELETONS}/fluxbox/init ]
502     then
503     fbinit="${ALX_SKELETONS}/fluxbox/init"
504     else
505     fbinit="/usr/share/fluxbox/init"
506     fi
507     cat ${fbinit} > ${ALX_UNPRIV_HOME}/.fluxbox/init
508    
509   # fluxbox autostart   # fluxbox autostart
  cat ${ALX_SKELETONS}/fluxbox/apps > ${ALX_UNPRIV_HOME}/.fluxbox/apps  
   
510   CONFIG="${ALX_UNPRIV_HOME}/.fluxbox/apps"   CONFIG="${ALX_UNPRIV_HOME}/.fluxbox/apps"
511     # do not show decorations on messages generated with xmessage
512     if [ -x /usr/bin/xmessage ]
513     then
514     addconfig '[app] (xmessage)'
515     addconfig ' [Deco] {NONE}'
516     addconfig '[end]'
517     fi
518     # add icon utility
519     [ -x /usr/bin/idesk ] && addconfig '[startup] {nohup idesk > /dev/null &}'
520     # add numlock utility
521     [ -x /usr/bin/numlockx ] && addconfig '[startup] {nohup numlockx on &}'
522    
523   # add screensaver   # add screensaver
524   if [[ ! -z ${cfg_screensaver_screensaver} ]] && [[ ! -z ${cfg_screensaver_screensaver_timeout} ]]   if [[ ! -z ${cfg_screensaver_screensaver} ]] && [[ ! -z ${cfg_screensaver_screensaver_timeout} ]]
525   then   then
# Line 367  config_sessions() Line 533  config_sessions()
533   addconfig "[startup] {nohup xautolock -time ${cfg_screensaver_timeout} -locker 'xlock -mode ${cfg_screensaver_screensaver} ${screensaver_passwd_cmd}' > /dev/null &}"   addconfig "[startup] {nohup xautolock -time ${cfg_screensaver_timeout} -locker 'xlock -mode ${cfg_screensaver_screensaver} ${screensaver_passwd_cmd}' > /dev/null &}"
534   fi   fi
535    
536     # add plugins autostart
537     for i in ${all_plugin_ids}
538     do
539     evaluate_table cfg_plugins "where serial='${ALX_SERIAL}' and id='${i}'"
540     if [[ -x ${ALX_PLUGINS}/${cfg_plugins_plugin}/plugin.sh ]]
541     then
542     eval $(${ALX_PLUGINS}/${cfg_plugins_plugin}/plugin.sh autostart)
543    
544     if [[ ${PLUGIN_AUTOSTART} = 1 ]]
545     then
546     addconfig "[startup] {${progsh_path}/$(fix_whitespaces ${PLUGIN_MENUITEM_NAME}) &}"
547     fi
548     # unset all variables
549     unset PLUGIN_AUTOSTART
550     unset PLUGIN_MENUITEM_NAME
551     fi
552     done
553    
554   # add autostart session   # add autostart session
555   if [[ ! -z ${cfg_autostart_session} ]]   if [[ ! -z ${cfg_autostart_session} ]]
556   then   then
557   addconfig "[startup] {nohup nice -n 19 wfica ${ALX_ICA_SESSIONS}/$(fix_whitespaces ${cfg_autostart_session}) &}"   # sleep one second to wait until busybox is fully initialized and the screen is really centered
558     addconfig "[startup] {sleep 1 && ${progsh_path}/$(fix_whitespaces ${cfg_autostart_session}) &}"
559   fi   fi
560    
561   # fluxbox hotkeys   # fluxbox hotkeys
562   cat ${ALX_SKELETONS}/fluxbox/keys > ${ALX_UNPRIV_HOME}/.fluxbox/keys   if [ -f ${ALX_SKELETONS}/fluxbox/keys ]
563     then
564     fbkeys="${ALX_SKELETONS}/fluxbox/keys"
565     else
566     fbkeys="/usr/share/fluxbox/keys"
567     fi
568     cat ${fbkeys} > ${ALX_UNPRIV_HOME}/.fluxbox/keys
569    
570   # generate a fluxbox menu   # generate a fluxbox menu
571   CONFIG="${ALX_UNPRIV_HOME}/.fluxbox/menu"   CONFIG="${ALX_UNPRIV_HOME}/.fluxbox/menu"
# Line 388  config_sessions() Line 579  config_sessions()
579   # add a newline (maybe there is no crlf in the header)   # add a newline (maybe there is no crlf in the header)
580   addconfig   addconfig
581    
582     # delete all progs
583     [ -d ${progsh_path} ] && rm -rf ${progsh_path}
584     install -d ${progsh_path}
585    
586   # first generate session files   # first generate session files
587   for i in ${all_ses_ids}   for i in ${all_ses_ids}
588   do   do
589   evaluate_table cfg_sessions "where serial='${ALX_SERIAL}' and id='${i}'"   evaluate_table cfg_sessions "where serial='${ALX_SERIAL}' and id='${i}'"
590   generate_ica_session_file \  
591   --session "${cfg_sessions_session}" \   # generate STOREFRONT/PNABROWSE compatible session
592   --filename "$(fix_whitespaces ${cfg_sessions_filename})" \   case "${cfg_sessions_browseradrs}" in
593   --username "${cfg_sessions_username}" \   "http://"*|"https://"* )
594   --password "${cfg_sessions_password}" \   # generate STOREFRONT/PNABROWSE compatible session
595   --domain "${cfg_sessions_domain}" \   generate_storefront_sh \
596   --server "${cfg_sessions_browseradrs}"   --session "${cfg_sessions_session}" \
597     --filename "$(fix_whitespaces ${cfg_sessions_filename})" \
598     --username "${cfg_sessions_username}" \
599     --password "${cfg_sessions_password}" \
600     --domain "${cfg_sessions_domain}" \
601     --server "${cfg_sessions_browseradrs}"
602     ;;
603     *)
604     # generate ICA compatible session
605     generate_ica_session_file \
606     --session "${cfg_sessions_session}" \
607     --filename "$(fix_whitespaces ${cfg_sessions_filename})" \
608     --username "${cfg_sessions_username}" \
609     --password "${cfg_sessions_password}" \
610     --domain "${cfg_sessions_domain}" \
611     --server "${cfg_sessions_browseradrs}" \
612     --colordepth "${cfg_graphic_depth}"
613     # gen prog startup wrapper
614     generate_program_sh \
615     --name "$(fix_whitespaces ${cfg_sessions_filename})" \
616     --exec "wfica-launcher" \
617     --param "${ALX_ICA_SESSIONS}/$(fix_whitespaces ${cfg_sessions_filename})" \
618     --dest "${progsh_path}/$(fix_whitespaces ${cfg_sessions_filename})" \
619     "${workdir}"
620     ;;
621     esac
622    
623   # fluxbox menusession   # fluxbox menusession
624   addconfig "[exec] (${cfg_sessions_session}) {nice -n 19 wfica ${ALX_ICA_SESSIONS}/$(fix_whitespaces ${cfg_sessions_filename})}"   addconfig "[exec] (${cfg_sessions_session}) {${progsh_path}/$(fix_whitespaces ${cfg_sessions_filename})}"
625   done   done
626    
  # delete all progs  
  progsh_path="${ALX_UNPRIV_HOME}/.alxprogs"  
  [ -d ${progsh_path} ] && rm -rf ${progsh_path}  
  install -d ${progsh_path}  
   
627   # add other menuitems   # add other menuitems
628   for i in ${all_other_ids}   for i in ${all_other_ids}
629   do   do
# Line 436  config_sessions() Line 651  config_sessions()
651   addconfig "[exec] (${cfg_other_menuitems_name}) {${progsh_path}/$(fix_whitespaces ${cfg_other_menuitems_name})} ${cfg_other_menuitems_icon}"   addconfig "[exec] (${cfg_other_menuitems_name}) {${progsh_path}/$(fix_whitespaces ${cfg_other_menuitems_name})} ${cfg_other_menuitems_icon}"
652   done   done
653    
654     # add plugins
655     for i in ${all_plugin_ids}
656     do
657     evaluate_table cfg_plugins "where serial='${ALX_SERIAL}' and id='${i}'"
658     if [[ -x ${ALX_PLUGINS}/${cfg_plugins_plugin}/plugin.sh ]]
659     then
660     eval $(${ALX_PLUGINS}/${cfg_plugins_plugin}/plugin.sh menuitem)
661    
662     # abort if name or exec is empty
663     [[ -z ${PLUGIN_MENUITEM_NAME} ]] && continue
664     [[ -z ${PLUGIN_MENUITEM_EXEC} ]] && continue
665    
666     # now echo config line for fluxbox-menu
667     # make it "configureable" :p
668     if [[ -n ${PLUGIN_MENUITEM_WORKDIR} ]]
669     then
670     workdir="--workdir ${PLUGIN_MENUITEM_WORKDIR}"
671     fi
672     if [[ -n ${PLUGIN_MENUITEM_ICON} ]]
673     then
674     PLUGIN_MENUITEM_ICON="<${PLUGIN_MENUITEM_ICON}>"
675     fi
676    
677     # gen prog startup wrapper
678     generate_program_sh \
679     --name "${PLUGIN_MENUITEM_NAME}" \
680     --exec "${PLUGIN_MENUITEM_EXEC}" \
681     --param "${PLUGIN_MENUITEM_PARAM}" \
682     --dest "${progsh_path}/$(fix_whitespaces ${PLUGIN_MENUITEM_NAME})" \
683     "${workdir}"
684    
685     addconfig "[exec] (${PLUGIN_MENUITEM_NAME}) {${progsh_path}/$(fix_whitespaces ${PLUGIN_MENUITEM_NAME})} ${PLUGIN_MENUITEM_ICON}"
686     fi
687    
688     # unset all variables
689     unset PLUGIN_MENUITEM_NAME
690     unset PLUGIN_MENUITEM_EXEC
691     unset PLUGIN_MENUITEM_PARAM
692     unset PLUGIN_MENUITEM_WORKDIR
693     unset PLUGIN_MENUITEM_ICON
694     done
695    
696   # fluxbox menu footer   # fluxbox menu footer
697   cat ${ALX_SKELETONS}/fluxbox/menu.footer >> ${ALX_UNPRIV_HOME}/.fluxbox/menu   cat ${ALX_SKELETONS}/fluxbox/menu.footer >> ${ALX_UNPRIV_HOME}/.fluxbox/menu
698   # add a newline (maybe there is no crlf in the footer)   # add a newline (maybe there is no crlf in the footer)
699   addconfig   addconfig
700    
701   # now it's a good time to generate *all* icons :)   # now it's a good time to generate *all* icons :)
702   generate_all_desktop_icons "${all_ses_ids}" "${all_other_ids}"   generate_all_desktop_icons "${all_ses_ids}" "${all_other_ids}" "${all_plugin_ids}"
703    
704   # fix permissions   # fix permissions
705   chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}   chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}
706   chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox   chown ${ALX_UNPRIV_USER}:${ALX_UNPRIV_GROUP} ${ALX_UNPRIV_HOME}/.fluxbox
707   chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox   chmod 0755 ${ALX_UNPRIV_HOME}/.fluxbox
708   chmod 0755 ${ALX_UNPRIV_HOME}/.xtdesktop   chmod 0755 ${ALX_UNPRIV_HOME}/.idesktop
  chmod 0644 ${ALX_UNPRIV_HOME}/.xtdeskrc  
709  }  }

Legend:
Removed from v.2161  
changed lines
  Added in v.6765