Patchwork [1/4] x11-common: set XDG_RUNTIME_DIR if it isn't already set

login
register
mail settings
Submitter Ross Burton
Date Jan. 16, 2013, 4:06 p.m.
Message ID <ed75a9a94602e93c220254b57a1311d7f67454ce.1358351050.git.ross.burton@intel.com>
Download mbox | patch
Permalink /patch/42727/
State Accepted
Commit 1e1db8439bac36d66af14a4b41918ad3e19e3657
Headers show

Comments

Ross Burton - Jan. 16, 2013, 4:06 p.m.
Wayland needs this set for the communication pipes, so set a fallback in case it
hasn't already been set.

Signed-off-by: Ross Burton <ross.burton@intel.com>
---
 .../x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh        |   13 +++++++++++++
 1 file changed, 13 insertions(+)
 create mode 100644 meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh

Patch

diff --git a/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh
new file mode 100644
index 0000000..91594b9
--- /dev/null
+++ b/meta/recipes-graphics/x11-common/x11-common/etc/X11/Xsession.d/13xdgbasedirs.sh
@@ -0,0 +1,13 @@ 
+# Minimal/stub implementation of the XDG Base Directory specification.
+# http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
+#
+# Wayland needs XDG_RUNTIME_DIR, so set it to /tmp.  This isn't compliant with
+# the specification (wrong mode, wrong owner) but it's mostly sufficient.
+#
+# In the ideal case where SystemD is booting and userspace is initiated by a
+# SystemD user session this will have been set already, so don't overwrite it.
+
+if [ -z "$XGD_RUNTIME_DIR" ]; then
+	XDG_RUNTIME_DIR="/tmp"
+        export XDG_RUNTIME_DIR
+fi