diff options
author | 2020-04-26 21:01:48 -0700 | |
---|---|---|
committer | 2020-04-26 21:34:57 -0700 | |
commit | 5bb0014265536ee59a9d63625f716257bdd2785c (patch) | |
tree | 90843b8d8f1c1d48440cf1514ff0f045b1e0b2f2 /lib | |
parent | 81c8b04af6f4d7db98be014e10f84dcdfbd363b9 (diff) | |
download | new-dotfiles-5bb0014265536ee59a9d63625f716257bdd2785c.tar.gz new-dotfiles-5bb0014265536ee59a9d63625f716257bdd2785c.zip |
Reorganize xsession and Xresources
- Add xsession. Instead of requiring each of my machines to setup their own
‘.xsession’ add one that should work for all of them.
- Use M4 for the Xresources database. I didn’t want the X11 project to be aware
of all the configuration files that could be added in there and I was able to
figure out how to have it load all of the configuration files in the
‘Xresources.d’ directory. Now each configuration can inject properties into the
X resources database.
- Have ‘.xsession’ load all of the scripts in ‘.config/X11/Xsession.d’. Each
configuration can now inject some script to run when X starts.
- Have ‘.xsession’ load a machine-specific script so that each machine can
override what it does when X starts.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/usr/lib/sh/loading.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/usr/lib/sh/loading.sh b/lib/usr/lib/sh/loading.sh new file mode 100644 index 0000000..47c396a --- /dev/null +++ b/lib/usr/lib/sh/loading.sh @@ -0,0 +1,23 @@ +load_machine_config() { + directory="$1" + path="${HOME}/${directory}/$(hostname).sh" + + # shellcheck source=/dev/null + [ -x "$path" ] && . "$path" + + unset directory + unset path +} + +load_config_directory() { + directory="$1" + path="${HOME}/${directory}" + + if [ -d "${path}" ]; then + for f in "${path}/"?*.sh; do + # shellcheck source=/dev/null + [ -x "$f" ] && . "$f" + done + unset f + fi +} |