More XWilling than meets the eye…

I was configuring XDMCP for some of my linux boxes today, when I noticed that gdm only returns the kernel version, and not some useful info like the amount of users & machine load that Solaris does.

Thats when I realised scouring around The Linux XDMCP HOWTO would be a good idea. GDM provides a method of displaying additional text info as part of the replies. This is done by place a shell script that outputs certain info depending on what you script.

The howto contained a link to a script that gave exactly what I needed.

 #!/bin/sh

#

# $XFree86$
# The output of this script is displayed in the chooser window.
# (instead of "Willing to manage")

load="`uptime|sed -e 's/^.*load[^0-9]*//'`"

nrusers="`who|cut -c 1-8|sort -u|wc -l|sed 's/^[        ]*//'`"

s=""; [ "$nrusers" != 1 ] && s=s

echo "${nrusers} user${s}, load: ${load}"
  1. Just copy the script to /etc/X11/gdm/XWilling
  2. chmod 755 it
  3. Walla!! Users & Load Averages

In this picture here, you can see the difference between the hosts with the XWilling script and those without.

P.S. Don’t let your inner BOFH script something ‘funny’ for your users 😉