summaryrefslogtreecommitdiffstats
path: root/.bin/x11-config
blob: 554f00c8228ef46bd803fd8c139ac3395dad7e25 (plain) (blame)
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/sh

set -xe

wallpaper_file="${HOME}/.local/share/dot/wallpaper"
synclient_options="TapButton1=1 \
	TapButton2=3 \
	TapButton3=2 \
	PalmDetect=1 \
	TouchpadOff=0"

# synaptic
if command -v syndaemon; then
	pkill syndaemon && true
	syndaemon -RKd -i 0.1
	synclient ${synclient_options}
fi

# keyboard
xset r rate 250 75
setxkbmap -option compose:ralt

# screen saving
xset s off
xset s noblank
xset -dpms

if [ "$(uname -s)" = "OpenBSD" ]; then
	xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation" 1
	xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Button" 2
	xinput set-prop "/dev/wsmouse" "WS Pointer Wheel Emulation Axes" 6 7 4 5
fi

# background
xsetroot -mod 2 2 -fg white -bg black
xsetroot -grey

monitors="$(xrandr --listactivemonitors | tail -n +2)"
feh_args=""
for i in seq $(echo monitors | wc -l); do
	wallpaper=$(find .local/share/dot -iname "wallpaper*" | shuf -n 1)
	if [ "${wallaper}" ]; then
		feh_args="${feh_args} --bg-fill ${wallpaper} "
	fi
done

if [ "${feh_args}" ]; then
	feh ${feh_args}
fi
remember that computers suck.