aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-12-15 14:21:52 +1300
committerTom Ryder <tom@sanctum.geek.nz>2016-12-15 14:21:52 +1300
commitd235ffc6b1192662b86005cb6ce45866ffb12ac2 (patch)
tree482ab690e4868e40cb44f3ebdf5281f8141ae0e1
parentAdd an issue about fc (diff)
downloaddotfiles-d235ffc6b1192662b86005cb6ce45866ffb12ac2.tar.gz
dotfiles-d235ffc6b1192662b86005cb6ce45866ffb12ac2.zip
Use .d directory for .xinitrc subscripts
-rw-r--r--Makefile2
-rw-r--r--X/xinitrc37
-rw-r--r--X/xinitrc.d/browser.sh3
-rw-r--r--X/xinitrc.d/dunst.sh2
-rw-r--r--X/xinitrc.d/mpdlrc.sh2
-rw-r--r--X/xinitrc.d/redshift.sh2
-rw-r--r--X/xinitrc.d/ssh.sh5
-rw-r--r--X/xinitrc.d/urxvt.sh2
-rw-r--r--X/xinitrc.d/xbindkeys.sh2
-rw-r--r--X/xinitrc.d/xkb.sh4
-rw-r--r--X/xinitrc.d/xrbg.sh2
11 files changed, 31 insertions, 32 deletions
diff --git a/Makefile b/Makefile
index 363f9e19..595a600b 100644
--- a/Makefile
+++ b/Makefile
@@ -371,10 +371,12 @@ install-wyrd :
install-x :
install -m 0755 -d -- \
"$(HOME)"/.config \
+ "$(HOME)"/.xinitrc.d \
"$(HOME)"/.Xresources.d
install -pm 0644 -- X/redshift.conf "$(HOME)"/.config/redshift.conf
install -pm 0644 -- X/xbindkeysrc "$(HOME)"/.xbindkeysrc
install -pm 0644 -- X/xinitrc "$(HOME)"/.xinitrc
+ install -pm 0644 -- X/xinitrc.d/* "$(HOME)"/.xinitrc.d
install -pm 0644 -- X/Xresources "$(HOME)"/.Xresources
install -pm 0644 -- X/Xresources.d/* "$(HOME)"/.Xresources.d
diff --git a/X/xinitrc b/X/xinitrc
index 5763d6ca..e0b3d661 100644
--- a/X/xinitrc
+++ b/X/xinitrc
@@ -1,41 +1,14 @@
-# Browser within X is Firefox
-BROWSER=firefox
-export BROWSER
-
-# Set SSH_ASKPASS if we can find one
-if command -v ssh-askpass >/dev/null 2>&1 ; then
- SSH_ASKPASS=$(command -v ssh-askpass)
- export SSH_ASKPASS
-fi
-
# Read X resources
xrdb "$HOME"/.Xresources
# Faster mouse acceleration with a natural threshold
xset m 5/2 0
-# Start dunst(1) to display libnotify messages
-dunst &
-
-# Start mpdlrc-notify-send <https://sanctum.geek.nz/cgit/mpdlrc.git/about/>
-mpdlrc-notify-send &
-
-# Start redshift(1)
-redshift &
-
-# Map Caps Lock as a Ctrl key, use right alt as Compose, kill X server with
-# Ctrl+Alt+Backspace
-# <https://en.wikipedia.org/wiki/Compose_key#Common_compose_combinations>
-setxkbmap -option compose:ralt,ctrl:nocaps,terminate:ctrl_alt_bksp
-
-# Start urxvtd(1)
-urxvtd -o -q &
-
-# Start xbindkeys(1)
-xbindkeys -n &
-
-# Apply a random background image
-xrbg
+# Load all supplementary scripts in ~/.xinitrc.d
+for sh in "$HOME"/.xinitrc.d/*.sh ; do
+ [ -e "$sh" ] && . "$sh"
+done
+unset -v sh
# Start window manager
exec i3
diff --git a/X/xinitrc.d/browser.sh b/X/xinitrc.d/browser.sh
new file mode 100644
index 00000000..84e8a7f2
--- /dev/null
+++ b/X/xinitrc.d/browser.sh
@@ -0,0 +1,3 @@
+# Browser within X is Firefox
+BROWSER=firefox
+export BROWSER
diff --git a/X/xinitrc.d/dunst.sh b/X/xinitrc.d/dunst.sh
new file mode 100644
index 00000000..6aad0c86
--- /dev/null
+++ b/X/xinitrc.d/dunst.sh
@@ -0,0 +1,2 @@
+# Start dunst(1) to display libnotify messages
+dunst &
diff --git a/X/xinitrc.d/mpdlrc.sh b/X/xinitrc.d/mpdlrc.sh
new file mode 100644
index 00000000..1858f790
--- /dev/null
+++ b/X/xinitrc.d/mpdlrc.sh
@@ -0,0 +1,2 @@
+# Start mpdlrc-notify-send <https://sanctum.geek.nz/cgit/mpdlrc.git/about/>
+mpdlrc-notify-send &
diff --git a/X/xinitrc.d/redshift.sh b/X/xinitrc.d/redshift.sh
new file mode 100644
index 00000000..929f564e
--- /dev/null
+++ b/X/xinitrc.d/redshift.sh
@@ -0,0 +1,2 @@
+# Start redshift(1)
+redshift &
diff --git a/X/xinitrc.d/ssh.sh b/X/xinitrc.d/ssh.sh
new file mode 100644
index 00000000..2febe2c6
--- /dev/null
+++ b/X/xinitrc.d/ssh.sh
@@ -0,0 +1,5 @@
+# Set SSH_ASKPASS if we can find one
+if command -v ssh-askpass >/dev/null 2>&1 ; then
+ SSH_ASKPASS=$(command -v ssh-askpass)
+ export SSH_ASKPASS
+fi
diff --git a/X/xinitrc.d/urxvt.sh b/X/xinitrc.d/urxvt.sh
new file mode 100644
index 00000000..c86a3c88
--- /dev/null
+++ b/X/xinitrc.d/urxvt.sh
@@ -0,0 +1,2 @@
+# Start urxvtd(1)
+urxvtd -o -q &
diff --git a/X/xinitrc.d/xbindkeys.sh b/X/xinitrc.d/xbindkeys.sh
new file mode 100644
index 00000000..4dd1e31d
--- /dev/null
+++ b/X/xinitrc.d/xbindkeys.sh
@@ -0,0 +1,2 @@
+# Start xbindkeys(1)
+xbindkeys -n &
diff --git a/X/xinitrc.d/xkb.sh b/X/xinitrc.d/xkb.sh
new file mode 100644
index 00000000..32b7cf9a
--- /dev/null
+++ b/X/xinitrc.d/xkb.sh
@@ -0,0 +1,4 @@
+# Map Caps Lock as a Ctrl key, use right alt as Compose, kill X server with
+# Ctrl+Alt+Backspace
+# <https://en.wikipedia.org/wiki/Compose_key#Common_compose_combinations>
+setxkbmap -option compose:ralt,ctrl:nocaps,terminate:ctrl_alt_bksp
diff --git a/X/xinitrc.d/xrbg.sh b/X/xinitrc.d/xrbg.sh
new file mode 100644
index 00000000..0e4ec278
--- /dev/null
+++ b/X/xinitrc.d/xrbg.sh
@@ -0,0 +1,2 @@
+# Apply a random background image
+xrbg