diff options
Diffstat (limited to '.local/bin/x')
-rwxr-xr-x | .local/bin/x | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/.local/bin/x b/.local/bin/x index 9c6e9f6..653cfb0 100755 --- a/.local/bin/x +++ b/.local/bin/x @@ -1,11 +1,12 @@ -#! /usr/bin/env sh +#!/bin/sh +# Return to homedir 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" ] + if [ ! -f "$HOME/.local/etc/x/xinit.d/$1.rc" ] then printf "%s\n" "no valid config for $1" >&2 exit 1 @@ -14,9 +15,15 @@ then # 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" + # Add layout script, if one exists + if [ -f "$HOME/.local/etc/x/layout.sh" ] + then + cat "$HOME/.local/etc/x/layout.sh" >> "$HOME/.xinitrc" + fi + + # Add the base configuration + cat -- "$HOME/.local/etc/x/xinitrc" "$HOME/.local/etc/x/xinit.d/$1.rc" \ + >> "$HOME/.xinitrc" fi # Make sure the xinitrc exists, just in case @@ -27,4 +34,4 @@ then fi # start the X session -startx +exec startx |