aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2022-08-13 19:10:42 +1200
committerTom Ryder <tom@sanctum.geek.nz>2022-08-13 19:13:33 +1200
commitad1ce4ce7da62d2bf23c1f6ed60919b55ed02f58 (patch)
tree34fac791df7df9d56fbd2d5532b6376e0fa554b3
parentAdjust power management settings (diff)
downloaddotfiles-ad1ce4ce7da62d2bf23c1f6ed60919b55ed02f58.tar.gz
dotfiles-ad1ce4ce7da62d2bf23c1f6ed60919b55ed02f58.zip
Refactor X startup to accomodate different methods
-rw-r--r--x/xsession.sh49
-rw-r--r--x/xsessionrc6
2 files changed, 39 insertions, 16 deletions
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..48f2a725
--- /dev/null
+++ b/x/xsessionrc
@@ -0,0 +1,6 @@
+# X startup commands go in here if they should run on every X session, whether
+# classic `startx` or a modern DE like LightDM
+
+# Update BROWSER, since .profile has already set this to a curses browser
+# shellcheck disable=SC2034
+BROWSER=x-www-browser