-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.xinitrc
96 lines (82 loc) · 2.5 KB
/
.xinitrc
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/usr/bin/env sh
## ~/.xinitrc: graphical shell startup configuration
# persist cursor size on multi-monitor setups
export XCURSOR_SIZE=16
## keymap overrides
! is-ntc-chip || layout='ntc-chip'
## runs once
# ~/.xrandr: invokes optional display overrides
xrandr-cycle -d &
# mangle xkb keyboard layout shortly after startup
{ setxkbmap -model 'pc105' -layout 'us' -option 'caps:super'
for f in ~/.config/xkb/$layout.xkb; do
[ -f "$f" ] && sleep 1 && xkbcomp -merge "$f" $DISPLAY 2> /dev/null
done
} &
# GTK2 theming
cpp -P < ~/.config/gtk/gtk2.conf > ~/.gtkrc-2.0 &
# GTK3 file picker config, generate bookmarks
dconf load '/' < ~/.config/gtk/gtk3.conf &
ln -sf .config/gtk-3.0/bookmarks ~/.gtk-bookmarks &
{ mkdir -p ~/.config/gtk-3.0
IFS='
'
while read -r dir; do
prefix='file://'
[ "${dir%${dir#?}}" = '/' ] || prefix="$prefix$HOME/"
echo "$prefix$dir ${dir##*/}"
done <<- EOF > ~/.config/gtk-3.0/bookmarks
Downloads
Pictures/screenshots
Git
$XDG_RUNTIME_DIR
/tmp
/media
.local
.config
EOF
} &
# disable backspace bell in bash prompt
echo 'set bell-style none' > ~/.inputrc &
## session daemons
# dbus: prevents dbus-specific applications from hanging at startup
# stupid hack: find existing dbus-daemon session handled by systemd
dbus_pid=$(pgrep -u "$(whoami)" dbus-daemon | head -n 1)
export $(tr '\0' '\n' \
< /proc/$dbus_pid/environ | fgrep 'DBUS_SESSION_BUS_ADDRESS')
# fcitx5: IME integration for kana input
export GTK_IM_MODULE='fcitx'
export QT_IM_MODULE='fcitx'
export XMODIFIERS='@im=fcitx'
fcitx5 &
# sxhkd: mangle config at runtime
{ echo "## ${0##*/}: DO NOT EDIT"
for f in default mouse $layout; do
# sxhkd 0.5.x chokes on excess newlines
# ignore misuse of cpp syntax
cpp -P < ~/.config/sxhkd/$f 2> /dev/null | grep .
done
} > ~/.config/sxhkd/sxhkdrc || : && sxhkd &
# pcmanfm: restore versioned config at startup
{ for f in libfm pcmanfm; do
mkdir -p ~/.config/$f
cp ~/.config/fm/$f.conf ~/.config/$f/$f.conf
done
# restore desktop config to every active screen
for f in $(seq 0 $(($(xrandr -q | fgrep -c '*') - 1))); do
cpp -P -D HOME="$HOME" < ~/.config/fm/desktop.conf \
> ~/.config/pcmanfm/default/desktop-items-$f.conf
done
} && pcmanfm -d --desktop &
# ~/.xdecor: describes sources for optional background images
# decorate root window, daemonize callback on display change
xrdb ~/.xresources && {
for f in widgets decor; do
"xwin-$f" &
xeventbind resolution "xwin-$f" &
done
} &
xwin-statusd -qpm | xargs -n 1 xsetroot -name &
urxvtd -o &
lxpolkit &
exec dwm