Automatically Removing The AsusLauncher Tabbed Interface After You Log In

The AsusLauncher tabbed interface (the so-called EasyMode) can be annoying, particularly if you decide to use the iceWM menu and toolbar. It would be nice to get rid of it. Unfortunately when booting in EasyMode, AsusLauncher not only sets up the user interface, it also handles the login screen, so if you don't start AsusLauncher you just get logged in automatically without being prompted for a password. This too is irritating…

AsusLauncher has no documentation that I could find and neither could I find the source code, so exactly what it does remains a little mysterious. However examining the AsusLauncher binary with 'strings' shows that AsusLauncher is checking for the existence of a file called /home/user/.doingLogin. I made the not unreasonable assumption that this file exists only while the login process is taking place (certainly it doesn't exist after you are logged in – I checked) and so I wrote a script (stopAsusLauncher) which simply goes into an infinite loop that checks for the existence of this file. As long as the file exists, the script just continues to loop, but as soon as the file no longer exists (ie the login process is complete) the script kills AsusLauncher and then terminates itself. Here's the script:

#!/bin/sh
#
#	stop AsusLauncher 
#
#	call it from /usr/bin/startsimple.sh
#	it will loop forever until you log in at which point it
#	will kill the AsusLauncher process and terminate
#
while true
do
	[ ! -f /home/user/.doingLogin ] && \
		kill `ps xa | grep AsusLauncher | \
			awk '$5 != "grep" {print $1}'` >/dev/null 2>&1 \
			&& exit
done

If you include a call to this script in /usr/bin/startsimple.sh (the script that actually starts AsusLauncher) you will see a normal EasyMode login screen but once you have logged in, the tabbed interface will not be there. Magic!

Here are the relevant bits of /usr/bin/startsimple.sh:

.
.
.
#
#	only run AsusLauncher if we are booting
#	with fastinit
#
PID1=`ps -p 1 -o comm=`
[ $PID1 = fastinit ] && /opt/xandros/bin/AsusLauncher &
.
.
.
(sleep 3; /usr/bin/keyboardstatus) &
(sleep 8; /opt/xandros/bin/start_netserv) &
(sleep 16; /usr/local/bin/asusosd) &
sudo rm /tmp/nologin
#
#	once we are logged in, stop AsusLauncher
#
[ $PID1 = fastinit ] && /usr/local/bin/stopAsusLauncher &
.
.
.

The position of the call to stopAsusLauncher seems to be important. If you put it too early in the sequence, /home/user/.doingLogin won't have been created yet and AsusLauncher will terminate immediately before the login prompt appears. This is not a good idea. Hence I put the call close to the end of /usr/bin/startsimple.sh, just after the call that removes /tmp/nologin (logins are not allowed while /tmp/nologin exists so it seems logical to start checking whether or not to stop AsusLauncher only from the moment when logins ARE allowed). It seems to work nicely there, though you may get a brief glimpse of the tabbed interface as you log on…