aboutsummaryrefslogtreecommitdiff
path: root/x
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2022-08-14 14:03:52 +1200
committerTom Ryder <tom@sanctum.geek.nz>2022-08-14 16:20:22 +1200
commit02d8c2c6784b49765c0a279f07148adfd6ab8f5d (patch)
tree5e3beec52b7443049d552dce14a31e684fa7b3a4 /x
parentRevert "Refactor X startup to accomodate differ... (diff)
downloaddotfiles-02d8c2c6784b49765c0a279f07148adfd6ab8f5d.tar.gz
dotfiles-02d8c2c6784b49765c0a279f07148adfd6ab8f5d.zip
Reorganize X11 startup file again
I swear I'm going to figure this out.
Diffstat (limited to 'x')
-rw-r--r--x/xprofile3
-rw-r--r--x/xsession.sh49
-rw-r--r--x/xsessionrc17
3 files changed, 50 insertions, 19 deletions
diff --git a/x/xprofile b/x/xprofile
deleted file mode 100644
index 1750c70b..00000000
--- a/x/xprofile
+++ /dev/null
@@ -1,3 +0,0 @@
-# Read ~/.profile to set up environment when starting X with a display manager
-# like LightDM, since we didn't have a TTY login arrange that already
-. "$HOME"/.profile
diff --git a/x/xsession.sh b/x/xsession.sh
index 6b298048..e0552315 100644
--- a/x/xsession.sh
+++ b/x/xsession.sh
@@ -1,8 +1,20 @@
-# Custom X session to fit into Debian's way of doing things
-
-# Load common environment variables
-# shellcheck disable=SC1091
-. "$HOME"/.xprofile
+#
+# Custom i3wm X session to fit into Debian's way of doing things, for use with
+# startx(1) or xinit(1). From Debian's `man 1 startx` (xinit dpkg 1.4.0-1):
+#
+# > Note that in the Debian system, what many people traditionally put in the
+# > .xinitrc file should go in .xsession instead; this permits the same X
+# > environment to be presented whether startx, xdm, or xinit is used to start
+# > the X session. All discussion of the .xinitrc file in the xinit(1) manual
+# > page applies equally well to .xsession.
+#
+# This turns out to be important for having the X session wrappers in /etc/X11
+# on Debian-derived systems do things like dbus daemon and accessibility setup.
+#
+# At the time of writing, none of my machines running X are using anything
+# other than the Debian-derived X startup script layout, so we'll just conform
+# to that unless and until I actually need to abstract this.
+#
# Monitor and wallpaper setup is very machine-specific, and isn't versioned in
# here. Neither xrandr(1) nor xwallpaper(1) have config files, so we fake it
@@ -30,14 +42,20 @@ xset \
mouse 5/2 0 \
s off
-# Start a few daemons if we can; it's OK if they don't exist, but log the
-# failed attempt to start them to the errors file.
-## compton: Display compositor
-compton -b &
-## dunst: Message display (libnotify)
-dunst &
-## unclutter: Hide mouse after inactivity (but not on root window)
-unclutter -idle 5 &
+# Start a few daemons if we can; it's OK if any of these don't exist, but we'll
+# log the failed attempt to start them to the errors file, as a hint that
+# I might want to install them.
+#
+(
+ # Display compositor
+ compton
+ # Message display (libnotify)
+ dunst
+ # PulseAudio system tray tool
+ pasystray
+ # Hide mouse after inactivity
+ unclutter
+) &
# Load all supplementary scripts in ~/.xsession.d
for sh in "$HOME"/.xsession.d/*.sh ; do
@@ -46,6 +64,5 @@ for sh in "$HOME"/.xsession.d/*.sh ; do
done
unset -v sh
-# Start Debian's configured window manager now that everything's ready; at the
-# time of writing, this is normally i3wm
-exec x-window-manager
+# Become an i3 window manager process, having set everything else up
+exec i3
diff --git a/x/xsessionrc b/x/xsessionrc
new file mode 100644
index 00000000..8d46ed0b
--- /dev/null
+++ b/x/xsessionrc
@@ -0,0 +1,17 @@
+# X startup commands go in here if they should run on every X session, whether
+# classic `startx` or a modern DE like LightDM. xsessionrc is a dpkg-specific
+# file.
+#
+
+# If $ENV isn't set, then this X startup process wasn't started from somewhere
+# beneath a login shell that sources ~/.profile to set up environment variables
+# yet, most likely because it's being opened by a display manager, so we'll do
+# it here.
+#
+if [ -z "$ENV" ] ; then
+ . "$HOME"/.profile
+fi
+
+# Update BROWSER, since .profile has already set this to a curses browser
+# shellcheck disable=SC2034
+BROWSER=x-www-browser