summaryrefslogtreecommitdiffstats
path: root/debian/patches/debian/01_debianize_xrdb.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/debian/01_debianize_xrdb.patch')
-rw-r--r--debian/patches/debian/01_debianize_xrdb.patch58
1 files changed, 58 insertions, 0 deletions
diff --git a/debian/patches/debian/01_debianize_xrdb.patch b/debian/patches/debian/01_debianize_xrdb.patch
new file mode 100644
index 0000000..1dced2c
--- /dev/null
+++ b/debian/patches/debian/01_debianize_xrdb.patch
@@ -0,0 +1,58 @@
+From: Laurent Bigonville <bigon@debian.org>
+Date: Thu, 12 Mar 2020 18:05:51 +0100
+Subject: Debianize the 00-xrdb script
+
+In Debian, /etc/X11/Xresources is a directory, processing of ~/.Xresources
+is controlled by /etc/X11/Xsession.options, and xrdb is not a mandatory
+dependency.
+
+Forwarded: not-needed, Debian-specific
+---
+ plugins/xsettings/00-xrdb | 36 +++++++++++++++++++++++++++++++-----
+ 1 file changed, 31 insertions(+), 5 deletions(-)
+
+diff --git a/plugins/xsettings/00-xrdb b/plugins/xsettings/00-xrdb
+index a047e8b..7fc8492 100755
+--- a/plugins/xsettings/00-xrdb
++++ b/plugins/xsettings/00-xrdb
+@@ -1,9 +1,35 @@
+ #!/bin/sh
+
+-userresources=$HOME/.Xresources
+-sysresources=/etc/X11/Xresources
++# This script mimic what /etc/X11/Xsession.d/30x11-common_xresources is doing
++# but for Xwayland
+
+-# merge in defaults
+-[ -r "$sysresources" ] && xrdb -nocpp -merge "$sysresources"
+-[ -r "$userresources" ] && xrdb -merge "$userresources"
++USRRESOURCES=$HOME/.Xresources
++SYSRESOURCES=/etc/X11/Xresources
++OPTIONFILE=/etc/X11/Xsession.options
+
++# read OPTIONFILE
++OPTIONS=$(cat "$OPTIONFILE") || true
++
++has_option() {
++ if [ "${OPTIONS#*
++$1}" != "$OPTIONS" ]; then
++ return 0
++ else
++ return 1
++ fi
++}
++
++if [ -d "$SYSRESOURCES" ] && which xrdb >/dev/null 2>&1; then
++ RESOURCEFILES=$(run-parts --list $SYSRESOURCES)
++ if [ -n "$RESOURCEFILES" ]; then
++ for RESOURCEFILE in $RESOURCEFILES; do
++ xrdb -merge $RESOURCEFILE
++ done
++ fi
++fi
++
++if has_option allow-user-resources && [ -f "$USRRESOURCES" ]; then
++ if which xrdb >/dev/null 2>&1; then
++ xrdb -merge $USRRESOURCES
++ fi
++fi