#!/bin/sh

#
# Copyright (c) 2000 Lars Bernhardsson, see README for licence details
#
# sample.xsession - Login script for larswm
#
# This is an example of how to run a session with a program in the background
# feeding the status bar of larswm. It takes care of killing the background
# job when larswm exits.
#

# Check if ssh-agent is available.
SSHAGENT=
[ -x /usr/bin/ssh-agent ] && SSHAGENT="/usr/bin/ssh-agent"

# Load keymap mods if you need them. I use this in Solaris to change
# the keypad to produce the same keysyms as XFree86.
# The file sample.xmodmaprc contains my keyboard remapping.
[ -f $HOME/.xmodmaprc ] && xmodmap $HOME/.xmodmaprc

# Set background
xsetroot -solid darkslategray

# Set background on 2nd screen
# xsetroot -display :0.1 -solid darkslategray

# Start a couple of tools
xbiff -geometry 64x64-0-0 &
xload -geometry 64x64-70-0 &

# Start a background job that feeds date/time to larswm
# and remember the pid so we can kill it later.
# See the file sample.barinfo for a more elaborate example
# that shows stock quotes in addition to date and time.
larsclock &
BGPID=$!

# Start larswm.
$SSHAGENT larswm

# When larswm exits, kill the background job just in case
kill $BGPID

# All done
exit 0
