aboutsummaryrefslogtreecommitdiffstats
path: root/_xinitrc
blob: fcac6a2e4901e17ba7833b08f8822e756bb83a04 (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
# -*- mode: sh; -*-
#
# ~/.xinitrc
#
# Credits:
# [1] ArchWiki - xinitrc
#     https://wiki.archlinux.org/index.php/xinitrc
#
# Aaron LI
# 2016-01-31
#

# source system xinit scripts
if [ -d /etc/X11/xinit/xinitrc.d ] ; then
    for f in /etc/X11/xinit/xinitrc.d/?* ; do
        [ -x "$f" ] && . "$f"
    done
    unset f
fi

# load X resources (do not fork to the background)
[ -e ~/.Xresources ] && xrdb -load ~/.Xresources

# disable beep
xset b off

# disable CapsLock
setxkbmap -option ctrl:nocaps

# gpg-agent
pgrep -x gpg-agent || eval $(gpg-agent --daemon)

# start X session
session=${1:-openbox}
case "${session}" in
    xfce|xfce4)
        exec dbus-launch --exit-with-session startxfce4;;
    openbox)
        # Fix Qt5 application appearance when not running under KDE
        export XDG_CURRENT_DESKTOP=KDE
        exec dbus-launch --exit-with-session openbox-session;;
    *)
        echo "ERROR: unknown session" >/dev/stderr
        ;;
esac

# vim: set ts=8 sw=4 tw=0 fenc=utf-8 ft=sh: #