summaryrefslogtreecommitdiff
path: root/stowdots
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-07-11 21:48:56 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-07-11 21:48:56 +0200
commita857f247d9a71b88a4f0dbcfa95e3679e8456e70 (patch)
tree846ddcd8117be1505a970e3638fc65d0ec954a2e /stowdots
parent75196520b3d6a0e60db1d03a64aaa0655cc4f202 (diff)
parent6251d6ba1054cd79387f0f88ce25d2f4bc8b78c4 (diff)
Merge branch 'main' of debuc.com:dotfiles
Diffstat (limited to 'stowdots')
-rwxr-xr-xstowdots38
1 files changed, 20 insertions, 18 deletions
diff --git a/stowdots b/stowdots
index 918a76c..7fecfde 100755
--- a/stowdots
+++ b/stowdots
@@ -3,12 +3,11 @@
trap "exit 1" EXIT INT
test "$(id -u)" != 0 && sudo=sudo
-die () {
+die() {
echo "$@" 1>&2
}
-if ! stow --version > /dev/null 2>&1
-then
+if ! stow --version >/dev/null 2>&1; then
die "stow not installed or not found."
die "install stow? (arch)"
die -n ">"
@@ -16,8 +15,7 @@ then
$sudo pacman -Sy stow ||
exit 1
fi
-if [ -n "${MACH:=$1}" ]
-then
+if [ -n "${MACH:=$1}" ]; then
die "I: stowing for $MACH"
else
die "E: MACH not set"
@@ -29,20 +27,24 @@ fi
mkdir -p "$HOME/bin"
mkdir -p "$HOME/.config"
+mkdir -p "$HOME/.local/share"
ln -sf "$(realpath "$0")" $HOME/bin/
cd "$(dirname "$(realpath "$0")")" || exit 1
case "$MACH" in
- "desktop" | "d" | "laptop" | "l")
- stow -d bin/ -t "$HOME/bin" -R common guiscripts menuscripts extra
- stow -d config/ -t "$HOME/.config" -R essentials common extra X theme wayland
- stow -d config/ -t "$HOME/" -R home
- ;;
- "server" | "s")
- stow -d bin/ -t "$HOME/bin" -R common serverscripts menuscripts
- stow -d config/ -t "$HOME/.config" -R essentials common
- stow -d config/ -t "$HOME/" -R home
- ;;
- *)
- die "E: invalid value for 'MACH'"
- break
+"desktop" | "d" | "laptop" | "l")
+ stow -d bin/ -t "$HOME/bin" -R common guiscripts menuscripts extra
+ stow -d config/ -t "$HOME/.config" -R essentials common extra X theme wayland
+ stow -d config/ -t "$HOME/" -R home
+ stow share/ -t "$HOME/.local/share"
+ ;;
+"server" | "s")
+ stow -d bin/ -t "$HOME/bin" -R common serverscripts menuscripts
+ stow -d config/ -t "$HOME/.config" -R essentials common
+ stow -d config/ -t "$HOME/" -R home
+ stow share/ -t "$HOME/.local/share"
+ ;;
+*)
+ die "E: invalid value for 'MACH'"
+ break
+ ;;
esac