Browse Source

Set XDG_RUNTIME_DIR correctly

rocket-config
mid-kid 8 years ago
parent
commit
698c6eb9c5
  1. 6
      doinst.sh
  2. 7
      etc/X11/xinit/xinitrc.i3
  3. 4
      etc/rc.d/rc.S

6
doinst.sh

@ -1,14 +1,14 @@
#!/bin/sh #!/bin/sh
config() { config() {
NEW="$1" NEW="$1"
OLD="`dirname $NEW`/`basename $NEW .new`" OLD="$(dirname $NEW)/$(basename $NEW .new)"
ORIGMD5="$2" ORIGMD5="$2"
# If there's no config file by that name, mv it over: # If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then if [ ! -r $OLD ]; then
mv $NEW $OLD 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 rm $NEW
elif [ "$ORIGMD5" ] && [ "`cat $OLD | md5sum`" = "$ORIGMD5 -" ]; then elif [ "$ORIGMD5" ] && [ "$(cat $OLD | md5sum)" = "$ORIGMD5 -" ]; then
mv $OLD $OLD.orig mv $OLD $OLD.orig
mv $NEW $OLD mv $NEW $OLD
fi fi

7
etc/X11/xinit/xinitrc.i3

@ -24,6 +24,13 @@ if [ -f $usermodmap ]; then
xmodmap $usermodmap xmodmap $usermodmap
fi 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: # Start the window manager:
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
exec ck-launch-session /usr/bin/i3 exec ck-launch-session /usr/bin/i3

4
etc/rc.d/rc.S

@ -25,6 +25,10 @@ if [ -d /run ]; then
if ! grep -wq "tmpfs /run tmpfs" /proc/mounts ; then if ! grep -wq "tmpfs /run tmpfs" /proc/mounts ; then
/sbin/mount -v -n -t tmpfs tmpfs /run -o mode=0755 /sbin/mount -v -n -t tmpfs tmpfs /run -o mode=0755
fi fi
# Create /run/user for all users.
mkdir -p /run/user
chmod 1733 /run/user
fi fi
# Load the loop device kernel module: # Load the loop device kernel module:

Loading…
Cancel
Save