summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorSimon Rettberg2024-02-29 16:41:46 +0100
committerSimon Rettberg2024-02-29 16:41:46 +0100
commit3630efdff2f1151b7b9aeb089b0666ddbeb80a9d (patch)
treeec5b0885d626acac2ad87c044e0add2202f1bdda /core
parent[dnbd3-proxy-mode] Make local-switch-service Type=simple (diff)
downloadmltk-3630efdff2f1151b7b9aeb089b0666ddbeb80a9d.tar.gz
mltk-3630efdff2f1151b7b9aeb089b0666ddbeb80a9d.tar.xz
mltk-3630efdff2f1151b7b9aeb089b0666ddbeb80a9d.zip
[xorg] Implement has_option in Xsession
Diffstat (limited to 'core')
-rwxr-xr-xcore/modules/xorg/data/etc/X11/Xsession22
1 files changed, 21 insertions, 1 deletions
diff --git a/core/modules/xorg/data/etc/X11/Xsession b/core/modules/xorg/data/etc/X11/Xsession
index 33a003ac..0f9f051d 100755
--- a/core/modules/xorg/data/etc/X11/Xsession
+++ b/core/modules/xorg/data/etc/X11/Xsession
@@ -5,7 +5,7 @@
# Xsession is executed to start the user's session (as the user)
#
-export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/openslx/sbin:/opt/openslx/bin"
+export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/opt/openslx/sbin:/opt/openslx/bin"
PROGNAME=Xsession
@@ -28,6 +28,26 @@ errormsg () {
# Make sure we source the global profile - needed for ssh-agent, etc.
[ -e "/etc/profile" ] && . "/etc/profile"
+# New kid on the block
+OPTIONFILE=/etc/X11/Xsession.options
+OPTIONS="$(
+ if [ -r "$OPTIONFILE" ]; then
+ cat "$OPTIONFILE"
+ fi
+ if [ -d /etc/X11/Xsession.options.d ]; then
+ run-parts --list --regex '\.conf$' /etc/X11/Xsession.options.d | xargs -d '\n' cat
+ fi
+)"
+
+has_option() {
+ # Ensure that a later no-foo overrides an earlier foo
+ if [ "$(echo "$OPTIONS" | grep -Eo "^(no-)?$1\>" | tail -n 1)" = "$1" ]; then
+ return 0
+ else
+ return 1
+ fi
+}
+
# Workaround to start Xsession. The original Xsession script includes error handling functionality and sources other scrips from the Xsession.d/ directory.
SESSIONDIR="/etc/X11/Xsession.d"