From ca69a254f8351e0a23c86ee8075a33ec8c7e7503 Mon Sep 17 00:00:00 2001 From: Patrick Spek Date: Fri, 17 Jul 2020 11:30:31 +0200 Subject: Update X configs --- .local/bin/x | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to '.local/bin/x') 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 -- cgit v1.1