308 |
y=$((${y} + 80)) |
y=$((${y} + 80)) |
309 |
done |
done |
310 |
|
|
311 |
|
# add shutdown, reboot icons |
312 |
|
for i in shutdown reboot |
313 |
|
do |
314 |
|
# abort if empty |
315 |
|
[[ -z ${i} ]] && continue |
316 |
|
|
317 |
|
# new line if x > xres |
318 |
|
if [ ${x} -ge ${xres} ] |
319 |
|
then |
320 |
|
x=30 |
321 |
|
y=$((${y} + 80)) |
322 |
|
fi |
323 |
|
|
324 |
|
# new row if y > yres |
325 |
|
if [ ${y} -ge ${yres} ] |
326 |
|
then |
327 |
|
x=$((${x} + 120)) |
328 |
|
y=30 |
329 |
|
|
330 |
|
# re-check x |
331 |
|
[ ${x} -ge ${xres} ] && x=30 |
332 |
|
fi |
333 |
|
|
334 |
|
case ${i} in |
335 |
|
shutdown) name="Herunterfahren" |
336 |
|
reboot) name="Neustarten" |
337 |
|
esac |
338 |
|
|
339 |
|
generate_icon \ |
340 |
|
--name "${name}" \ |
341 |
|
--command "/usr/lib/alxconfig-ng/bin/user_${i}.sh" \ |
342 |
|
--icon "${ALX_SESSIONS_ICONS}/${i}.png" \ |
343 |
|
--dest "${dest}/${i}.lnk" \ |
344 |
|
--xres "${x}" \ |
345 |
|
--yres "${y}" |
346 |
|
|
347 |
|
y=$((${y} + 80)) |
348 |
|
done |
349 |
|
|
350 |
# last but not least gen a icon with some sys informations |
# last but not least gen a icon with some sys informations |
351 |
local sysinfo |
local sysinfo |
352 |
local hostname |
local hostname |
383 |
local all_other_ids |
local all_other_ids |
384 |
local CONFIG |
local CONFIG |
385 |
local screensaver_passwd_cmd |
local screensaver_passwd_cmd |
386 |
|
local fbinit |
387 |
|
local fbkeys |
388 |
|
|
389 |
# get all session ids from database |
# get all session ids from database |
390 |
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}'") |
407 |
# now generate fluxbox config files |
# now generate fluxbox config files |
408 |
|
|
409 |
# fluxbox main config |
# fluxbox main config |
410 |
cat ${ALX_SKELETONS}/fluxbox/init > ${ALX_UNPRIV_HOME}/.fluxbox/init |
if [ -f ${ALX_SKELETONS}/fluxbox/init ] |
411 |
|
then |
412 |
|
fbinit="${ALX_SKELETONS}/fluxbox/init" |
413 |
|
else |
414 |
|
fbinit="/usr/share/fluxbox/init" |
415 |
|
fi |
416 |
|
cat ${fbinit} > ${ALX_UNPRIV_HOME}/.fluxbox/init |
417 |
|
|
418 |
# fluxbox autostart |
# fluxbox autostart |
419 |
CONFIG="${ALX_UNPRIV_HOME}/.fluxbox/apps" |
CONFIG="${ALX_UNPRIV_HOME}/.fluxbox/apps" |
450 |
fi |
fi |
451 |
|
|
452 |
# fluxbox hotkeys |
# fluxbox hotkeys |
453 |
cat ${ALX_SKELETONS}/fluxbox/keys > ${ALX_UNPRIV_HOME}/.fluxbox/keys |
if [ -f ${ALX_SKELETONS}/fluxbox/keys ] |
454 |
|
then |
455 |
|
fbkeys="${ALX_SKELETONS}/fluxbox/keys" |
456 |
|
else |
457 |
|
fbkeys="/usr/share/fluxbox/keys" |
458 |
|
fi |
459 |
|
cat ${fbkeys} > ${ALX_UNPRIV_HOME}/.fluxbox/keys |
460 |
|
|
461 |
# generate a fluxbox menu |
# generate a fluxbox menu |
462 |
CONFIG="${ALX_UNPRIV_HOME}/.fluxbox/menu" |
CONFIG="${ALX_UNPRIV_HOME}/.fluxbox/menu" |