Annotation of /mcore-src/trunk/mcore-tools/src/modules/idesk/idesk-sysinfo.in
Parent Directory | Revision Log
Revision 2136 -
(hide annotations)
(download)
Fri Jan 10 10:13:55 2014 UTC (10 years, 4 months ago) by niro
Original Path: mcore-src/trunk/mcore-tools/src/idesk-sysinfo.in
File size: 1168 byte(s)
Fri Jan 10 10:13:55 2014 UTC (10 years, 4 months ago) by niro
Original Path: mcore-src/trunk/mcore-tools/src/idesk-sysinfo.in
File size: 1168 byte(s)
-variable pathes
1 | niro | 2103 | #!/bin/bash |
2 | |||
3 | # die if no display was found | ||
4 | xinfo &> /dev/null || exit 1 | ||
5 | |||
6 | # eval xorg_width and xorg_height | ||
7 | eval $(xinfo) | ||
8 | |||
9 | # fallback | ||
10 | [[ -z ${xorg_width} ]] && xorg_width="1024" | ||
11 | [[ -z ${xorg_height} ]] && xorg_width="768" | ||
12 | |||
13 | niro | 2136 | if [ -e @@SYSCONFDIR@@/os-release ] |
14 | niro | 2103 | then |
15 | niro | 2136 | osversion=$(source @@SYSCONFDIR@@/os-release; echo "${ID}-${Version_ID}") |
16 | elif [ -e @@SYSCONFDIR@@/mageversion ] | ||
17 | niro | 2103 | then |
18 | niro | 2136 | osversion="alx-$(< @@SYSCONFDIR@@/mageversion)" |
19 | niro | 2103 | else |
20 | osversion="alx-UNKNOWN" | ||
21 | fi | ||
22 | |||
23 | if [[ -n $(type -P mcore-serial) ]] | ||
24 | then | ||
25 | serial="$(mcore-serial)" | ||
26 | else | ||
27 | serial="UNKNOWN" | ||
28 | fi | ||
29 | |||
30 | sysinfo="Hostname: $(hostname) Serial: #${serial} OS: ${osversion} Kernel: $(uname -r)" | ||
31 | #len_sysinfo="${#sysinfo}" | ||
32 | |||
33 | # calculate icon xpos | ||
34 | # xorg_width / 2 - len_sysinfo / 2 | ||
35 | #xpos="$(( ${xorg_width} / 2 - ${len_sysinfo} / 2 ))" | ||
36 | # xorg_width / 2 | ||
37 | xpos="$(( ${xorg_width} / 2 ))" | ||
38 | |||
39 | # calculate icon ypos | ||
40 | # xorg_height - text_height; text_height=22 pixel | ||
41 | ypos="$(( ${xorg_height} - 22))" | ||
42 | |||
43 | niro | 2108 | [ -d ~/.idesktop ] || install -d ~/.idesktop |
44 | |||
45 | niro | 2103 | cat > ~/.idesktop/sysinfo.lnk << EOF |
46 | table Icon | ||
47 | Caption: ${sysinfo} | ||
48 | Command: exit 0 | ||
49 | niro | 2119 | Icon: @@PIXMAPSDIR@@/sysinfo.png |
50 | niro | 2103 | X: ${xpos} |
51 | Y: ${ypos} | ||
52 | Width: 1 | ||
53 | Height: 1 | ||
54 | end | ||
55 | EOF |