-
-
Notifications
You must be signed in to change notification settings - Fork 7
/
.xsession
executable file
·93 lines (80 loc) · 3.2 KB
/
.xsession
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
#!/usr/bin/env bash
shopt -s nullglob
# prevent launching pkttyagent and being stopped by SIGTTIN
exec </dev/null
# ssh-agent is setgid and drops LD_* vars, reload them
. "$HOME"/.xsessionrc
for xres in $(run-parts --list /etc/X11/Xresources); do xrdb -merge "$xres"; done
for xres in ~/.Xresources.d/*.{ad,m4}; do xrdb -cpp m4 -merge "$xres"; done
if xrandr --listproviders | grep -q NVIDIA-0; then
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
fi
layout-normal
~/bin/.xlayout/post.sh
xset r rate 200 25
xset b off
xset s 480 5
xset dpms 600 600 600
xsetroot -cursor_name left_ptr
setxkbmap ${_LISKIN_NVIDIA:+-option terminate:ctrl_alt_bksp}
xmodmap ~/.Xmodmap
if liskin-dmi-product 20VX 21HE; then xmodmap ~/.Xmodmap-thinkpad-6row; fi
if liskin-dmi-product QEMU; then xmodmap ~/.Xmodmap-qemu-utm; fi
if xi_touchpad=$(
xinput list --name-only | grep -i -m 1 'touchpad$'
) && xi_trackpoint=$(
xinput list --name-only | grep -i -m 1 'trackpoint$'
); then
xinput set-prop "$xi_touchpad" 'libinput Natural Scrolling Enabled' 1 || :
xinput set-prop "$xi_touchpad" 'libinput Middle Emulation Enabled' 1 || :
xinput set-prop "$xi_touchpad" 'libinput Disable While Typing Enabled' 0 || :
if liskin-dmi-product 20VX; then
xinput set-prop "$xi_touchpad" 'libinput Accel Speed' 0.6 || :
xinput set-prop "$xi_trackpoint" 'libinput Accel Speed' -0.5 || :
elif liskin-dmi-product 20K7; then
xinput set-prop "$xi_touchpad" 'libinput Accel Speed' 0.3 || :
elif liskin-dmi-product 21HE; then
xinput set-prop "$xi_touchpad" 'libinput Accel Speed' 0.1 || :
xinput set-prop "$xi_trackpoint" 'libinput Accel Speed' -0.7 || :
fi
fi
if liskin-dmi-product QEMU; then
xinput set-prop 'QEMU QEMU USB Mouse' 'libinput Accel Speed' -0.5 || :
xinput set-prop 'QEMU QEMU USB Mouse' 'libinput Natural Scrolling Enabled' 1 || :
xinput set-prop 'QEMU QEMU USB Tablet' 'libinput Natural Scrolling Enabled' 1 || :
xinput set-prop 'spice vdagent tablet' 'libinput Natural Scrolling Enabled' 1 || :
fi
liskin-thinkpad-battery update-xmobar
xprop -root -f _XMOBAR_DND 8u -set _XMOBAR_DND ""
{
echo DISPLAY="$DISPLAY"
echo XDG_SEAT="$XDG_SEAT"
echo XDG_SESSION_ID="$XDG_SESSION_ID"
echo XDG_VTNR="$XDG_VTNR"
} >"$XDG_RUNTIME_DIR"/xsession-env-"$DISPLAY"
if [[ "$(loginctl show-user --property=Display "$USER")" == "Display=$XDG_SESSION_ID" ]]; then
systemctl --user import-environment SSH_AUTH_SOCK
systemd-run \
--quiet \
--collect --wait \
--user --slice="session.slice" --unit="xmonad-$XDG_SESSION_ID-$DISPLAY.service" \
--property="EnvironmentFile=$XDG_RUNTIME_DIR/xsession-env-$DISPLAY" \
--property="Environment=_LISKIN_SESSION_PRIMARY=1" \
--property="Requires=graphical-session-pre.target" \
--property="After=graphical-session-pre.target" \
--property="BindsTo=graphical-session.target" \
--property="BindsTo=xmonad@$DISPLAY.target" \
--property="OnFailure=failsafe-xsecurelock@$DISPLAY.service" \
--property="Restart=on-failure" \
-- xmonad
else
systemd-run \
--quiet \
--collect --scope \
--user --slice="session.slice" --unit="xmonad-$XDG_SESSION_ID-$DISPLAY.scope" \
--property="BindsTo=xmonad@$DISPLAY.target" \
-- xmonad
fi
systemctl --user start "failsafe-xsecurelock@$DISPLAY.service"
sleep 2