]> git.madduck.net Git - etc/xsession.git/blob - .bin/xconfig

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

handle xinput xconfig
[etc/xsession.git] / .bin / xconfig
1 #!/bin/sh
2 set -eu
3
4 config_xkb() {
5   echo -n >&2 " xkb"
6   local XKBDIR; XKBDIR="$HOME/.xkb"
7   local XKBMAPFILE; XKBMAPFILE="$XKBDIR/keymap/$(hostname --fqdn)"
8   [ -r "$XKBMAPFILE" ] || XKBMAPFILE="${XKBMAPFILE%/*}/default"
9
10   xkbcomp -w3 -I"$XKBDIR" "$XKBMAPFILE" "${DISPLAY%%.*}"
11 }
12
13 config_xset() {
14   echo -n >&2 " xset-basics"
15   # i hate this bell!!!
16   xset b 0
17
18   # power saving mode of the screen
19   xset dpms 300 300 300
20
21   # typematic repeat rate
22   xset r rate 255 47
23 }
24
25 config_xsetroot() {
26   echo -n >&2 " xroot"
27   xsetroot -default
28 }
29
30 load_xresources() {
31   echo -n >&2 " Xresources"
32   xrdb -load ~/.Xresources
33 }
34
35 config_xinput() {
36   echo -n >&2 " xinput"
37   xinput set-float-prop "TPPS/2 IBM TrackPoint" "Device Accel Constant Deceleration" 0.7 2>/dev/null || :
38
39   WIRELESS_RECEIVER=$(xinput | sed -rne 's,.*Lenovo USB Receiver[[:space:]]+id=([[:digit:]]+).*pointer.*,\1,p')
40   if [ -n "$WIRELESS_RECEIVER" ]; then
41     xinput set-button-map $WIRELESS_RECEIVER 1 2 3 4 5 6 7 0 0 0 >/dev/null || :
42   fi
43 }
44
45 echo -n >&2 "Configuring X ["
46 [ -n "${SKIP_XKB:-}" ] || config_xkb
47 [ -n "${SKIP_XSET:-}" ] || config_xset
48 [ -n "${SKIP_XSETROOT:-}" ] || config_xsetroot
49 [ -n "${SKIP_XRESOURCES:-}" ] || load_xresources
50 [ -n "${SKIP_XINPUT:-}" ] || config_xinput
51 echo >&2 " ] done."