diff options
-rw-r--r-- | stowcmds.sh | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/stowcmds.sh b/stowcmds.sh index 8856f47..b78d4a1 100644 --- a/stowcmds.sh +++ b/stowcmds.sh @@ -1,38 +1,45 @@ #!/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" ] +if [ -n "${MACH:=$1}" ] then echo "I: stowing for $MACH" else echo "E: MACH not set" 1>&2 - exit 1 + echo "Enter valid value for 'MACH'" + echo "d(esktop) | s(erver) | l(aptop)" + echo -n ">" + read MACH fi case "$MACH" in - "desktop") + "desktop" | "d") mkdir -p "$HOME/bin" stow -d bin/ -t "$HOME/bin" -R common dmscripts extra mkdir -p "$HOME/.config" - stow -d config/ -t "$HOME/.config" -R essentials common extra theme X + stow -d config/ -t "$HOME/.config" -R essentials common extra X theme xdg stow -d config/ -t "$HOME/" -R zshrc ;; - "server") + "server" | "s") mkdir -p "$HOME/bin" stow -d bin/ -t "$HOME/bin" -R common mkdir -p "$HOME/.config" stow -d config/ -t "$HOME/.config" -R essentials common stow -d config/ -t "$HOME/" -R zshrc ;; - "laptop") + "laptop" | "l") mkdir -p "$HOME/bin" stow -d bin/ -t "$HOME/bin" -R common dmscripts extra mkdir -p "$HOME/.config" - stow -d config/ -t "$HOME/.config" -R essentials common extra theme hyprland X + stow -d config/ -t "$HOME/.config" -R essentials common extra theme xdg hyprland X stow -d config/ -t "$HOME/" -R zshrc ;; *) |