Dotfiles for my tiling window manager + terminal workflow.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.1 KiB

  1. #!/bin/bash
  2. shopt -s dotglob
  3. lc_dir="/home/kevin/linux-config"
  4. link_to_lc () {
  5. echo "Linking $1 from $3 to $2."
  6. sys_dir="$2"
  7. config_dir="$3"
  8. items=()
  9. case "$1" in
  10. files)
  11. items="$config_dir"/* ;;
  12. dirs)
  13. items="$config_dir"/*/ ;;
  14. esac
  15. for item in $items; do
  16. item_name=$(basename -- "$item")
  17. # echo "$item_name"
  18. # Remove system item and link config in repository to system.
  19. rm -f "${sys_dir:?}"/"$item_name"
  20. ln -s "$config_dir"/"$item_name" "$sys_dir"/"$item_name" && echo "Linked $item_name."
  21. done
  22. }
  23. link_to_lc "files" "$HOME" "$lc_dir/dotfiles"
  24. link_to_lc "dirs" "$HOME/.config" "$lc_dir/configs"
  25. link_to_lc "dirs" "$HOME/.themes" "$lc_dir/gtk/themes"
  26. # setup nvim config
  27. # nvim_file="/home/kevin/lc-test/init.vim"
  28. nvim_file="$HOME/.config/nvim/init.vim"
  29. rm "$nvim_file"
  30. ln -s "$HOME/.nvim" "$nvim_file" && echo "Setup Neovim config."
  31. # testing {{{ #
  32. # link_to_lc "files" "/home/kevin/lc-test" "$lc_dir/dotfiles"
  33. # link_to_lc "dirs" "/home/kevin/lc-test" "$lc_dir/configs"
  34. # link_to_lc "dirs" "/home/kevin/lc-test" "$lc_dir/gtk/themes"
  35. # }}} testing #