#!/bin/bash export LOGFILE="$LOGDIR/xinitrc.log" mkdir -p "${LOGDIR}/i3" log() { echo "[$(date +%FT%T)] $*" >> "$LOGFILE" } if [ -d /etc/X11/xinit/xinitrc.d ]; then for f in /etc/X11/xinit/xinitrc.d/*; do [ -x "$f" ] && . "$f" done unset f fi [ -f /etc/xprofile ] && source /etc/xprofile [ -f ~/.xprofile ] && source ~/.xprofile start_wm() { log "starting i3" systemctl --user import-environment systemctl --user start windowmanager.target sleep 1 systemctl --user start autostart.target sleep inf } autostart() { log "Starting systemd user target \"autostart.target\"" } exec >> "$LOGFILE" 2>&1 autostart start_wm