Last active
August 8, 2024 07:24
-
-
Save thass0/d4b934a1b76f6abbdfe6a3adcd32a651 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/sh | |
| # Script meant to set up a new Fedora installation | |
| set -ex | |
| if [ "$XDG_SESSION_DESKTOP" == "gnome" ] && [ "$XDG_SESSION_TYPE" == "wayland" ]; then | |
| gsettings set org.gnome.desktop.input-sources xkb-options "['caps:ctrl_modifier']" | |
| elif [ "$XDG_SESSION_TYPE" == "x11" ]; then | |
| setxkbmap -layout us -option ctrl:swapcaps | |
| else | |
| 1>&2 echo "Failed to swap caps and ctrl" | |
| exit 1 | |
| fi | |
| # Script to assist in moving other data | |
| curl https://gist.githubusercontent.com/thass0/2d308a5ba2ce3dc25277bbcf7fb50f14/raw/1edea857b510f98e0169165b092cc29935dd2cd0/archive.sh > archive.sh | |
| chmod +x archive.sh | |
| # Need to delete old files to the clone and checkout always work. | |
| rm -rf .bash_env .bashrc .bash_profile .emacs.d .gdbinit .gitconfig .hunspell_personal | |
| rm -rf .dotfiles | |
| git clone --bare https://github.com/thass0/dotfiles $HOME/.dotfiles | |
| git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME checkout | |
| git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME config --local status.showUntrackedFiles no | |
| ###################### | |
| # Apps and libraries # | |
| ###################### | |
| sudo dnf update -y # Takes forever | |
| sudo dnf install -y enchant2-devel pkgconfig # jinx in my Emacs config needs this | |
| sudo dnf install -y clang-tools-extra # C language server in my Emacs config needs this | |
| sudo dnf install -y emacs thunderbird htop gimp keepassxc vim | |
| sudo dnf install -y speech-dispatcher-utils speech-dispatcher # Firefox wants these for Discord to work | |
| # VS Code | |
| sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc | |
| echo -e "[code]\nname=Visual Studio Code\nbaseurl=https://packages.microsoft.com/yumrepos/vscode\nenabled=1\ngpgcheck=1\ngpgkey=https://packages.microsoft.com/keys/microsoft.asc" | sudo tee /etc/yum.repos.d/vscode.repo > /dev/null | |
| sudo dnf install code | |
| # For reference see: https://docs.fedoraproject.org/en-US/quick-docs/zoom/. | |
| # Download link from: https://zoom.us/download?os=linux | |
| wget https://zoom.us/client/6.0.2.4680/zoom_x86_64.rpm | |
| sudo dnf install -y zoom_x86_64.rpm | |
| rm -f zoom_x86_64.rpm | |
| sudo dnf install -y flatpak | |
| flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo | |
| flatpak install -y flathub org.gnome.Extensions | |
| flatpak install -y flathub com.spotify.Client | |
| flatpak install -y flathub com.discordapp.Discord | |
| flatpak install -y flathub org.signal.Signal | |
| # Installing Firefox with Flatpak works best | |
| flatpak install flathub org.mozilla.firefox | |
| # Misc. libraries and apps that I found I was missing at some points | |
| sudo dnf install -y ncurses-devel byacc | |
| ####################### | |
| # Nvidida GPU drivers # | |
| ####################### | |
| # Needed to install Nvidia drivers and some codecs | |
| sudo dnf install https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \ | |
| https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm | |
| sudo dnf config-manager --enable fedora-cisco-openh264 | |
| sudo dnf install -y akmod-nvidia xorg-x11-drv-nvidia-cuda | |
| modinfo -F version nvidia | |
| if [ $? -ne 0 ]; then | |
| 1>&2 echo "Failed to install Nvidia drivers" | |
| exit 1 | |
| fi | |
| echo "As a last step, switch to X11 so windowing works well" | |
| echo "See: https://docs.fedoraproject.org/en-US/quick-docs/configuring-xorg-as-default-gnome-session/" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment