summaryrefslogtreecommitdiff
path: root/archsetup
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2025-05-23 15:36:35 -0500
committerCraig Jennings <c@cjennings.net>2025-05-23 15:36:35 -0500
commitc1d07a7e5463d26a4a7fdfd5135380edafe7e1ad (patch)
treef24d2f682f4c102dffae02a7001e311e75aab386 /archsetup
parent9f6baa444e51c6decf93785a5a49c3d27707cb41 (diff)
stow dotfiles from subdirectory
Diffstat (limited to 'archsetup')
-rwxr-xr-xarchsetup15
1 files changed, 6 insertions, 9 deletions
diff --git a/archsetup b/archsetup
index 7de754d..d4d5766 100755
--- a/archsetup
+++ b/archsetup
@@ -23,12 +23,13 @@
username="cjennings"
password="welcome" # will be changed on first login. :)
+archsetup_dir="$(dirname "$(readlink -f "$0")")"
+dotfiles_dir="$archsetup_dir/dotfiles"
+
dwm_repo="https://git.cjennings.net/dwm.git"
dmenu_repo="https://git.cjennings.net/dmenu.git"
st_repo="https://git.cjennings.net/st.git"
-dotfiles_repo="https://git.cjennings.net/dotfiles"
dotemacs_repo="https://git.cjennings.net/dotemacs.git"
-dotfiles_home="/home/$username/.dotfiles"
logfile="/var/log/archsetup-$(date +'%Y-%m-%d-%H-%M-%S').log"
source_dir="/home/$username/.local/src" # aur/git source goes here
@@ -289,16 +290,12 @@ create_user () {
user_customizations() {
action="User Customizations" && display "title" "$action"
- action="cloning dotfiles" && display "task" "$action"
- (git clone --depth 1 $dotfiles_repo "$dotfiles_home" \
- >> "$logfile" 2>&1) || error "error" "$action" "$?"
-
- action="moving dotfiles into place" && display "task" "$action"
- (cd "$dotfiles_home" && stow --no-folding --adopt system \
+ action="linking dotfiles into place" && display "task" "$action"
+ (cd $dotfiles_dir && stow --target=/home/$username --no-folding --adopt system \
>> "$logfile" 2>&1 ) || error "error" "$action" "$?"
action="restoring dotfile versions" && display "task" "$action"
- (cd "$dotfiles_home" && git restore . \
+ (cd "$dotfiles_dir" && git restore . \
>> "$logfile" 2>&1 ) || error "error" "$action" "$?"
action="creating common directories" && display "task" "$action"