From 698c6eb9c50f6f164ecb95d5e0284ac1566afd43 Mon Sep 17 00:00:00 2001 From: mid-kid Date: Fri, 30 Dec 2016 21:38:28 +0100 Subject: [PATCH] Set XDG_RUNTIME_DIR correctly --- doinst.sh | 6 +++--- etc/X11/xinit/xinitrc.i3 | 7 +++++++ etc/rc.d/rc.S | 4 ++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/doinst.sh b/doinst.sh index cf708cb..3cde572 100644 --- a/doinst.sh +++ b/doinst.sh @@ -1,14 +1,14 @@ #!/bin/sh config() { NEW="$1" - OLD="`dirname $NEW`/`basename $NEW .new`" + OLD="$(dirname $NEW)/$(basename $NEW .new)" ORIGMD5="$2" # If there's no config file by that name, mv it over: if [ ! -r $OLD ]; then mv $NEW $OLD - elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy + elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then # toss the redundant copy rm $NEW - elif [ "$ORIGMD5" ] && [ "`cat $OLD | md5sum`" = "$ORIGMD5 -" ]; then + elif [ "$ORIGMD5" ] && [ "$(cat $OLD | md5sum)" = "$ORIGMD5 -" ]; then mv $OLD $OLD.orig mv $NEW $OLD fi diff --git a/etc/X11/xinit/xinitrc.i3 b/etc/X11/xinit/xinitrc.i3 index 407a989..a620c20 100644 --- a/etc/X11/xinit/xinitrc.i3 +++ b/etc/X11/xinit/xinitrc.i3 @@ -24,6 +24,13 @@ if [ -f $usermodmap ]; then xmodmap $usermodmap fi +# Set XDG_RUNTIME_DIR +if [ ! "$XDG_RUNTIME_DIR" ]; then + export XDG_RUNTIME_DIR="/run/user/$(id -u)" + mkdir -p "$XDG_RUNTIME_DIR" + chmod 700 "$XDG_RUNTIME_DIR" +fi + # Start the window manager: if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then exec ck-launch-session /usr/bin/i3 diff --git a/etc/rc.d/rc.S b/etc/rc.d/rc.S index 4af65ef..099cba4 100644 --- a/etc/rc.d/rc.S +++ b/etc/rc.d/rc.S @@ -25,6 +25,10 @@ if [ -d /run ]; then if ! grep -wq "tmpfs /run tmpfs" /proc/mounts ; then /sbin/mount -v -n -t tmpfs tmpfs /run -o mode=0755 fi + + # Create /run/user for all users. + mkdir -p /run/user + chmod 1733 /run/user fi # Load the loop device kernel module: