]> gitweb @ CieloNegro.org - sugar.git/blob - dot-files/_xinitrc
42cac6ce1bec888af1a7c0de86e83c9b003559c4
[sugar.git] / dot-files / _xinitrc
1 #!/bin/sh
2
3 userresources=$HOME/.Xresources
4 usermodmap=$HOME/.Xmodmap
5 sysresources=/usr/pkg/lib/X11/xinit/.Xresources
6 sysmodmap=/usr/pkg/lib/X11/xinit/.Xmodmap
7
8 # merge in defaults and keymaps
9 if [ -d "/usr/local/lib/X11/fonts/Unicode" ]; then
10     xset fp+ /usr/local/lib/X11/fonts/Unicode
11     xset fp rehash
12 fi
13
14 if [ -d "/usr/pkg/lib/X11/fonts/local/" ]; then
15     xset fp+ /usr/pkg/lib/X11/fonts/local/
16     xset fp rehash
17 fi
18
19 if [ -d "/usr/pkg/lib/X11/fonts/intlfonts/" ]; then
20     xset fp+ /usr/pkg/lib/X11/fonts/intlfonts/
21     xset fp rehash
22 fi
23
24 if [ -f $sysresources ]; then
25     xrdb -merge $sysresources
26 fi
27
28 if [ -f $sysmodmap ]; then
29     xmodmap $sysmodmap
30 fi
31
32 if [ -f $userresources ]; then
33     xrdb -merge $userresources
34 fi
35
36 if [ -f $usermodmap ]; then
37     xmodmap $usermodmap
38 fi
39
40 # setup environments
41 if [ -d "/usr/pkg/bin" ]; then
42     PATH="/usr/pkg/bin:$PATH"; export PATH
43 fi
44 if [ -d "/usr/local/bin" ]; then
45     PATH="/usr/local/bin:$PATH"; export PATH
46 fi
47
48 LANG="ja_JP.UTF-8"; export LANG
49 GTK_PATH="/usr/pkg/lib/gtk-2.0"; export GTK_PATH
50 GTK_IM_MODULE="uim"; export GTK_IM_MODULE
51
52 # start some nice programs
53 xhost +localhost
54
55 # Set the mouse speed
56 case `hostname` in
57     aria.cielonegro.org)
58         xset m 5 4;;
59     yukari.cielonegro.org)
60         :xset m '1.5' 2;;
61 esac
62
63 # Disable the beep / bell.
64 xset -b
65
66 # Launch ssh-agent-manager
67 if which ssh-agent-manager 2>&1 >/dev/null; then
68     eval `ssh-agent-manager -s`
69 fi
70
71 # Start X.org auxiliary utilities
72 if which vmware-user-suid-wrapper >/dev/null 2>&1; then
73     echo "Open Virtual Machine Tools is available. Starting..."
74     vmware-user-suid-wrapper
75
76 elif vmware-user >/dev/null 2>&1; then
77     echo "VMWare Tools is available. Starting..."
78     vmware-user &
79
80 elif which VBoxClient >/dev/null 2>&1; then
81     echo "VirtualBox Guest Addon is available. Starting..."
82     VBoxClient --display
83     VBoxClient --clipboard
84 fi
85
86 if which dunst 2>&1; then
87     dunst &
88 fi
89
90 # Start the compositor
91 if which compton >/dev/null 2>&1; then
92     #compton --backend xrender --daemon
93     # FIXME: Compton 5.1 abort(3)'s when --daemon is used.
94     compton --backend xrender &
95 fi
96
97 # Start the window manager
98 echo ".xinitrc is going to exec window manager..."
99 if which quartz-wm 2>&1 >/dev/null; then
100     quartz-wm --only-proxy &
101 fi
102 if which fluxbox >/dev/null 2>&1; then
103     exec fluxbox
104 fi
105 exec twm