If you are spoiled using BGInfo of Windows to show some useful information on your desktop, you may try this poorly written but working script that does the same thing.

This was written for SuSe Linux but can be adapted for other distribution. If you happen to make enhancements to this script, please do send me a copy to keep it here so that it is useful to others as well.

Install ImageMagick Utilities

Install ImageMagick utilities. On my SuSe 11 SP1, I used the link given below to get the RPMS. Somehow I did not find them on my SuSe OS DVD but I know that they are available on Fedora image as I use them on my home machine.

wget http://support.ednet.ns.ca/sles/SLE-11-SP1-SDK-x86_64/suse/x86_64/libMagickWand1-6.4.3.6-7.18.x86_64.rpm
wget http://support.ednet.ns.ca/sles/SLE-11-SP1-SDK-x86_64/suse/x86_64/ImageMagick-6.4.3.6-7.18.x86_64.rpm

Set a background image

Right click on your Linux desktop and select Change Desktop Background. Select an image of your choice or copy the image to the /usr/share/backgrounds folder. It may be different on other distributions. Make a copy of this image and keep it somewhere so that the script uses the original image.

Use the script attached

Download script here

#!/bin/bash
# Author : Vikram Khatri vikram [at] zinox [dot] com
#
# Purpose: Add BGInfo like information on Linux Desktop
# File name: liinfo

SCHOME=/root/bin/backup
BGFILE=$SCHOME/sys.info
BG=$SCHOME/bg.png ### This is a generated image with sys information
WALL=/usr/share/backgrounds/backup/wall.png ### This is your original background image
NEWWALL=/usr/share/backgrounds/wall.png ### This is the new background image that you will use

> $BGFILE

   A_UPTIME="                      Uptime : "
 A_HOSTNAME="                   Host Name : "
 A_USERNAME="                   User Name : "
   A_NUMCPU="                  Num of CPU : "
 A_CPUMODEL="                   CPU Model : "
 A_MEMTOTAL="                Total Memory : "
A_OSVERSION="                  OS Version : "
A_IPADDRESS="                  IP Address : "
A_DNSSERVER="                  DNS Server : "
  A_GATEWAY="                     Gateway : "
 A_FREEDISK="             Disk Free Space : "
 A_SOFTWAR1="                                 DB2 10.1"
 A_SOFTWAR2="                                 Optim Performanace Manager 5.1.1"
 A_SOFTWAR3="                                 Data Studio 3.1.1"

B_UPTIME=`procinfo | grep uptime | awk '{print $2}'`
B_HOSTNAME=`hostname`
B_USERNAME=`whoami`
B_NUMCPU=`cat /proc/cpuinfo | grep processor | wc -l`
B_CPUMODEL=`cat /proc/cpuinfo | grep "model name" | awk -F":" '{print $2}' | head -1 | sed -e 's/^ *//'`
B_MEMTOTAL=`cat /proc/meminfo | grep MemTotal | sed -e 's/^ *//' | awk -F":" '{print $2}'`
B_OSVERSION=`uname -srm`
B_IPADDRESS=`/sbin/ifconfig | grep "inet addr" | grep -v 127.0.0.1 | awk '{print $2}' | awk -F":" '{print $2}'` 
B_DNSSERVER=`grep ^nameserver /etc/resolv.conf | awk '{print $2}'` 
B_GATEWAY=`netstat -rn | grep UG | awk '{print $2}'` 
B_FREEDISK=`df -k | grep ^/dev | awk '{print $1" "$4" KB Available"}'`

echo "$A_UPTIME" $B_UPTIME >> $BGFILE
echo "$A_HOSTNAME" $B_HOSTNAME >> $BGFILE
echo "$A_USERNAME" $B_USERNAME >> $BGFILE
echo "$A_OSVERSION" $B_OSVERSION >> $BGFILE
echo "$A_IPADDRESS" $B_IPADDRESS >> $BGFILE
echo "$A_NUMCPU" $B_NUMCPU >> $BGFILE
echo "$A_DNSSERVER" $B_DNSSERVER >> $BGFILE
echo "$A_CPUMODEL" $B_CPUMODEL >> $BGFILE
echo "$A_MEMTOTAL" $B_MEMTOTAL >> $BGFILE
echo "$A_GATEWAY" $B_GATEWAY >> $BGFILE
echo " " >> $BGFILE
echo "$A_SOFTWARE" >> $BGFILE
echo "$A_SOFTWAR1" >> $BGFILE
echo "$A_SOFTWAR2" >> $BGFILE
echo "$A_SOFTWAR3" >> $BGFILE

### The following ImageMagick utility generates an image with the 
### transparent background from the file $BGFILE

cat $BGFILE | \
convert -font Courier-Bold -pointsize 30 \
        -background none \
        -fill white \
        label:@- $BG 

### This utility combines two images and creates a new image

composite -gravity south $BG $WALL $NEWWALL

Add script to run at boot time

These instructions are for SuSe Linux and it may be different on other Linux distributions.

  • Create a file liinfi in /etc/init.d
  • chmod +x liinfo
  • Add folowing entries

    #!/bin/bash
    
    ### BEGIN INIT INFO
    # Provides: liinfo 
    # Required-Start: $network
    # Required-Stop:
    # Default-Start: 3 5
    # Default-Stop: 0 1 2 6
    # Description: Set BGInfo like info on your desktop
    ### END INIT INFO
    
    /root/bin/liinfo
    
    
  • Run chkconfig -a liinfo

 

Add Crontab Entry to refresh

Optionally, if you want your image to be refreshed every 15 minutes, add a crontab entry as shown:

# crontab -e
and add
*/15 * * * * /root/bin/liinfo

and save the file.

 

How it may look?