feat: function for stow and unstow

This commit is contained in:
hesam-init 2024-02-23 23:55:14 +03:30
parent 5c957e7016
commit f642f3f3d0

29
stow.sh
View file

@ -1,11 +1,36 @@
#!/bin/bash
display_help() {
echo "Usage: [-s | -u] [-h]"
echo " -s Stow dotfiles"
echo " -u Unstow dotfiles"
echo " -h Display this help message"
}
stow_dotfiles() {
stow dots
stow -d dots -S zsh -t ~/
stow hyprland
echo "Dotfiles stowed successfully!"
}
stow_dotfiles
unstow_dotfiles() {
stow -D dots
stow -D -d dots -t ~/ zsh
stow -D hyprland
echo "Dotfiles unstowed successfully!"
}
while getopts ":suh" opt; do
case $opt in
s)
stow_dotfiles
;;
u)
unstow_dotfiles
;;
*)
display_help
;;
esac
done