summaryrefslogtreecommitdiff
path: root/stowdots
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2023-08-02 15:19:25 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2023-08-02 15:19:25 +0200
commit9b791ac8786eed2d242d0909dd2379f008952042 (patch)
tree403c08eb322e18d045606822911a7eb6036f0070 /stowdots
parente614a330978ce7e7f6d130cc7d199150e16a409d (diff)
parent63c64f071ecd45cf66ab49d199a634cd8db27056 (diff)
Merge branch 'main' of db:dotfiles
Diffstat (limited to 'stowdots')
-rwxr-xr-xstowdots13
1 files changed, 7 insertions, 6 deletions
diff --git a/stowdots b/stowdots
index 1c72f80..b16c572 100755
--- a/stowdots
+++ b/stowdots
@@ -1,6 +1,7 @@
#!/bin/sh
-trap "echo -e '\nbye'; exit 1" EXIT
+trap "exit 1" EXIT INT
+test "$(id -u)" != 0 && sudo=sudo
die () {
echo "$@" 1>&2
@@ -9,20 +10,20 @@ die () {
if ! stow --version > /dev/null 2>&1
then
die "stow not installed or not found."
- die "install stow?"
+ die "install stow? (arch)"
die -n ">"
test "y" = "$(head -n 1)" &&
- doas pacman -Sy stow ||
+ $sudo pacman -Sy stow ||
exit 1
fi
if [ -n "${MACH:=$1}" ]
then
die "I: stowing for $MACH"
else
- die "E: MACH not set" >&2
+ die "E: MACH not set"
die "Enter valid value for 'MACH'"
die "d(esktop) | s(erver) | l(aptop)"
- echo -n ">" >&2
+ die -n ">"
read MACH
fi
@@ -33,7 +34,7 @@ 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 xdg hyprland
+ stow -d config/ -t "$HOME/.config" -R essentials common extra X theme hyprland
stow -d config/ -t "$HOME/" -R home
;;
"server" | "s")