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.

136 lines
3.5 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
  1. #!/bin/sh
  2. DIR="$(realpath "$(dirname "$0")")"
  3. # script must start at home directory
  4. cd "$HOME" || exit 1;
  5. bootstrap_paru () {
  6. mkdir -p "$HOME/repos"
  7. cd "$HOME/repos" || exit 1
  8. git clone https://aur.archlinux.org/paru-bin.git
  9. cd paru-bin || exit 1
  10. makepkg --noconfirm -si || exit 2
  11. cd "$HOME" || exit 1
  12. }
  13. paru_exists() {
  14. if ! command -V paru; then
  15. echo "Paru doesn't exist. Installing it"
  16. bootstrap_paru
  17. fi
  18. }
  19. usertest() {
  20. if test "$(id -u)" -eq 0; then
  21. echo "You cannot run this script as root.";
  22. exit 1;
  23. fi
  24. if ! (type sudo 2>&1) > /dev/null; then
  25. echo "sudo is not installed.";
  26. exit 1
  27. fi
  28. sudo pacman -Syu
  29. sudo pacman --noconfirm -S base-devel
  30. }
  31. dev() {
  32. echo "Developer tools..."
  33. sudo pacman --noconfirm -S neovim nodejs
  34. }
  35. sysinfo() {
  36. echo "Dylan Araps scripts"
  37. cd "$HOME" || exit 1;
  38. mkdir -p repos
  39. git clone https://github.com/dylanaraps/pfetch "$HOME/repos/pfetch"
  40. git clone https://github.com/dylanaraps/neofetch "$HOME/repos/neofetch"
  41. git clone https://github.com/dylanaraps/fff "$HOME/repos/fff"
  42. cd "$HOME/repos/pfetch" || exit 1;
  43. sudo make install || exit 2;
  44. cd "$HOME" || exit 1;
  45. cd "$HOME/repos/neofetch" || exit 1;
  46. sudo make install || exit 2;
  47. cd "$HOME" || exit 1;
  48. cd "$HOME/repos/fff" || exit 1;
  49. sudo make install || exit 2;
  50. cd "$HOME" || exit 1;
  51. }
  52. shell() {
  53. sudo pacman --noconfirm -S zsh tmux starship
  54. }
  55. browsers() {
  56. paru --noconfirm -S brave-bin
  57. }
  58. torbrowser() {
  59. sudo pacman --noconfirm -S torbrowser-launcher
  60. }
  61. meetings() {
  62. paru_exists
  63. paru --noconfirm -S skypeforlinux-stable-bin zoom
  64. # install mt
  65. sudo curl -LJ https://github.com/junikimm717/mt/releases/download/33627ab/mt -o /usr/local/bin/mt
  66. sudo chmod +x /usr/local/bin/mt
  67. }
  68. # neovim must be installed.
  69. plugins() {
  70. # install vim-plug, oh-my-zsh, and zsh-syntax-highlighting
  71. sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
  72. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  73. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  74. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
  75. }
  76. dotfiles() {
  77. echo "Adding vim and zsh configs"
  78. if ! test -d "$DIR/dotfiles"; then
  79. echo "$DIR/dotfiles folder not found.";
  80. exit 1;
  81. fi
  82. mkdir -p "$HOME/.config/nvim"
  83. cp "$DIR/dotfiles/.zshrc" "$HOME/.zshrc"
  84. cp "$DIR/dotfiles/init.vim" "$HOME/.config/nvim/init.vim"
  85. nvim --headless +PlugInstall +qa
  86. cp "$DIR"/dotfiles/.cwmrc "$DIR/dotfiles/cwm.sh" "$DIR/dotfiles/.xinitrc" "$HOME"
  87. mkdir -p "$HOME/.config/kitty"
  88. cp "$DIR"/dotfiles/kitty.conf "$HOME/.config/kitty/"
  89. cp -r "$DIR"/dotfiles/polybar "$HOME/.config/"
  90. cp "$DIR"/dotfiles/tmux.conf "$HOME/.tmux.conf"
  91. }
  92. graphical() {
  93. sudo pacman --noconfirm -S xorg xorg xorg-server xorg-xinit xorg-fonts-misc \
  94. xclip nitrogen dmenu ttf-jetbrains-mono ttf-dejavu \
  95. picom xclip kitty
  96. paru -S --noconfirm polybar cwm
  97. mkdir -p "$HOME/wallpaper"
  98. }
  99. sound() {
  100. sudo pacman --noconfirm -S pipewire-pulse
  101. systemctl --user --now enable pipewire-pulse
  102. }
  103. (usertest && bootstrap_paru && dev && sysinfo && shell && plugins && dotfiles && graphical && sound && browsers && meetings) || exit 1
  104. cat <<EOF
  105. Stuff to do:
  106. - Install pop-shell (make local-install)
  107. - Install the coc extensions
  108. - Settle brave key stuff
  109. - Copy over the mt config files
  110. - Wallpapers from wallhaven.cc
  111. EOF