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.

69 lines
1.4 KiB

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