summaryrefslogtreecommitdiff
path: root/stowcmds.sh
blob: b78d4a18af679410f879ebcba15ed344ecf4224e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/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

case "$MACH" in
	"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 X theme xdg
		stow -d config/ -t "$HOME/" -R zshrc
		;;
	"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" | "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 xdg hyprland X
		stow -d config/ -t "$HOME/" -R zshrc
		;;
	*)
		echo "E: invalid value for 'MACH'" 1>&2
		break
esac