237 |
[ -z "${command}" ] && return 1 |
[ -z "${command}" ] && return 1 |
238 |
|
|
239 |
# use some defaults for icon, dest, {x,y}res |
# use some defaults for icon, dest, {x,y}res |
240 |
[ -z "${xres}" ] && xres=20 |
[ -z "${xres}" ] && xres=30 |
241 |
[ -z "${yres}" ] && xres=20 |
[ -z "${yres}" ] && xres=30 |
242 |
[ -z "${dest}" ] && dest="${ALX_UNPRIV_HOME}/.xtdesktop/${name}.lnk" |
[ -z "${dest}" ] && dest="${ALX_UNPRIV_HOME}/.xtdesktop/${name}.lnk" |
243 |
if [ -z "${icon}" ] || [ ! -f "${icon}" ] |
if [ -z "${icon}" ] || [ ! -f "${icon}" ] |
244 |
then |
then |
298 |
|
|
299 |
|
|
300 |
# default settings |
# default settings |
301 |
declare -i x=20 |
declare -i x=30 |
302 |
declare -i y=20 |
declare -i y=30 |
303 |
|
|
304 |
# first all ica sessions |
# first all ica sessions |
305 |
local count=${#ALX_SESSIONS[*]} |
local count=${#ALX_SESSIONS[*]} |
316 |
|
|
317 |
# new line if x > xres |
# new line if x > xres |
318 |
if [ ${x} -ge ${xres} ];then |
if [ ${x} -ge ${xres} ];then |
319 |
x=20 |
x=30 |
320 |
y=$((${y} + 80)) |
y=$((${y} + 80)) |
321 |
fi |
fi |
322 |
|
|
323 |
# new row if y > yres |
# new row if y > yres |
324 |
if [ ${y} -ge ${yres} ];then |
if [ ${y} -ge ${yres} ];then |
325 |
x=$((${x} + 120)) |
x=$((${x} + 120)) |
326 |
y=20 |
y=30 |
327 |
|
|
328 |
# re-check x |
# re-check x |
329 |
[ ${x} -ge ${xres} ] && x=20 |
[ ${x} -ge ${xres} ] && x=30 |
330 |
fi |
fi |
331 |
|
|
332 |
# ica icons |
# ica icons |
356 |
|
|
357 |
# new line if x > xres |
# new line if x > xres |
358 |
if [ ${x} -ge ${xres} ];then |
if [ ${x} -ge ${xres} ];then |
359 |
x=20 |
x=30 |
360 |
y=$((${y} + 80)) |
y=$((${y} + 80)) |
361 |
fi |
fi |
362 |
|
|
363 |
# new row if y > yres |
# new row if y > yres |
364 |
if [ ${y} -ge ${yres} ];then |
if [ ${y} -ge ${yres} ];then |
365 |
x=$((${x} + 120)) |
x=$((${x} + 120)) |
366 |
y=20 |
y=30 |
367 |
|
|
368 |
# re-check x |
# re-check x |
369 |
[ ${x} -ge ${xres} ] && x=20 |
[ ${x} -ge ${xres} ] && x=30 |
370 |
fi |
fi |
371 |
|
|
372 |
generate_icon \ |
generate_icon \ |