191 lines
7.0 KiB
Bash
Executable File
191 lines
7.0 KiB
Bash
Executable File
#!/bin/bash
|
|
fg_black="$(tput setaf 0)"
|
|
fg_red="$(tput setaf 1)"
|
|
fg_green="$(tput setaf 2)"
|
|
fg_yellow="$(tput setaf 3)"
|
|
fg_blue="$(tput setaf 4)"
|
|
fg_magenta="$(tput setaf 5)"
|
|
fg_cyan="$(tput setaf 6)"
|
|
fg_white="$(tput setaf 7)"
|
|
reset="$(tput sgr0)"
|
|
scriptdir=$PWD
|
|
|
|
# colored text
|
|
cecho() {
|
|
local text="$1"
|
|
local color="$2"
|
|
|
|
# Ensure the color variable exists and is valid
|
|
if [[ -z "$color" || -z "${!color}" ]]; then
|
|
echo "Error: Invalid color variable"
|
|
return 1
|
|
fi
|
|
local fg_color="${!color}"
|
|
# Print the colored string
|
|
echo -e "${fg_color}${text}${reset}"
|
|
}
|
|
|
|
confirm() {
|
|
# call with a prompt string or use a default
|
|
read -r -p "${fg_yellow}${1:-Are you sure? [y/N]}${reset} " response
|
|
case "$response" in
|
|
[yY][eE][sS]|[yY])
|
|
true
|
|
;;
|
|
*)
|
|
false
|
|
;;
|
|
esac
|
|
}
|
|
|
|
|
|
check_dir_exists() {
|
|
dir=$1
|
|
if [ -d dir ]; then
|
|
return 1 # Dir exists
|
|
else
|
|
return 0 # Dir does not exist
|
|
fi
|
|
}
|
|
|
|
is_macbook=false
|
|
is_server=true
|
|
install_themes=false
|
|
install_nerdfonts=false
|
|
install_dotfiles=false
|
|
install_gnome_configs=false
|
|
install_rtaudio=false
|
|
|
|
echo "${fg_blue}"
|
|
cat ascii.txt
|
|
echo "${reset}"
|
|
cecho "----debian install script-----" fg_cyan
|
|
confirm "Is this a server? (Y/N)" && is_server=true
|
|
confirm "Swap Left Super & Left Control <for mac keyboard> (Y/N)" && is_macbook=true
|
|
if echo $DESKTOP_SESSION | grep -q "gnome"; then
|
|
confirm "Install gnome extensions, tweaks, and configs? (Y/N)" && install_gnome_configs=true
|
|
confirm "Install GTK themes? (Y/N)" && install_themes=true
|
|
fi
|
|
confirm "Install Nerd Fonts? (Y/N)" && install_nerdfonts=true
|
|
confirm "Install billypom dotfiles? - includes .bash_aliases file, tmux, kitty, and nvim configs (Y/N)" && install_dotfiles=true
|
|
confirm "Configure realtime audio for music production? (Y/N)" && install_rtaudio=true
|
|
|
|
cecho "Updating package manager" fg_cyan
|
|
sudo apt update
|
|
cecho "Purging yucky packages" fg_cyan
|
|
sudo apt purge nano evolution
|
|
cecho "Installing yummy packages" fg_cyan
|
|
if $is_server; then
|
|
sudo apt install vim neovim git cifs-utils nfs-common ripgrep stow virtualenv wget zip unzip kitty python3-pip ncdu htop python3-venv curl
|
|
else
|
|
sudo apt install vim git cifs-utils nfs-common ripgrep stow virtualenv wget zip unzip kitty python3-pip ncdu htop libfuse-dev nemo python3-venv curl irssi qpwgraph steam-installer protontricks zathura
|
|
# librewolf
|
|
sudo apt install extrepo -y
|
|
sudo extrepo enable librewolf
|
|
sudo apt update
|
|
sudo apt install librewolf
|
|
fi
|
|
|
|
# themes
|
|
if $is_server; then
|
|
echo ":3"
|
|
else
|
|
if $install_themes; then
|
|
# user theme directory
|
|
cecho "Installing themes" fg_cyan
|
|
mkdir -p ~/.themes
|
|
bash options/lavanda-gtk-theme.sh
|
|
bash options/kora-gtk-icons.sh
|
|
bash options/tokyonight-gtk-theme.sh
|
|
fi
|
|
fi
|
|
|
|
if $is_server; then
|
|
echo ":3"
|
|
else
|
|
# wayland specific packages
|
|
if echo $XDG_SESSION_TYPE | grep -q "wayland"; then
|
|
cecho "Installing wayland specific packages" fg_cyan
|
|
sudo apt install -y wl-clipboard
|
|
fi
|
|
|
|
# gnome specific packages
|
|
if echo $DESKTOP_SESSION | grep -q "gnome" && $install_gnome_configs; then
|
|
bash options/gnome-configs.sh
|
|
fi
|
|
fi
|
|
# nerdfonts
|
|
if $install_nerdfonts; then
|
|
cecho "Installing nerdfonts" fg_cyan
|
|
bash options/nerdfonts.sh
|
|
fi
|
|
|
|
# xdg defaults
|
|
# xdg-mime default nemo.desktop inode/directory
|
|
xdg-mime default pcmanfm.desktop inode/directory
|
|
xdg-mime default nvim.desktop text/plain
|
|
xdg-mime default org.pwmt.zathura.desktop application/pdf
|
|
# This command installs kitty as an option for the default terminal emulator within the alternatives system, assigning it a priority of 50
|
|
sudo update-alternatives --install /usr/bin/x-terminal-emulator x-terminal-emulator /usr/bin/kitty 50
|
|
|
|
sed -i "s/^DESKTOP=.*/DESKTOP=desktop/" /etc/xdg/user-dirs.defaults
|
|
sed -i "s/^DOWNLOAD=.*/DOWNLOAD=downloads/" /etc/xdg/user-dirs.defaults
|
|
sed -i "s/^TEMPLATES=.*/TEMPLATES=templates/" /etc/xdg/user-dirs.defaults
|
|
sed -i "s/^PUBLICSHARE=.*/PUBLICSHARE=public/" /etc/xdg/user-dirs.defaults
|
|
sed -i "s/^DOCUMENTS=.*/DOCUMENTS=documents/" /etc/xdg/user-dirs.defaults
|
|
sed -i "s/^MUSIC=.*/MUSIC=music/" /etc/xdg/user-dirs.defaults
|
|
sed -i "s/^PICTURES=.*/PICTURES=pictures/" /etc/xdg/user-dirs.defaults
|
|
sed -i "s/^VIDEOS=.*/VIDEOS=videos/" /etc/xdg/user-dirs.defaults
|
|
|
|
sed -i 's/^XDG_DESKTOP_DIR=.*/XDG_DESKTOP_DIR="$HOME\/desktop"/' ~/.config/user-dirs.dirs
|
|
sed -i 's/^XDG_DOWNLOAD_DIR=.*/XDG_DOWNLOAD_DIR="$HOME\/downloads"/' ~/.config/user-dirs.dirs
|
|
sed -i 's/^XDG_TEMPLATES_DIR=.*/XDG_TEMPLATES_DIR="$HOME\/templates"/' ~/.config/user-dirs.dirs
|
|
sed -i 's/^XDG_PUBLICSHARE_DIR=.*/XDG_PUBLICSHARE_DIR="$HOME\/public"/' ~/.config/user-dirs.dirs
|
|
sed -i 's/^XDG_DOCUMENTS_DIR=.*/XDG_DOCUMENTS_DIR="$HOME\/documents"/' ~/.config/user-dirs.dirs
|
|
sed -i 's/^XDG_MUSIC_DIR=.*/XDG_MUSIC_DIR="$HOME\/music"/' ~/.config/user-dirs.dirs
|
|
sed -i 's/^XDG_PICTURES_DIR=.*/XDG_PICTURES_DIR="$HOME\/pictures"/' ~/.config/user-dirs.dirs
|
|
sed -i 's/^XDG_VIDEOS_DIR=.*/XDG_VIDEOS_DIR="$HOME\/videos"/' ~/.config/user-dirs.dirs
|
|
|
|
# gamecube adapter udev rule
|
|
# obsidian
|
|
# private internet access
|
|
# soulseek
|
|
# renoise
|
|
# yabridge
|
|
# synthv
|
|
# ilok license manager
|
|
# vital synth?
|
|
# super right click resize
|
|
# super click move
|
|
# tiling manager
|
|
|
|
|
|
# install my dotfiles
|
|
if $install_dotfiles; then
|
|
cecho "Installing billypom dotfiles" fg_cyan
|
|
bash options/dotfiles.sh
|
|
fi
|
|
|
|
if $install_rtaudio; then
|
|
sudo apt install pavucontrol pipewire-jack pipewire-audio-client-libraries libspa-0.2-jack pulseaudio-utils
|
|
cecho "Creating pipewire media session with jack config" fg_cyan
|
|
touch /etc/pipewire/media-session.d/with-jack
|
|
cp /usr/share/doc/pipewire/examples/ld.so.conf.d/pipewire-jack-*.conf /etc/ld.so.conf.d/
|
|
ldconfig
|
|
# https://wiki.linuxaudio.org/wiki/system_configuration#cpu_frequency_scaling
|
|
# printf '[Unit]\nDescription=Prepare system for real-time audio\n\n[Service]\nType=oneshot\nExecStart=/bin/bash /usr/local/bin/rt-audio-setup\nRemainAfterExit=yes\n\n[Install]\nWantedBy=multi-user.target' > /etc/systemd/system/rtaudio-setup.service
|
|
# echo 'echo -n performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor' | sudo tee /usr/local/bin/rt-audio-setup
|
|
# sudo chmod +x /usr/local/bin/rt-audio-setup
|
|
# sudo systemctl enable rtaudio-setup
|
|
# sudo systemctl start rtaudio-setup
|
|
# https://wiki.linuxaudio.org/wiki/system_configuration#limitsconfaudioconf
|
|
printf '@audio - rtprio 90 # maximum realtime priority\n@audio - memlock unlimited # maximum locked-in-memory address space (KB)' > /etc/security/limits.d/rtaudio.conf
|
|
echo "vm.swappiness=10" > /etc/sysctl.d/99-sysctl.conf
|
|
# echo "blacklist snd_hda_intel" >> /etc/modprobe.d/blacklist.conf
|
|
cecho "DO THIS STUFF MANUALLY BCUS IDK" fg_red
|
|
printf 'In the file `/etc/default/grub` change this line:\nGRUB_CMDLINE_LINUX="preempt=full threadirqs cpufreq.default_governor=performance"\n\nThen reboot\n\n'
|
|
fi
|
|
|
|
|
|
echo "\e[0;32m--- debian install script finished running ---\e[0m"
|