stow: update stow deployment

This commit is contained in:
Marco Thomas
2023-09-28 13:15:50 +00:00
committed by Marco Thomas
parent 9202762eed
commit bde3f632d5
3 changed files with 22 additions and 17 deletions

View File

@@ -26,8 +26,8 @@ __prompt_command() {
local EXIT="$?" local EXIT="$?"
export PS1="${HOST} ${DIR} ${GIT}${NEWLINE}" export PS1="${HOST} ${DIR} ${GIT}${NEWLINE}"
local red_lambda='\[\033[0;31m\]>\[\033[00m\] ' local red_lambda='\[\033[0;31m\]󱞩\[\033[00m\] '
local green_lambda='\[\033[0;32m\]>\[\033[00m\] ' local green_lambda='\[\033[0;32m\]󱞩\[\033[00m\] '
if [ $EXIT != 0 ] if [ $EXIT != 0 ]
then then

View File

@@ -9,7 +9,7 @@ precmd_vcs_info() { vcs_info }
precmd_functions+=( precmd_vcs_info ) precmd_functions+=( precmd_vcs_info )
setopt prompt_subst setopt prompt_subst
ICON="%(?.%{$fg[green]%}.%{$fg[red]%})>" ICON="%(?.%{$fg[green]%}.%{$fg[red]%})󱞩"
DIR="%{$fg[blue]%}%~" DIR="%{$fg[blue]%}%~"
GIT="%{$fg[red]%}\$vcs_info_msg_0_" GIT="%{$fg[red]%}\$vcs_info_msg_0_"
HOSTN="%{$fg[yellow]%}%m " HOSTN="%{$fg[yellow]%}%m "

33
stow.sh
View File

@@ -1,18 +1,23 @@
#!/bin/bash #!/bin/bash
FILES_DIR=$PWD/files # Utility script to stow or un-stow configuration
OPTS=$1
echo "You are about to stow all config files." set -e
echo "Do you want to proceed? [y]"
read proceed
if [ "${proceed}" != "y" ]; then for i in "$1"
echo "Exiting!" do
exit case $i in
fi -s|--stow)
echo "Stowing configuration for $2"
echo "Stowing configs..." stow -v -d files -t $HOME $2
cd $FILES_DIR ;;
stow ${OPTS} -v --target="$HOME" * -u|--unstow)
echo "Done!" 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