summaryrefslogtreecommitdiff
blob: 4421ccc16de01731c8a3a93bb3a8c4f661f4a1ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/sh
# Awesome Xsession starter, based on Xsession shipped by x11-apps/xinit-1.0.5-r1

# redirect errors to a file in user's home directory if we can
for errfile in "$HOME/.awesome-errors" "${TMPDIR-/tmp}/awesome-$USER" "/tmp/awesome-$USER"
do
	if ( cp /dev/null "$errfile" 2> /dev/null )
	then
		chmod 600 "$errfile"
		exec > "$errfile" 2>&1
		break
	fi
done

userresources=$HOME/.Xresources 
usermodmap=$HOME/.Xmodmap 
userxkbmap=$HOME/.Xkbmap

sysresources=/etc/X11/Xresources 
sysmodmap=/etc/X11/Xmodmap 
sysxkbmap=/etc/X11/Xkbmap

rh6sysresources=/etc/X11/xinit/Xresources 
rh6sysmodmap=/etc/X11/xinit/Xmodmap 


# merge in defaults
for i in "$rh6sysresources" "$sysresources" "$userresources" ; do
	[ -f "$i" ] && xrdb -merge "$i"
done

# merge in keymaps
for i in "$sysxkbmap" "$userxkbmap" ; do
	if [ -f "$i" ]; then
		setxkbmap `cat "$i"`
		XKB_IN_USE=yes
	fi
done

#
# Eeek, this seems like too much magic here
#
if [ -z "$XKB_IN_USE" -a ! -L /etc/X11/X ]; then
	if grep '^exec.*/Xsun' /etc/X11/X > /dev/null 2>&1 && [ -f /etc/X11/XF86Config ]; then
		xkbsymbols=`sed -n -e 's/^[     ]*XkbSymbols[   ]*"\(.*\)".*$/\1/p' /etc/X11/XF86Config /etc/X11/xorg.conf`
		if [ -n "$xkbsymbols" ]; then
			setxkbmap -symbols "$xkbsymbols"
			XKB_IN_USE=yes
		fi
	fi
fi

# xkb and xmodmap don't play nice together
if [ -z "$XKB_IN_USE" ]; then
	for i in "$rh6sysmodmap" "$sysmodmap" "$usermodmap" ; do
		[ -f "$i" ] && xmodmap "$i"
	done
fi

unset XKB_IN_USE

# run all system xinitrc shell scripts.
if [ -d /etc/X11/xinit/xinitrc.d ]; then
	for i in /etc/X11/xinit/xinitrc.d/* ; do
		if [ -x "$i" ]; then
			. "$i"
		fi
	done
fi

exec /usr/bin/awesome

# vim: ft=sh noet ts=4 sw=4: