From bde3f632d5f24f8313dee55406c547fa1ec55a6c Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Thu, 28 Sep 2023 13:15:50 +0000 Subject: [PATCH] stow: update stow deployment --- files/shell/.bashrc | 4 ++-- files/shell/.zshrc | 2 +- stow.sh | 33 +++++++++++++++++++-------------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/files/shell/.bashrc b/files/shell/.bashrc index 75eeea1..e3dc963 100644 --- a/files/shell/.bashrc +++ b/files/shell/.bashrc @@ -26,8 +26,8 @@ __prompt_command() { local EXIT="$?" export PS1="${HOST} ${DIR} ${GIT}${NEWLINE}" - local red_lambda='\[\033[0;31m\]>\[\033[00m\] ' - local green_lambda='\[\033[0;32m\]>\[\033[00m\] ' + local red_lambda='\[\033[0;31m\]󱞩\[\033[00m\] ' + local green_lambda='\[\033[0;32m\]󱞩\[\033[00m\] ' if [ $EXIT != 0 ] then diff --git a/files/shell/.zshrc b/files/shell/.zshrc index 9750829..152e707 100644 --- a/files/shell/.zshrc +++ b/files/shell/.zshrc @@ -9,7 +9,7 @@ precmd_vcs_info() { vcs_info } precmd_functions+=( precmd_vcs_info ) setopt prompt_subst -ICON="%(?.%{$fg[green]%}.%{$fg[red]%})>" +ICON="%(?.%{$fg[green]%}.%{$fg[red]%})󱞩" DIR="%{$fg[blue]%}%~" GIT="%{$fg[red]%}\$vcs_info_msg_0_" HOSTN="%{$fg[yellow]%}%m " diff --git a/stow.sh b/stow.sh index 0b4a35a..850cd71 100755 --- a/stow.sh +++ b/stow.sh @@ -1,18 +1,23 @@ #!/bin/bash -FILES_DIR=$PWD/files -OPTS=$1 +# Utility script to stow or un-stow configuration -echo "You are about to stow all config files." -echo "Do you want to proceed? [y]" -read proceed +set -e -if [ "${proceed}" != "y" ]; then - echo "Exiting!" - exit -fi - -echo "Stowing configs..." -cd $FILES_DIR -stow ${OPTS} -v --target="$HOME" * -echo "Done!" +for i in "$1" +do +case $i in + -s|--stow) + echo "Stowing configuration for $2" + stow -v -d files -t $HOME $2 + ;; + -u|--unstow) + echo "Deleting configuration for $2" + stow -D -v -d files -t $HOME $2 + ;; + *) + echo "Unknown option (neither -s, not -u), exiting." + exit -1 + ;; +esac +done