summaryrefslogtreecommitdiff
path: root/stowdots
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-22 15:01:02 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-04-22 15:01:02 +0200
commit7807010408107049fac497e0b5151d137d4f3c35 (patch)
tree6f6be69fa7510ee166982f758b4c6cc9561deaf9 /stowdots
parent5c7c5d8de9cad7f88d96d0be4e3b6b84ad0f623c (diff)
renamed stowcmds
Diffstat (limited to 'stowdots')
-rwxr-xr-xstowdots41
1 files changed, 41 insertions, 0 deletions
diff --git a/stowdots b/stowdots
new file mode 100755
index 0000000..5116c73
--- /dev/null
+++ b/stowdots
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+trap "echo -ne '\nbye'; exit 1" EXIT
+
+if ! stow --version > /dev/null 2>&1
+then
+ echo "E: stow not installed or not found" 1>&2
+ exit 1
+fi
+if [ -n "${MACH:=$1}" ]
+then
+ echo "I: stowing for $MACH"
+else
+ echo "E: MACH not set" 1>&2
+ echo "Enter valid value for 'MACH'"
+ echo "d(esktop) | s(erver) | l(aptop)"
+ echo -n ">"
+ read MACH
+fi
+
+ln -sf "$(realpath $0)" "$(realpath $0 | xargs dirname)"/bin/common/stowdots
+cd "$(realpath $0 | xargs dirname)" || exit 1
+case "$MACH" in
+ "desktop" | "d" | "laptop" | "l")
+ mkdir -p "$HOME/bin"
+ stow -d bin/ -t "$HOME/bin" -R common guiscripts menuscripts extra
+ mkdir -p "$HOME/.config"
+ stow -d config/ -t "$HOME/.config" -R essentials common extra X theme xdg hyprland
+ stow -d config/ -t "$HOME/" -R home
+ ;;
+ "server" | "s")
+ mkdir -p "$HOME/bin"
+ stow -d bin/ -t "$HOME/bin" -R common serverscripts menuscripts
+ mkdir -p "$HOME/.config"
+ stow -d config/ -t "$HOME/.config" -R essentials common
+ stow -d config/ -t "$HOME/" -R home
+ ;;
+ *)
+ echo "E: invalid value for 'MACH'" 1>&2
+ break
+esac