-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.xinitrc
115 lines (90 loc) · 2.24 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#!/bin/bash
# getopts
# -------
# Skip startx appended parameter xterm
shift
# POSIX Variable
OPTIND=1 # reset in-case getopts has been previously used in the shell.
# Initialize variables
dpi_level="normal"
window_manager="dwm"
while getopts "d:m:" opt; do
case $opt in
d)
dpi_level=$OPTARG
;;
m)
window_manager=$OPTARG
;;
esac
done
# Unconditional setup
# -------------------
echo "Setting up keymaps"
xmodmap ~/.Xmodmap
echo "Starting `which emacs` daemon"
emacs --daemon
echo "Starting `which redshift-gtk` in background"
redshift-gtk &
echo "Starting `which urxvt` daemon"
urxvtd -q -f -o
pkill gpg-agent
# Setup display based on dpi_level
# --------------------------------
echo "DPI level: $dpi_level"
case "$dpi_level" in
normal)
echo "Loading Xresources"
xrdb -load ~/.Xresources
# Multi-head
echo "Configuring multi-head display"
xrandr --output eDP1 --mode 1920x1080 --output HDMI1 --mode 1920x1080 --scale 1x1 --right-of eDP1
echo "Configuring GNOME scaling factor"
gsettings set org.gnome.desktop.interface scaling-factor 1
case "$window_manager" in
dwm)
echo "Starting `which dunst` notification daemon"
dunst &
;;
gnome)
;;
esac
;;
hi)
echo "Loading Xresources-hidpi"
xrdb -load ~/.Xresources-hidpi
# Single-head
echo "Configuring automatic displays"
xrandr --output eDP1 --auto --output HDMI1 --auto
echo "Configuring GNOME scaling factor"
gsettings set org.gnome.desktop.interface scaling-factor 2
case "$window_manager" in
dwm)
echo "Starting `which dunst` notification daemon"
dunst -config $HOME/.config/dunst/dunstrc-hidpi &
;;
gnome)
;;
esac
;;
esac
# Window manager
# --------------
case "$window_manager" in
dwm)
echo "Starting `which compton` X11 compositor"
compton -fb -D 5
echo "Setting desktop background"
sh ~/.fehbg &
echo "Starting `which xscreensaver` in background"
xscreensaver -no-splash &
while true; do
xsetroot -name "$(date -I'minutes')"
sleep 1m
done &
dbus-launch --exit-with-session dwm
;;
gnome)
dbus-launch --exit-with-session gnome-session
;;
esac