-
Notifications
You must be signed in to change notification settings - Fork 2
/
xinitrc
98 lines (75 loc) · 2.03 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
97
98
#!/bin/sh
# X11
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
# detect displays;
# note: $() subshell syntax not supported in sh
xrandrq=`xrandr -q`
dp1=`echo "$xrandrq" | awk '/^DP-1/ {print $2}'`
edp1=`echo "$xrandrq" | awk '/^eDP-?1/ {print $2}'`
dvi1=`echo "$xrandrq" | awk '/^DVI-D-1/ {print $2}'`
hdmi0=`echo "$xrandrq" | awk '/^HDMI-?0/ {print $2}'`
hdmi1=`echo "$xrandrq" | awk '/^HDMI-?1/ {print $2}'`
# large cursor
if [ "$HOSTNAME" = "titan" ]; then
xsetroot -xcf /usr/share/icons/whiteglass/cursors/left_ptr 64
fi
# laptop + monitor
if [ "$edp1" = "connected" ]; then
# eDP1 / eDP-1
edp1_id=`xrandr -q | awk '/^eDP-?1/ {print $1}'`
if [ "$hdmi1" = "connected" ]; then
xrandr --output HDMI1 --auto --same-as $edp1_id
xrandr --output $edp1_id --off
elif [ "$dp1" = "connected" ]; then
xrandr --output DP-1 --auto --same-as $edp1_id
xrandr --output $edp1_id --off
fi
fi
# two monitors (HDMI/DVI)
if [ "$dvi1" = "connected" ]; then
xrandr --output DVI-D-1 --auto --left-of HDMI-A-0
fi
# enable restart X
setxkbmap -option terminate:ctrl_alt_bksp
# fonts
#xset +fp /usr/share/fonts/local
#xset fp rehash
# siji font support
xset +fp /home/keith/.fonts
xset fp rehash
# load Xresources
xrdb -merge ~/.Xresources
# java tiling window manager fix
export _JAVA_AWT_WM_NONREPARENTING=1
# map caps to escape
if [ -s ~/.Xmodmap ]; then
xmodmap ~/.Xmodmap
fi
# sync clipboard
autocutsel -fork &
# sync primary
autocutsel -fork -s PRIMARY &
# fcitx
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS=@im=fcitx
# fcitx (kitty support)
export GLFW_IM_MODULE=ibus
# gnome keyring
eval $(gnome-keyring-daemon --start)
export SSH_AUTH_SOCK
# pywal
wal -R
# ssh-agent
eval `pkill ssh-agent && ssh-agent`
# sway
#exec sway >> ~/.cache/sway/stdout 2>> ~/.cache/sway/stderr
# gnome
#XDG_SESSION_TYPE=wayland dbus-run-session gnome-session
# i3
exec i3 >> ~/.cache/i3/stdout 2>> ~/.cache/i3/stderr