aboutsummaryrefslogtreecommitdiff
path: root/x/xsession.sh
blob: 3475c0bdb2ab6adf38518606617e8959e21fb670 (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
50
51
52
53
54
55
56
57
58
# Custom X session to fit into Debian's way of doing things

# Monitor and wallpaper setup is very machine-specific, and isn't versioned in
# here.  Neither xrandr(1) nor xwallpaper(1) have config files, so we fake it
# with xargs and looking for a file with argument tokens to read in
# XDG_CONFIG_HOME, which will almost always be:
#
# - ~/.config/xrandr/config
# - ~/.config/xwallpaper/config
#
# We wait for the monitor setup to finish before proceeding, but we can do
# other things while we wait for the wallpaper to be drawn thereon.
#
xargs xrandr \
    < "${XDG_CONFIG_HOME:-"$HOME"/.config}"/xrandr/config
xargs xwallpaper \
    < "${XDG_CONFIG_HOME:-"$HOME"/.config}"/xwallpaper/config &

# Set a few keyboard map options:
#
# - Remap Caps Lock as another Control key.
# - Remap right Alt as a Compose key.
# - Kill X server with Ctrl+Alt+Backspace.
#
setxkbmap \
    -option caps:ctrl_modifier \
    -option compose:ralt \
    -option terminate:ctrl_alt_bksp \
    &

# Set a few X user preferences:
#
# - No bell
# - No power management
# - Quick curved mouse acceleration
# - No screen saver
#
xset \
    b off \
    -dpms \
    mouse 5/2 0 \
    s off \
    &

# Update browser, since .profile set this to a curses browser on login
# shellcheck disable=SC2034
BROWSER=x-www-browser

# Load all supplementary scripts in ~/.xsession.d
for sh in "$HOME"/.xsession.d/*.sh ; do
    [ -e "$sh" ] || continue
    . "$sh"
done
unset -v sh

# Start Debian's configured window manager now that everything's ready; at the
# time of writing, this is normally i3wm
exec x-window-manager