#! /usr/bin/env sh cd || exit 3 # If an argument is given, check if we have an xinitrc for that if [ -n "$1" ] then if [ ! -f "$HOME/.config/xinit.d/$1.rc" ] then printf "%s\n" "no valid config for $1" >&2 exit 1 fi # Remove the old config rm -f -- "$HOME/.xinitrc" # Create the new config cat -- "$HOME/.config/xinit.d/xinitrc" "$HOME/.config/xinit.d/$1.rc" \ > "$HOME/.xinitrc" fi # Make sure the xinitrc exists, just in case if [ ! -f "$HOME/.xinitrc" ] then printf "%s\n" "no xinitrc" >&2 exit 2 fi # start the X session startx