Simple image host.
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.

setup.sh 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #!/bin/bash
  2. issues=0
  3. check_command()
  4. {
  5. which "$1" &> /dev/null
  6. if [ "$?" -ne 0 ]; then
  7. issues=1
  8. echo "Missing command: $1"
  9. fi
  10. }
  11. issues=0
  12. check_file()
  13. {
  14. if [ ! -f "$1" ]; then
  15. issues=1
  16. echo "Missing file: $1"
  17. fi
  18. }
  19. check_command "zsh"
  20. check_command "tmux"
  21. check_command "vim"
  22. check_command "python"
  23. check_command "xdotool"
  24. check_command "i3"
  25. check_command "compton"
  26. check_command "amixer"
  27. check_command "xbacklight"
  28. check_command "feh"
  29. check_command "xsel"
  30. check_command "ffmpeg"
  31. check_command "sxhkd"
  32. check_command "vimb"
  33. check_file ~/.mrecrc
  34. if [ $issues -ne 0 ]; then
  35. echo "Some commands or files are missing. Continue? (y/n)"
  36. read response
  37. if [ "$response" != "y" ]; then
  38. echo "Aborting."
  39. exit 1
  40. fi
  41. fi
  42. echo "Copying dotfiles..."
  43. cd dotfiles
  44. for f in *; do
  45. rm -rf "$HOME/.$f"
  46. cp -r "$f" "$HOME/.$f"
  47. done
  48. cd ..
  49. echo "Done."
  50. echo "Copying config files..."
  51. cd config
  52. for f in *; do
  53. rm -rf "$HOME/.config/$f"
  54. cp -r "$f" "$HOME/.config/$f"
  55. done
  56. cd ..
  57. echo "Done."
  58. echo "Copying executables..."
  59. mkdir -p "$HOME/bin"
  60. cd bin
  61. for f in *; do
  62. rm -rf "$HOME/bin/$f"
  63. cp -r "$f" "$HOME/bin/$f"
  64. done
  65. cd ..
  66. echo "Done."
  67. echo "Copying assets..."
  68. rm -fr "$HOME/assets"
  69. cp -r assets "$HOME/assets"
  70. echo "Done."
  71. while getopts :m option; do
  72. case "$option" in
  73. m)
  74. echo "Not switching mod and alt keys."
  75. echo "" > ~/.Xmodmaprc
  76. ;;
  77. *)
  78. echo "Unknown option: $option"
  79. ;;
  80. esac
  81. done
  82. echo "Everything set up!"