From f642f3f3d08b441da1a5cb90f833d0d0433378ff Mon Sep 17 00:00:00 2001 From: hesam-init Date: Fri, 23 Feb 2024 23:55:14 +0330 Subject: [PATCH] feat: function for stow and unstow --- stow.sh | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/stow.sh b/stow.sh index 236b4a3..a944a11 100755 --- a/stow.sh +++ b/stow.sh @@ -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