24 |
xres="${xorg_width}" |
xres="${xorg_width}" |
25 |
yres="${xorg_height}" |
yres="${xorg_height}" |
26 |
|
|
27 |
|
# fallback to 800x600 |
28 |
|
[[ -z ${xres} ]] && xres="800" |
29 |
|
[[ -z ${yres} ]] && xres="600" |
30 |
|
|
31 |
# top left edge of the icon is given in config file |
# top left edge of the icon is given in config file |
32 |
# remove a little bit to simulate the bottom-right edge |
# remove a little bit to simulate the bottom-right edge |
33 |
xres="$(( ${xres} - 120 ))" |
xres="$(( ${xres} - 120 ))" |
38 |
[ -f ${rc} ] && rm -f ${rc} |
[ -f ${rc} ] && rm -f ${rc} |
39 |
install -d ${dest} |
install -d ${dest} |
40 |
|
|
41 |
|
# clean default reboot,shutdown icon info |
42 |
|
for i in shutdown reboot |
43 |
|
do |
44 |
|
if [ -f ${MROOT}/${MCORE_CONFIG_PATH}/icons/info/${i}.${ICON_INFO_SUFFIX} ] |
45 |
|
then |
46 |
|
rm ${MROOT}/${MCORE_CONFIG_PATH}/icons/info/${i}.${ICON_INFO_SUFFIX} |
47 |
|
fi |
48 |
|
done |
49 |
|
|
50 |
# default settings |
# default settings |
51 |
declare -i x=50 |
declare -i x=50 |
52 |
declare -i y=50 |
declare -i y=50 |
54 |
for icon_resource in $(find ${MROOT}/${MCORE_CONFIG_PATH}/icons/info -type f) |
for icon_resource in $(find ${MROOT}/${MCORE_CONFIG_PATH}/icons/info -type f) |
55 |
do |
do |
56 |
# abort if empty |
# abort if empty |
57 |
[[ -z ${i} ]] && continue |
[[ -z ${icon_resource} ]] && continue |
58 |
|
|
59 |
# new line if x > xres |
# new line if x > xres |
60 |
if [ ${x} -ge ${xres} ] |
if [ ${x} -ge ${xres} ] |
73 |
[ ${x} -ge ${xres} ] && x=50 |
[ ${x} -ge ${xres} ] && x=50 |
74 |
fi |
fi |
75 |
|
|
76 |
${MCORE_LIBDIR}/idesk-generate-icon --resource "${icon_resource}" --xres "${x}" --yres "${y}" |
${MCORE_LIBDIR}/idesk-generate-icon --add --resource "${icon_resource}" --xres "${x}" --yres "${y}" |
77 |
|
|
78 |
y=$((${y} + 80)) |
y=$((${y} + 80)) |
79 |
done |
done |
104 |
esac |
esac |
105 |
|
|
106 |
${MCORE_LIBDIR}/idesk-generate-icon \ |
${MCORE_LIBDIR}/idesk-generate-icon \ |
107 |
|
--add \ |
108 |
--name "${name}" \ |
--name "${name}" \ |
109 |
--command "sudo /usr/sbin/${cmd}" \ |
--command "sudo /usr/sbin/${cmd}" \ |
110 |
--icon "${i}.png" \ |
--icon "${i}.png" \ |
117 |
y=$((${y} + 80)) |
y=$((${y} + 80)) |
118 |
done |
done |
119 |
|
|
|
|
|
120 |
# restart idesk |
# restart idesk |
121 |
killall idesk; x11runas "nohup idesk > /dev/null &" |
killall idesk; x11runas "nohup idesk > /dev/null &" |