Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/idesk/idesk-generate-all-desktop-icons.in

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2366 by niro, Tue Aug 25 10:28:00 2015 UTC revision 2403 by niro, Mon Aug 31 08:03:03 2015 UTC
# Line 24  eval $(x11runas xinfo) Line 24  eval $(x11runas xinfo)
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 ))"
# Line 33  yres="$(( ${yres} - 80 ))" Line 37  yres="$(( ${yres} - 80 ))"
37  [ -d ${dest} ] && rm -rf ${dest}  [ -d ${dest} ] && rm -rf ${dest}
38  [ -f ${rc} ] && rm -f ${rc}  [ -f ${rc} ] && rm -f ${rc}
39  install -d ${dest}  install -d ${dest}
40    chown "${MCORE_UNPRIV_USER}":"${MCORE_UNPRIV_GROUP}" ${dest}
41    
42    # clean default reboot,shutdown icon info
43    for i in shutdown reboot
44    do
45     if [ -f ${MROOT}/${MCORE_CONFIG_PATH}/icons/info/${i}.${ICON_INFO_SUFFIX} ]
46     then
47     rm ${MROOT}/${MCORE_CONFIG_PATH}/icons/info/${i}.${ICON_INFO_SUFFIX}
48     fi
49    done
50    
51  # default settings  # default settings
52  declare -i x=50  declare -i x=50
# Line 41  declare -i y=50 Line 55  declare -i y=50
55  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)
56  do  do
57   # abort if empty   # abort if empty
58   [[ -z ${i} ]] && continue   [[ -z ${icon_resource} ]] && continue
59    
60   # new line if x > xres   # new line if x > xres
61   if [ ${x} -ge ${xres} ]   if [ ${x} -ge ${xres} ]
# Line 60  do Line 74  do
74   [ ${x} -ge ${xres} ] && x=50   [ ${x} -ge ${xres} ] && x=50
75   fi   fi
76    
77   ${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}"
78    
79   y=$((${y} + 80))   y=$((${y} + 80))
80  done  done
# Line 91  do Line 105  do
105   esac   esac
106    
107   ${MCORE_LIBDIR}/idesk-generate-icon \   ${MCORE_LIBDIR}/idesk-generate-icon \
108     --add \
109   --name "${name}" \   --name "${name}" \
110   --command "sudo /usr/sbin/${cmd}" \   --command "sudo /usr/sbin/${cmd}" \
111   --icon "${i}.png" \   --icon "${i}.png" \
# Line 103  do Line 118  do
118   y=$((${y} + 80))   y=$((${y} + 80))
119  done  done
120    
   
121  # restart idesk  # restart idesk
122  killall idesk; x11runas "nohup idesk > /dev/null &"  killall idesk; x11runas "nohup idesk > /dev/null &"

Legend:
Removed from v.2366  
changed lines
  Added in v.2403