Magellan Linux

Diff of /mcore-src/trunk/mcore-tools/src/modules/idesk/idesk-sysinfo.in

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

mcore-src/trunk/mcore-tools/src/idesk-sysinfo.in revision 2136 by niro, Fri Jan 10 10:13:55 2014 UTC mcore-src/trunk/mcore-tools/src/modules/idesk/idesk-sysinfo.in revision 2417 by niro, Mon Aug 31 11:32:34 2015 UTC
# Line 1  Line 1 
1  #!/bin/bash  #!/bin/bash
2    
3    MCORE_LIBDIR="@@MCORE_LIBDIR@@"
4    source @@SYSCONFDIR@@/mcore/mcore.conf
5    source ${MCORE_LIBDIR}/include/common.global.class
6    
7    if [[ $(whoami) = ${MCORE_UNPRIV_USER} ]]
8    then
9     x11runas=""
10     sudo="sudo"
11    else
12     x11runas="x11runas"
13     sudo=""
14    fi
15    
16  # die if no display was found  # die if no display was found
17  xinfo &> /dev/null || exit 1  ${x11runas} xinfo &> /dev/null || exit 1
18    
19  # eval xorg_width and xorg_height  # eval xorg_width and xorg_height
20  eval $(xinfo)  eval $(${x11runas} xinfo)
21    
22  # fallback  # fallback
23  [[ -z ${xorg_width} ]] && xorg_width="1024"  [[ -z ${xorg_width} ]] && xorg_width="1024"
# Line 27  else Line 40  else
40   serial="UNKNOWN"   serial="UNKNOWN"
41  fi  fi
42    
43  sysinfo="Hostname: $(hostname) Serial: #${serial} OS: ${osversion} Kernel: $(uname -r)"  ipaddr="$(iface_for_remote_addr $(dns_to_ip alx-control.dom-aka-nt.intern))"
44    if [[ -z ${ipaddr} ]]
45    then
46     ipaddr="No network"
47    fi
48    
49    sysinfo="Hostname: $(hostname) Serial: #${serial} IP: ${ipaddr} OS: ${osversion} Kernel: $(uname -r)"
50  #len_sysinfo="${#sysinfo}"  #len_sysinfo="${#sysinfo}"
51    
52  # calculate icon xpos  # calculate icon xpos
# Line 40  xpos="$(( ${xorg_width} / 2 ))" Line 59  xpos="$(( ${xorg_width} / 2 ))"
59  # xorg_height - text_height; text_height=22 pixel  # xorg_height - text_height; text_height=22 pixel
60  ypos="$(( ${xorg_height} - 22))"  ypos="$(( ${xorg_height} - 22))"
61    
62  [ -d ~/.idesktop ] || install -d ~/.idesktop  # generate icon info
63    ${sudo} ${MCORE_LIBDIR}/idesk-generate-icon-info \
64  cat > ~/.idesktop/sysinfo.lnk << EOF   --add \
65  table Icon   --name "${sysinfo}" \
66    Caption: ${sysinfo}   --filename "sysinfo" \
67    Command: exit 0   --command "exit 0" \
68    Icon: @@PIXMAPSDIR@@/sysinfo.png   --icon "sysinfo.png" \
69    X: ${xpos}   --xpos "${xpos}" \
70    Y: ${ypos}   --ypos "${ypos}" \
71    Width: 1   || die "adding icon-info"
   Height: 1  
 end  
 EOF  

Legend:
Removed from v.2136  
changed lines
  Added in v.2417