#!/bin/bash # die if no display was found xinfo &> /dev/null || exit 1 # eval xorg_width and xorg_height eval $(xinfo) # fallback [[ -z ${xorg_width} ]] && xorg_width="1024" [[ -z ${xorg_height} ]] && xorg_width="768" if [ -e @@SYSCONFDIR@@/os-release ] then osversion=$(source @@SYSCONFDIR@@/os-release; echo "${ID}-${Version_ID}") elif [ -e @@SYSCONFDIR@@/mageversion ] then osversion="alx-$(< @@SYSCONFDIR@@/mageversion)" else osversion="alx-UNKNOWN" fi if [[ -n $(type -P mcore-serial) ]] then serial="$(mcore-serial)" else serial="UNKNOWN" fi sysinfo="Hostname: $(hostname) Serial: #${serial} OS: ${osversion} Kernel: $(uname -r)" #len_sysinfo="${#sysinfo}" # calculate icon xpos # xorg_width / 2 - len_sysinfo / 2 #xpos="$(( ${xorg_width} / 2 - ${len_sysinfo} / 2 ))" # xorg_width / 2 xpos="$(( ${xorg_width} / 2 ))" # calculate icon ypos # xorg_height - text_height; text_height=22 pixel ypos="$(( ${xorg_height} - 22))" [ -d ~/.idesktop ] || install -d ~/.idesktop cat > ~/.idesktop/sysinfo.lnk << EOF table Icon Caption: ${sysinfo} Command: exit 0 Icon: @@PIXMAPSDIR@@/sysinfo.png X: ${xpos} Y: ${ypos} Width: 1 Height: 1 end EOF