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

revision 2405 by niro, Fri Jan 10 13:36:38 2014 UTC revision 2406 by niro, Mon Aug 31 09:00:31 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  # die if no display was found  # die if no display was found
8  xinfo &> /dev/null || exit 1  xinfo &> /dev/null || exit 1
9    
10  # eval xorg_width and xorg_height  # eval xorg_width and xorg_height
11  eval $(xinfo)  eval $(x11runas xinfo)
12    
13  # fallback  # fallback
14  [[ -z ${xorg_width} ]] && xorg_width="1024"  [[ -z ${xorg_width} ]] && xorg_width="1024"
# Line 27  else Line 31  else
31   serial="UNKNOWN"   serial="UNKNOWN"
32  fi  fi
33    
34  sysinfo="Hostname: $(hostname) Serial: #${serial} OS: ${osversion} Kernel: $(uname -r)"  ipaddr="$(iface_for_remote_addr $(dns_to_ip alx-control.dom-aka-nt.intern))"
35    if [[ -z ${ipaddr} ]]
36    then
37     ipaddr="No network"
38    else
39    fi
40    
41    sysinfo="Hostname: $(hostname) Serial: #${serial} IP: ${ipaddr} OS: ${osversion} Kernel: $(uname -r)"
42  #len_sysinfo="${#sysinfo}"  #len_sysinfo="${#sysinfo}"
43    
44  # calculate icon xpos  # calculate icon xpos
# Line 40  xpos="$(( ${xorg_width} / 2 ))" Line 51  xpos="$(( ${xorg_width} / 2 ))"
51  # xorg_height - text_height; text_height=22 pixel  # xorg_height - text_height; text_height=22 pixel
52  ypos="$(( ${xorg_height} - 22))"  ypos="$(( ${xorg_height} - 22))"
53    
54  [ -d ~/.idesktop ] || install -d ~/.idesktop  # generate icon info
55    ${MCORE_LIBDIR}/idesk-generate-icon-info \
56  cat > ~/.idesktop/sysinfo.lnk << EOF   --add \
57  table Icon   --name "sysinfo" \
58    Caption: ${sysinfo}   --command "exit 0" \
59    Command: exit 0   --icon "sysinfo.png" \
60    Icon: @@PIXMAPSDIR@@/sysinfo.png   --xpos "${xpos}" \
61    X: ${xpos}   --ypos "${ypos}" \
62    Y: ${ypos}   || die "adding icon-info"
   Width: 1  
   Height: 1  
 end  
 EOF  

Legend:
Removed from v.2405  
changed lines
  Added in v.2406