Alow stowing of subfolders
This commit is contained in:
parent
34d4dc829e
commit
721436b983
2 changed files with 28 additions and 3 deletions
|
@ -6,6 +6,8 @@ My primary editor is vim, who's config is in a submodule because I often need to
|
|||
|
||||
I use [GNU Stow](https://www.gnu.org/software/stow/) to deploy my dotfiles. There is a helper script in the root of this directory called install.sh that runs the necessary stow commands.
|
||||
|
||||
Each folder contains the configuration related to a program / tool. In most cases, this folder is stowed meaning all of it's contents are symlinked to the same place in my $HOME directory. However, there are instances (only shells/zsh at the moment) when I don't want the whole directory to be symlinked. If the directory contains a sub-directory called `STOW`, only the `STOW` directory is stowed.
|
||||
|
||||
The folder `LEGACY` is for things that I no longer use but might be of interest if you are the sort of person who likes looking at other people's dotfiles.
|
||||
|
||||
The folder `NOSTOW` is for things that I don't manage with stow. This includes a submodule for my DWM fork and configuration files that live outside my home directory.
|
||||
|
|
29
install.sh
29
install.sh
|
@ -3,6 +3,19 @@
|
|||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
cd $SCRIPT_DIR
|
||||
|
||||
#Atts a slash if there isn't one at the end
|
||||
slashIt(){
|
||||
local str=$1
|
||||
case "$str" in
|
||||
*/)
|
||||
echo "$str"
|
||||
;;
|
||||
*)
|
||||
echo "$str/"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
doStow(){
|
||||
local tostow=(
|
||||
"bin"
|
||||
|
@ -18,10 +31,18 @@ doStow(){
|
|||
"vim"
|
||||
"x"
|
||||
"zathura"
|
||||
"shells/zsh"
|
||||
)
|
||||
|
||||
for i in ${tostow[*]}; do
|
||||
stow $i
|
||||
if [ -d "$SCRIPT_DIR/$i/STOW" ]; then
|
||||
cd "$SCRIPT_DIR/$i"
|
||||
stow -t $HOME STOW
|
||||
else
|
||||
cd $(dirname $i)
|
||||
stow -t $HOME $(basename $i)
|
||||
fi
|
||||
cd $SCRIPT_DIR
|
||||
done
|
||||
}
|
||||
|
||||
|
@ -31,10 +52,12 @@ pacmanInstall(){
|
|||
"zsh"
|
||||
"git"
|
||||
"pandoc"
|
||||
"stow"
|
||||
)
|
||||
if pacman -Qs $package > /dev/null; then
|
||||
|
||||
echo "Install $i"
|
||||
fi
|
||||
}
|
||||
|
||||
dostow
|
||||
doStow
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue