@ -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
fi
@ -24,6 +24,13 @@ if [ -f $usermodmap ]; then
xmodmap $usermodmap
# 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"
# Start the window manager:
if [ -z "$DESKTOP_SESSION" -a -x /usr/bin/ck-launch-session ]; then
exec ck-launch-session /usr/bin/i3
@ -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
# Create /run/user for all users.
mkdir -p /run/user
chmod 1733 /run/user
# Load the loop device kernel module: