Simple image host.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

setup.sh 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. #!/bin/bash
  2. issues=0
  3. check_command()
  4. {
  5. exists=0
  6. for arg in "$@"; do
  7. which "$arg" &> /dev/null
  8. if [ "$?" -eq 0 ]; then
  9. exists=1
  10. fi
  11. done
  12. if [ "$exists" -eq 0 ]; then
  13. issues=1
  14. echo "Missing command: $@"
  15. fi
  16. }
  17. check_file()
  18. {
  19. if [ ! -f "$1" ]; then
  20. issues=1
  21. echo "Missing file: $1"
  22. fi
  23. }
  24. check_command "zsh"
  25. check_command "tmux"
  26. check_command "vim"
  27. check_command "python"
  28. check_command "xdotool"
  29. check_command "compton"
  30. check_command "amixer"
  31. check_command "xbacklight"
  32. check_command "feh"
  33. check_command "xsel" "pbcopy"
  34. check_command "recordmydesktop"
  35. check_command "mplayer"
  36. check_command "scrot" "screencapture"
  37. check_command "notify-send" "terminal-notifier"
  38. check_command "dunst" "terminal-notifier"
  39. check_command "curl"
  40. check_command "sudo"
  41. check_command "mutt"
  42. check_command "w3m"
  43. check_command "clisp"
  44. if [ $issues -ne 0 ]; then
  45. echo "Some things are missing. Continue? (y/n)"
  46. read response
  47. if [ "$response" != "y" ]; then
  48. echo "Aborting."
  49. exit 1
  50. fi
  51. fi
  52. echo "Copying dotfiles..."
  53. cd dotfiles
  54. for f in *; do
  55. rm -rf "$HOME/.$f"
  56. cp -r "$f" "$HOME/.$f"
  57. done
  58. cd ..
  59. echo "Done."
  60. echo "Copying config files..."
  61. mkdir -p "$HOME/.config"
  62. cd config
  63. for f in *; do
  64. rm -rf "$HOME/.config/$f"
  65. cp -r "$f" "$HOME/.config/$f"
  66. done
  67. cd ..
  68. echo "Done."
  69. echo "Copying executables..."
  70. mkdir -p "$HOME/bin"
  71. cd bin
  72. for f in *; do
  73. rm -rf "$HOME/bin/$f"
  74. cp -r "$f" "$HOME/bin/$f"
  75. done
  76. cd ..
  77. echo "Done."
  78. echo "Copying assets..."
  79. rm -fr "$HOME/assets"
  80. cp -r assets "$HOME/assets"
  81. echo "Done."
  82. while getopts :m option; do
  83. case "$option" in
  84. m)
  85. echo "Not switching mod and alt keys."
  86. echo "" > ~/.Xmodmaprc
  87. ;;
  88. *)
  89. echo "Unknown option: $option"
  90. ;;
  91. esac
  92. done
  93. if [ "$SHELL" != "/bin/zsh" ]; then
  94. sudo chsh "$USER" -s /bin/zsh
  95. fi
  96. echo "Everything set up!"