aboutsummaryrefslogtreecommitdiff
path: root/install.sh
diff options
context:
space:
mode:
Diffstat (limited to 'install.sh')
-rwxr-xr-xinstall.sh14
1 files changed, 9 insertions, 5 deletions
diff --git a/install.sh b/install.sh
index 4ef204d..29b06cd 100755
--- a/install.sh
+++ b/install.sh
@@ -1,5 +1,8 @@
#!/bin/sh
set -e
+confdir="${XDG_CONFIG_HOME:-$HOME/.config}"
+bindir="${BINDIR:-$HOME/bin}"
+USE_X_SCRIPTS="${USE_X_SCRIPTS:-NO}"
setLink() {
src=""
@@ -33,28 +36,29 @@ for _f in dotfiles/* ; do
setLink -s "$src" -d "$dest"
done
-_nvimdir="$HOME/.config/nvim"
+_nvimdir="${confdir}/nvim"
if ! [ -d "$_nvimdir" ] ; then
mkdir "$_nvimdir"
fi
setLink -s "$(pwd)/dotfiles/nvim/init.lua" -d "$_nvimdir/init.lua"
-_ghosttydir="$HOME/.config/ghostty"
+_ghosttydir="${confdir}/ghostty"
if ! [ -d "$_ghosttydir" ] ; then
mkdir "$_ghosttydir"
fi
setLink -s "$(pwd)/dotfiles/ghostty/config" -d "$_ghosttydir/config"
-if ! [ -d "$HOME/bin" ] ; then mkdir "$HOME/bin" ; fi
+if ! [ -d "$bindir" ] ; then mkdir "$bindir" ; fi
for _f in bin/* ; do
src="$(pwd)/$_f"
- dest="$HOME/bin/$(basename "$_f")"
+ dest="${bindir}/$(basename "$_f")"
setLink -s "$src" -d "$dest"
done
if [ "$(uname)" != "Darwin" ] \
- && [ -n "$DISPLAY" ] && [ "$XDG_SESSION_TYPE" != "wayland" ] ; then
+ && [ -n "$DISPLAY" ] && [ "$XDG_SESSION_TYPE" != "wayland" ] \
+ && [ "$USE_X_SCRIPTS" = "YES" ] ; then
if ! [ -d "$HOME/x" ] ; then mkdir "$HOME/x" ; fi
for _f in x/* ; do