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 |
{ |
{ |
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 |
|
--environment|-e) shift; environment="$1" ;; |
141 |
esac |
esac |
142 |
shift |
shift |
143 |
done |
done |
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}" |
298 |
|
|
299 |
generate_icon \ |
generate_icon \ |
300 |
--name "${cfg_sessions_session}" \ |
--name "${cfg_sessions_session}" \ |
301 |
--command "wfica-launcher ${ALX_ICA_SESSIONS}/$(fix_whitespaces ${cfg_sessions_filename})" \ |
--command "${progsh_path}/$(fix_whitespaces ${cfg_sessions_filename})" \ |
302 |
--icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_sessions_session}).png" \ |
--icon "${ALX_SESSIONS_ICONS}/$(fix_whitespaces ${cfg_sessions_session}).png" \ |
303 |
--dest "${dest}/$(fix_whitespaces ${cfg_sessions_session}).lnk" \ |
--dest "${dest}/$(fix_whitespaces ${cfg_sessions_session}).lnk" \ |
304 |
--xres "${x}" \ |
--xres "${x}" \ |
555 |
if [[ ! -z ${cfg_autostart_session} ]] |
if [[ ! -z ${cfg_autostart_session} ]] |
556 |
then |
then |
557 |
# sleep one second to wait until busybox is fully initialized and the screen is really centered |
# sleep one second to wait until busybox is fully initialized and the screen is really centered |
558 |
addconfig "[startup] {sleep 1 && wfica-launcher ${ALX_ICA_SESSIONS}/$(fix_whitespaces ${cfg_autostart_session}) &}" |
addconfig "[startup] {sleep 1 && ${progsh_path}/$(fix_whitespaces ${cfg_autostart_session}) &}" |
559 |
fi |
fi |
560 |
|
|
561 |
# fluxbox hotkeys |
# fluxbox hotkeys |
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 |
--colordepth "${cfg_graphic_depth}" |
--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}) {wfica-launcher ${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 |
|
|
[ -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 |