aboutsummaryrefslogtreecommitdiff
path: root/x/xsession.sh
blob: 483707e6ff27dd15db66a1e5cecc2bee8acd6182 (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
# Custom X session to fit into Debian's way of doing things

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

# 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
#
xargs xrandr \
    < "${XDG_CONFIG_HOME:-"$HOME"/.config}"/xrandr/config
xargs xwallpaper \
    < "${XDG_CONFIG_HOME:-"$HOME"/.config}"/xwallpaper/config

# 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

# Start a couple of daemons if we can; it's OK if they don't exist, but log
# the failed attempt to start them to the errors file.
## compton: Display compositor
compton -b &
## dunst: Message display (libnotify)
dunst &

# 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