install-after-format.sh 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. #!/usr/bin/env bash
  2. set -euo pipefail # bash strict mode
  3. set -euxo pipefail
  4. setup_flatpak(){
  5. package-manager.sh install flatpak
  6. flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
  7. flatpak install --user -y com.discordapp.Discord
  8. }
  9. setup_shell(){
  10. package-manager.sh install zsh zsh-autosuggestions zsh-syntax-highlighting
  11. chsh -s $(which zsh) || sudo usermod -s $(which zsh) "$LOGNAME"
  12. }
  13. setup_music(){
  14. package-manager.sh install mpd mpd mpc mpdris2 ncmpcpp
  15. sudo gpasswd -a mpd "$LOGNAME"
  16. sudo gpasswd -a mpd audio
  17. }
  18. setup_dirs_and_perms(){
  19. mkdir -p ~/Repos
  20. sudo mkdir -p /mnt/{crucial_nvme,seagate,toshiba,elements,128gb_sdcard,iso,borg}
  21. sudo chown "${LOGNAME}:${LOGNAME}" -R /mnt/*
  22. }
  23. setup_printer(){
  24. package-manager.sh install cups printer-driver-{gutenprint,splix}
  25. wget -c 'https://ftp.hp.com/pub/softlib/software13/printers/SS/SL-C4010ND/uld_V1.00.39_01.17.tar.gz' -O /tmp/uld.tar.gz
  26. tar -xavf /tmp/uld.tar.gz
  27. cd /tmp/uld
  28. sudo ./install.sh
  29. }
  30. setup_yt(){
  31. sudo curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp
  32. sudo chmod a+rx /usr/local/bin/yt-dlp
  33. }
  34. setup_pass(){
  35. package-manager.sh install pass{,-extension-otp} xdotool ssh-askpass gpg pinentry-{curses,tty,gtk2,gnome3} zbar-tools
  36. sudo update-alternatives --set pinentry $(which pinentry-gtk-2)
  37. # passff
  38. curl -sSL github.com/passff/passff-host/releases/latest/download/install_host_app.sh | bash -s -- firefox
  39. }
  40. setup_gnome(){
  41. package-manager.sh install gnome-core gnome-tweaks gnome-theme\* \
  42. gnome-\*-icon-theme {adapta,materia}-gtk-theme \
  43. gnome-shell-extension-appindicator \
  44. gnome-shell-extension-volume-mixer
  45. }
  46. setup_qemu(){
  47. package-manager.sh install qemu \
  48. virt-{manager,viewer} spice-{vdagent,client-gtk,webdavd} \
  49. dnsmasq vde2 bridge-utils netcat libguestfs0
  50. # systemctl enable --user --now libvirtd
  51. sudo usermod -aG libvirt "$LOGNAME"
  52. # # on guest machine install for clipboard !!!!!!!!!
  53. # windows: spice-guest-tools-latest, spice-webdav
  54. # enable rdp in windows
  55. # how to clipboard and sharing folders
  56. # https://dausruddin.com/how-to-enable-clipboard-and-folder-sharing-in-qemu-kvm-on-windows-guest/#Step_1_Install_Cockpit_and_Cockpit_Virtual_Machines
  57. }
  58. setup_translator(){
  59. package-manager.sh install gawk
  60. git clone https://github.com/soimort/translate-shell /tmp/translate-shell
  61. cd /tmp/translate-shell/
  62. make
  63. sudo make install
  64. }
  65. setup_services(){
  66. mapfile -t services < <(find "${HOME}/.config/systemd/user/" -type f -iname "*.service")
  67. sudo systemctl disable --now "${services[@]}" # disable for root
  68. systemctl enable --now --user "${services[@]}" # enable for user
  69. }
  70. setup_games(){
  71. protonup -d "${HOME}/.steam/root/compatibilitytools.d/"
  72. # protonup -y # it crashes
  73. # sudo apt-get install -y nvidia-driver
  74. package-manager.sh install libgl1:i386 libc6:i386
  75. wget -c 'https://cdn.akamai.steamstatic.com/client/installer/steam.deb'
  76. sudo dpkg -I ./steam.deb
  77. package-manager.sh update
  78. }
  79. setup_additional_repositories(){
  80. if command -v apt; then
  81. sudo apt-add-repository contrib
  82. sudo apt-add-repository non-free
  83. elif command -v dnf; then
  84. sudo dnf install "https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm"
  85. sudo dnf install "https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm"
  86. sudo dnf groupupdate core
  87. elif command -v zypper; then
  88. sudo zypper ar -cfp 90 https://ftp.fau.de/packman/suse/openSUSE_Tumbleweed/ packman
  89. sudo zypper dup --from packman --allow-vendor-change
  90. fi
  91. }
  92. install_packages(){
  93. debian_packages=(aria2 atool bc bible-kjv borgbackup bzip2 calibre
  94. cmus cockpit cups curl dunst emacs exa fd-find feh ffmpeg
  95. flameshot fonts-firacode fonts-hack fonts-inconsolata
  96. fonts-monofur fonts-mononoki fonts-terminus fzf fzy
  97. git gxkb htop imagemagick inotify-tools jq kitty
  98. libnotify-bin lpr lutris moc mpv ncdu neofetch neovim
  99. nmon npm ntp oxygencursors pandoc picard picom pigz
  100. pixz printer-driver-gutenprint printer-driver-splix
  101. pulsemixer python3-pip python3-venv qalc qutebrowser
  102. redshift ripgrep rofi rsync scrot shellcheck slock
  103. spectrwm subliminal suckless-tools sxhkd sxiv
  104. syncthing tcpdump tldr tmux transmission-cli 7zip
  105. trash-cli unrar unzip vifm vim vnstat wavemon wget
  106. xclip xdotool xsel zathura zathura-cb zathura-djvu
  107. zathura-ps zstd)
  108. command -v tldr && tldr -u &>/dev/null &
  109. package-manager.sh update
  110. package-manager.sh install "${debian_packages[@]}"
  111. }
  112. setup_terminal(){
  113. term="$1"
  114. sudo update-alternatives --set x-terminal-emulator "$(which "$term")"
  115. }
  116. setup_timezone(){
  117. sudo timedatectl set-timezone Europe/Warsaw
  118. }
  119. cd /tmp/
  120. setup_additional_repositories
  121. setup_terminal 'kitty'
  122. setup_packages
  123. setup_terminal
  124. ! [[ $SHELL =~ zsh ]] && setup_shell
  125. ! command -v mpc && setup_music
  126. [[ ! -d ~/Repos ]] && setup_dirs_and_perms
  127. ! command -v qemu && setup_qemu
  128. ! command -v yt-dlp && setup_yt
  129. ! command -v pass && setup_pass
  130. ! command -v trans && setup_translator
  131. # setup_services
  132. # setup_printer
  133. # ! command -v flatpak && setup_flatpak
  134. # ! command -v gnome-shell && setup_gnome