install.sh 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. #!/usr/bin/zsh
  2. echo -n "[*] Do you want to install all packages via pacman? [y/n] "
  3. read yesno
  4. if [[ "$yesno" == "y" ]]; then
  5. echo "[*] Installing most popular tools"
  6. # most important tools that are _always_ needed
  7. sudo pacman -Sy fzf fd neovim ripgrep nmap hexyl ctags git podman ueberzug duf exa i3blocks udiskie alacritty rofi firefox python-pip vifm zathura zathura-pdf-mupdf sxiv feh xclip flameshot manjaro-pipewire pavucontrol rofimoji noto-fonts noto-fonts-emoji noto-fonts-extra light redshift zip unzip
  8. fi
  9. # .zpretzo
  10. echo -n "[*] Do you want to install zpretzo? [y/n] "
  11. read yesno
  12. if [[ "$yesno" == "y" ]]; then
  13. cd $HOME
  14. [ ! -d "$HOME/.zprezto" ] && git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"
  15. setopt EXTENDED_GLOB
  16. for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do
  17. rm -rf "${ZDOTDIR:-$HOME}/.${rcfile:t}"
  18. echo "[*] Symlinking $rcfile -> ${ZDOTDIR:-$HOME}/.${rcfile:t}"
  19. ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}"
  20. done
  21. fi
  22. echo -n "[*] Copy (and overwrite) dotfiles? [y/n] "
  23. read yesno
  24. if [[ "$yesno" == "y" ]]; then
  25. backup_dir=/tmp/dotfiles-backup-$(date "+%H%M%S")
  26. rsync --backup --backup-dir $backup_dir --exclude profiles --exclude .git/ --exclude install.sh -r . $HOME
  27. echo "[+] Dotfiles installed :) Backup available @ $backup_dir"
  28. fi
  29. echo -n "[*] Do you want to pywal? [y/n] "
  30. read yesno
  31. if [[ "$yesno" == "y" ]]; then
  32. sudo pip3 install pywal
  33. fi
  34. # Installing custom profile
  35. echo -n "[*] Do you want to install custom profile? [y/n] "
  36. read yesno
  37. if [[ "$yesno" == "y" ]]; then
  38. pf=$(ls ./profiles)
  39. profiles=(${=pf})
  40. for i ("$profiles[@]") ; do
  41. print -r -- "> $i"
  42. done
  43. echo -n "[*] Enter profile name: "
  44. read profilename
  45. if [[ " ${profiles[*]} " =~ " ${profilename} " ]];
  46. then
  47. echo "[+] Found profile, copying files..."
  48. backup_dir=/tmp/dotfiles-backup-profile-$(date "+%H%M%S")
  49. rsync --backup --backup-dir $backup_dir --exclude .git/ --exclude install.sh -r "./profiles/$profilename/" $HOME
  50. else
  51. echo "[-] Profile not found, continuing"
  52. fi
  53. fi
  54. # Creating vim folders
  55. mkdir -p $HOME/.config/nvim/backups
  56. mkdir -p $HOME/.config/nvim/undo
  57. # Creating other needed folders
  58. mkdir -p $HOME/documents
  59. mkdir -p $HOME/documents/tools
  60. mkdir -p $HOME/documents/bin
  61. # setup SSH Folders & default import rule
  62. mkdir -p $HOME/.ssh
  63. mkdir -p $HOME/.ssh/config.d/
  64. echo "Include config.d/*" > $HOME/.ssh/config
  65. # Cleaning default folders
  66. rm -rf $HOME/Documents
  67. rm -rf $HOME/Pictures
  68. rm -rf $HOME/Public
  69. rm -rf $HOME/Templates
  70. rm -rf $HOME/Music
  71. rm -rf $HOME/Videos
  72. rm -rf $HOME/Desktop
  73. # setting suid on `light` for background lighting via function keys
  74. sudo chmod u+s $(which light)
  75. echo "[INFO] Switch the default downloads folder to 'downloads' in Firefox!"
  76. echo "[+] Done :)"