Debian Rice Scripts
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.

162 lines
4.9 KiB

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. usertest() {
  6. if test "$(id -u)" -eq 0; then
  7. echo "You cannot run this script as root.";
  8. exit 1;
  9. fi
  10. if ! (type sudo 2>&1) > /dev/null; then
  11. echo "sudo is not installed.";
  12. exit 1
  13. fi
  14. sudo apt install -y make curl
  15. echo "Updating APT and adding PPA's"
  16. curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
  17. sudo apt update -y || exit 1
  18. sudo apt upgrade -y || exit 1
  19. }
  20. dev() {
  21. echo "Developer tools..."
  22. sudo apt install -y libfuse2 fuse
  23. # install neovim through appimage (no snaps)
  24. sudo curl https://github.com/neovim/neovim/releases/download/v0.6.1/nvim.appimage -LJo "/usr/local/bin/nvim"
  25. sudo chmod +x "/usr/local/bin/nvim"
  26. # install nodejs (coc in neovim)
  27. sudo apt-get update -y && sudo apt-get install -y nodejs
  28. }
  29. sysinfo() {
  30. echo "Dylan Araps scripts"
  31. cd "$HOME" || exit 1;
  32. mkdir -p repos
  33. git clone https://github.com/dylanaraps/pfetch "$HOME/repos/pfetch"
  34. git clone https://github.com/dylanaraps/neofetch "$HOME/repos/neofetch"
  35. git clone https://github.com/dylanaraps/fff "$HOME/repos/fff"
  36. cd "$HOME/repos/pfetch" || exit 1;
  37. sudo make install || exit 2;
  38. cd "$HOME" || exit 1;
  39. cd "$HOME/repos/neofetch" || exit 1;
  40. sudo make install || exit 2;
  41. cd "$HOME" || exit 1;
  42. cd "$HOME/repos/fff" || exit 1;
  43. sudo make install || exit 2;
  44. cd "$HOME" || exit 1;
  45. }
  46. shell() {
  47. sudo apt install -y zsh tmux
  48. curl -sS https://starship.rs/install.sh | sh
  49. }
  50. browsers() {
  51. sudo apt remove -y firefox
  52. sudo snap remove firefox
  53. # install brave
  54. sudo apt install apt-transport-https -y
  55. sudo curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg
  56. echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main"|sudo tee /etc/apt/sources.list.d/brave-browser-release.list
  57. sudo apt update -y
  58. sudo apt install brave-browser -y
  59. }
  60. torbrowser() {
  61. sudo apt install -y torbrowser-launcher
  62. }
  63. popshell() {
  64. mkdir -p "$HOME/repos"
  65. sudo apt install git node-typescript make -y
  66. git clone https://github.com/pop-os/shell.git "$HOME/repos/shell"
  67. }
  68. meetings() {
  69. mkdir -p "$HOME/repos"
  70. # install skype
  71. curl https://go.skype.com/skypeforlinux-64.deb -LJo "$HOME/repos/skypeforlinux.deb"
  72. sudo apt install "$HOME/repos/skypeforlinux.deb" -y
  73. # install zoom
  74. curl https://zoom.us/client/latest/zoom_amd64.deb -LJo "$HOME/repos/zoomus.deb"
  75. sudo apt install "$HOME/repos/zoomus.deb" -y
  76. # install mt
  77. sudo curl -LJ https://github.com/junikimm717/mt/releases/download/33627ab/mt -o /usr/local/bin/mt
  78. sudo chmod +x /usr/local/bin/mt
  79. }
  80. # neovim must be installed.
  81. plugins() {
  82. # install vim-plug, oh-my-zsh, and zsh-syntax-highlighting
  83. sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs \
  84. https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
  85. sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
  86. git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "$HOME/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting"
  87. }
  88. dotfiles() {
  89. echo "Adding vim and zsh configs"
  90. if ! test -d "$DIR/dotfiles"; then
  91. echo "$DIR/dotfiles folder not found.";
  92. exit 1;
  93. fi
  94. mkdir -p "$HOME/.config/nvim"
  95. cp "$DIR/dotfiles/.zshrc" "$HOME/.zshrc"
  96. cp "$DIR/dotfiles/init.vim" "$HOME/.config/nvim/init.vim"
  97. nvim --headless +PlugInstall +qa
  98. cp "$DIR"/dotfiles/.cwmrc "$DIR/dotfiles/cwm.sh" "$DIR/dotfiles/.xinitrc" "$HOME"
  99. mkdir -p "$HOME/.config/kitty"
  100. cp "$DIR"/dotfiles/kitty.conf "$HOME/.config/kitty/"
  101. cp -r "$DIR"/dotfiles/polybar "$HOME/.config/"
  102. cp "$DIR"/dotfiles/tmux.conf "$HOME/.tmux.conf"
  103. }
  104. competitiveprogramming() {
  105. echo "CP Compilers..."
  106. sudo apt install clang clang-tools-extra
  107. cd "$HOME" || exit 1;
  108. git clone https://git.junickim.me/junikimm717/linuxcp "$HOME/cp"
  109. }
  110. graphical() {
  111. sudo apt install -y xorg xclip cwm nitrogen dmenu kitty polybar picom
  112. sudo apt install -y fonts-dejavu fonts-jetbrains-mono
  113. # copy over the dotfiles
  114. mkdir -p "$HOME/wallpaper"
  115. }
  116. sound() {
  117. sudo apt install -y pulseaudio pipewire pavucontrol
  118. sudo touch /etc/pipewire/media-session.d/with-pulseaudio
  119. sudo cp /usr/share/doc/pipewire/examples/systemd/user/pipewire-pulse.* /etc/systemd/user/
  120. systemctl --user daemon-reload
  121. systemctl --user --now disable pulseaudio.service pulseaudio.socket
  122. systemctl --user --now enable pipewire pipewire-pulse
  123. }
  124. (usertest && dev && sysinfo && shell && browsers && meetings && plugins && dotfiles) || exit 1
  125. (graphical && sound) || exit 1
  126. cat <<EOF
  127. Stuff to do:
  128. - Install pop-shell (make local-install)
  129. - Install the coc extensions
  130. - Settle brave key stuff
  131. - Copy over the mt config files
  132. - Wallpapers from wallhaven.cc
  133. EOF