index : dotfiles.git

ascending towards madness

author holly sparkles <sparkles@holly.sh> 2024-04-28 18:55:00.0 +00:00:00
committer holly sparkles <sparkles@holly.sh> 2024-04-28 18:55:00.0 +00:00:00
commit
3574d15bca688b38f511adc8746cfc481a36d954 [patch]
tree
99263d8e3d1c39e765ccbd3897b4758355539413
parent
d92a3fa3a0969f1353bd7258bd48fe10abf4bdae
download
3574d15bca688b38f511adc8746cfc481a36d954.tar.gz

update script to sync to repo and clean



Diff

 sync.zsh | 60 +++++++++++++++++++++++++++++++++++++++++++-----------------
 1 file changed, 43 insertions(+), 17 deletions(-)

diff --git a/sync.zsh b/sync.zsh
index 993862e..6c4acab 100755
--- a/sync.zsh
+++ b/sync.zsh
@@ -2,20 +2,46 @@

DOTFILES_DIR=.

# dir structure
mkdir -p "${DOTFILES_DIR}/.config/gtk-3.0"
mkdir -p "${DOTFILES_DIR}/.config/helix"
mkdir -p "${DOTFILES_DIR}/.config/kitty"
mkdir -p "${DOTFILES_DIR}/.config/zellij"
mkdir -p "${DOTFILES_DIR}/.scripts"

# configs
cp -v $HOME/.zshrc $DOTFILES_DIR/.zshrc
cp -v $HOME/.config/gtk-3.0/gtk.css $DOTFILES_DIR/.config/gtk-3.0/gtk.css
cp -v $HOME/.config/helix/config.toml $DOTFILES_DIR/.config/helix/config.toml
cp -v $HOME/.config/kitty/kitty.conf $DOTFILES_DIR/.config/kitty/kitty.conf
cp -vr $HOME/.config/zellij/ $DOTFILES_DIR/.config/

# scripts
cp -v $SCRIPTS/calendar.sh $DOTFILES_DIR/.scripts/calendar.sh
cp -v $SCRIPTS/zellij-launcher.zsh $DOTFILES_DIR/.scripts/zellij-launcher.zsh
sync() {
  # dir structure
  mkdir -p "${DOTFILES_DIR}/.config/gtk-3.0"
  mkdir -p "${DOTFILES_DIR}/.config/helix"
  mkdir -p "${DOTFILES_DIR}/.config/kitty"
  mkdir -p "${DOTFILES_DIR}/.config/zellij"
  mkdir -p "${DOTFILES_DIR}/.scripts"

  # configs
  cp -v $HOME/.zshrc $DOTFILES_DIR/.zshrc
  cp -v $HOME/.config/gtk-3.0/gtk.css $DOTFILES_DIR/.config/gtk-3.0/gtk.css
  cp -v $HOME/.config/helix/config.toml $DOTFILES_DIR/.config/helix/config.toml
  cp -v $HOME/.config/kitty/kitty.conf $DOTFILES_DIR/.config/kitty/kitty.conf
  cp -vr $HOME/.config/zellij/ $DOTFILES_DIR/.config/

  # scripts
  cp -v $SCRIPTS/calendar.sh $DOTFILES_DIR/.scripts/calendar.sh
  cp -v $SCRIPTS/zellij-launcher.zsh $DOTFILES_DIR/.scripts/zellij-launcher.zsh

  echo "done."
}

clean() {
  # dirs
  rm -rfv "${DOTFILES_DIR}/.config"
  rm -rfv "${DOTFILES_DIR}/.scripts"

  # files
  rm -fv "${DOTFILES_DIR}/.zshrc"
}

main() {
  if [[ "$1" == "clean" ]]; then
    clean
  else
    sync
  fi

  echo "goodbye."
  exit 0
}

main "$@"