forked from peikk0/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.xsession
executable file
·87 lines (71 loc) · 2.35 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
#!/bin/sh
exec >"${HOME}/.xsession.log" 2>&1
ENV="${HOME}/.shrc"
export ENV
. ${ENV}
# OpenOffice.org look
OOO_FORCE_DESKTOP=gnome
export OOO_FORCE_DESKTOP
XDG_CURRENT_DESKTOP=GNOME
export XDG_CURRENT_DESKTOP
# Make Java Swing apps less ugly
_JAVA_OPTIONS='-Dawt.useSystemAAFontSettings=on -Dswing.aatext=true -Dswing.defaultlaf=com.sun.java.swing.plaf.gtk.GTKLookAndFeel'
export _JAVA_OPTIONS
# GnuPG
if type gpg-agent >/dev/null; then
echo 'Launching GPG agent...'
eval `gpg-agent --daemon` || echo "Failed to launch GPG agent"
fi
# D-Bus
if [ -z "${DBUS_SESSION_BUS_ADDRESS}" ]; then
if type dbus-launch >/dev/null; then
echo 'Launching D-BUS per-session daemon...'
eval `dbus-launch --sh-syntax --exit-with-session` || echo "Failed to launch D-Bus session daemon"
echo "D-BUS per-session daemon address: ${DBUS_SESSION_BUS_ADDRESS}"
fi
fi
# X ressources
if type xrdb >/dev/null; then
echo 'Loading X ressources...'
xrdb -merge ~/.Xdefaults || echo 'Failed to load X ressources'
fi
# set DPMS and screensaver, disable beep, autorepeat
if type xset >/dev/null; then
echo 'Configuring X...'
xset dpms 600 1200 4200 s 300 600 -b r 66 r rate 400 30 || echo 'Failed to configure X'
fi
# Compose key
if type setxkbmap >/dev/null; then
echo 'Setting keymap...'
setxkbmap -layout us -variant altgr-intl -option compose:menu,caps:escape || echo 'Failed to set keymap'
fi
# pointer
if type xsetroot >/dev/null; then
echo 'Setting pointer...'
xsetroot -cursor_name left_ptr || echo 'Failed to set pointer'
fi
# xautolock
if type xss-lock >/dev/null; then
echo 'Launching xss-lock...'
xset s 280 10
xss-lock --transfer-sleep-lock --notifier "notify-send -u normal -t 10000 -a xss-lock 'Autolocking session in 10 seconds...'" "${HOME}/.i3/lock" || echo 'Failed to launch xss-lock' &
# light-locker
elif type light-locker >/dev/null; then
echo 'Launching light-locker...'
light-locker || echo 'Failed to launch light-locker' &
# xscreensaver
elif type xscreensaver >/dev/null; then
echo 'Launching xscreensaver...'
xscreensaver -nosplash -no-capture-stderr || echo 'Failed to launch xscreensaver' &
fi
# dunst
if type dunst >/dev/null; then
echo 'Launching dunst...'
dunst -conf ~/.dunstrc || echo 'Failed to launch dunst' &
fi
if [ -f ~/.xsession.local ]; then
. ~/.xsession.local
fi
# i3
exec i3 || echo 'Failed to launch i3'
# vim:ft=sh:sw=2: