summaryrefslogtreecommitdiff
path: root/dot/xinitrc
blob: fcfa00ca51426b95ebcff50efd3825acd5a9dd0a (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
#!/bin/bash
exec </dev/null >.xsession-errors 2>&1
set -x
# eval $(dbus-autolaunch)
[ "$XDG_RUNTIME_DIR" ] || export XDG_RUNTIME_DIR=/run/user/"$(id -u)"
[ "$DBUS_SESSION_BUS_ADDRESS" ] ||  export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus

USING_GNOME=
if [ -r "$XAUTHORITY" -a ! "$XAUTHORITY" -ef "$HOME"/.Xauthority ]; then
  ln -sf "$XAUTHORITY" "$HOME"/.Xauthority
  XAUTHORITY="$HOME"/.Xauthority
fi
warn() { xmessage ".xinitrc: Warning: $*" & }
xrdb -merge ~/.Xresources || warn "xrdb returned $?"
xbindkeys

# if [ "$USING_GNOME" ]; then
#   xrdb -merge - <<'END' || warn "xrdb returned $?"
# ! apparently gnome is setting the bg/fg color of xterm using other things...
#    xterm*reverseVideo: false
# END
# fi

# no gnome:
setxkbmap -option terminate:ctrl_alt_bksp -option caps:super
# gnome:
gsettings set org.gnome.libgnomekbd.keyboard options "['terminate\tterminate:ctrl_alt_bksp', 'caps\tcaps:super']"

# Disable thinkpad middle-click+trackpoint scrolling
xinput set-prop 'TPPS/2 IBM TrackPoint' 'libinput Scroll Method Enabled' 0 0 0

# Enable tap-to-click
xinput --set-prop --type=int --format=8  "SynPS/2 Synaptics TouchPad" "Synaptics Tap Action" 0 0 0 0 1 2 3
# c.f:
# http://www.mepis.org/docs/en/index.php?title=Configuring_the_touchpad_with_xinput
# pad corners rt rb lt lb tap fingers 1 2 3 (can't simulate more then 2 tap fingers AFAIK) - values: 0=disable 1=left 2=middle 3=right etc. (in FF 8=back 9=forward)


(
  exec xterm -e tmux attach
) &
# xcompmgr -c &
if [ "$USING_GNOME" ]; then
  exec gnome-session-xmonad
else
  (exec xmonad || exec fluxbox) &
fi
exec perl -e 'wait while 1'
xterm # if exec fails