aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/x
diff options
context:
space:
mode:
authorPatrick Spek <p.spek@tyil.nl>2020-07-17 11:30:31 +0200
committerPatrick Spek <p.spek@tyil.nl>2021-08-14 11:59:40 +0200
commitca69a254f8351e0a23c86ee8075a33ec8c7e7503 (patch)
treee21013d177be70c254211c92fc95bd9ecebdb671 /.local/bin/x
parent9f6c0fbbdbd0d60ac629f0c38effd97a3ff48b6b (diff)
Update X configs
Diffstat (limited to '.local/bin/x')
-rwxr-xr-x.local/bin/x19
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