Setting Up Fedora Workstation: A Comprehensive Guide
In this blog post, I'll walk you through setting up Fedora Workstation, including updating the system, installing required packages, and configuring various settings.
Step 0: Configure DNF (Optional)
To configure DNF to use the fastest mirrors, enable default yes prompts, and increase the number of parallel downloads, add the following script:
declare -A config_flags
config_flags=(["defaultyes"]="True" ["fastestmirror"]="True" ["max_parallel_downloads"]="10")
for key in "${!config_flags[@]}"; do
if grep -q "^$key=" /etc/dnf/dnf.conf; then
sudo sed -i "s/^$key=.*/$key=${config_flags[$key]}/" /etc/dnf/dnf.conf
else
echo "$key=${config_flags[$key]}" | sudo tee -a /etc/dnf/dnf.conf
fi
done
This script checks if the configuration options are already present in the /etc/dnf/dnf.conf
file and updates them. If the options are not present, the script adds them to the file. The following lines will be added or updated:
defaultyes=True
fastestmirror=True
max_parallel_downloads=10
These options enable the following features:
defaultyes=True
: Automatically answers yes to any prompts, streamlining the update and installation process.fastestmirror=True
: Ensures that DNF uses the fastest available mirror for downloading packages.max_parallel_downloads=10
: Increases the number of parallel downloads, which can speed up the downloading process.
Step 1: Update the System
First, update your Fedora system by running the following command in the terminal:
sudo dnf update -y
Step 2: Install Required Packages
Install the necessary packages with the following commands:
Add Visual Studio Code repository
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
sudo sh -c '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" > /etc/yum.repos.d/vscode.repo'
sudo dnf check-update
Install packages
sudo dnf install -y \
"https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm" \
"https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm" \
"zsh" \
"util-linux-user" \
"gnome-tweaks" \
"dnf-plugins-core" \
"texlive-scheme-basic" \
"texlive-tex-gyre" \
"google-noto-emoji-fonts" \
"flatpak" \
"code" \
"gnome-extensions-app" \
"gnome-shell-extension-user-theme" \
"gnome-shell-extension-caffeine"
Step 3: Install Oh My Zsh and Node Version Manager
Install Oh My Zsh by running the following command:
# Install Oh My Zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# Install Node Version Manager (if you do this after installing zsh, but before rebooting, you might need to add the path to your .zshrc file manually - I'd recommend rebooting first)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
Step 4: Enable Fractional Scaling for Wayland
If you can use your computer without fractional scaling, all the best to you! Both of my computers are too large at 200% and too small at 100% scaling, so unfortunately I need to use fractional. The good news, is my workflow no longer has blurry apps. To enable fractional scaling for Wayland, run the following command:
gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"
Step 5: Fix Blurry UI on Fractional Wayland Visual Studio Code and Set Dark Mode Theme
To fix the blurry UI and set the dark mode theme, you'll need to modify the Visual Studio Code .desktop
file. Locate the file as described in Step 2 of the previous section and edit the Exec
lines to include the --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations
flags, also, if you aren't using the custom header, you can update GTK_THEME
environment variable to always use dark mode by adding the dark version of your theme. If you're using the default Adwaita theme (Like you should on gnome), you can use the Adwaita-dark
theme.
Here's an example of how the modified .desktop
file should look like:
[Desktop Entry]
Name=Visual Studio Code
Comment=Code Editing. Redefined.
GenericName=Text Editor
Exec=env GTK_THEME=Adwaita-dark /usr/share/code/code --unity-launch --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations %F
Icon=vscode
Type=Application
StartupNotify=false
StartupWMClass=Code
Categories=TextEditor;Development;IDE;
MimeType=text/plain;inode/directory;application/x-code-workspace;
Actions=new-empty-window;
Keywords=vscode;
[Desktop Action new-empty-window]
Name=New Empty Window
Exec=env GTK_THEME=Adwaita-dark /usr/share/code/code --new-window --ozone-platform-hint=auto --enable-features=WaylandWindowDecorations %F
Icon=vscode
Step 6: Apply settings for VS Code
Here are the settings I use for VS Code. Obviously you can change them to your liking, but these are the settings I recommend. To apply the settings for VS Code, copy what you need from the following settings:
{
"editor.codeActionsOnSave": {
"source.organizeImports": true
},
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.fontFamily": "Comic Code Ligatures, Jetbrains Mono, Operator Mono, ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace, Cascadia Code, Menlo, Monaco, 'Courier New', monospace",
"editor.fontSize": 14,
"editor.fontLigatures": true,
"editor.formatOnSave": true,
"editor.inlineSuggest.enabled": true,
"editor.lineHeight": 26,
"editor.linkedEditing": true,
"editor.minimap.enabled": false,
"editor.quickSuggestions": {
"strings": true
},
"editor.renderLineHighlight": "none",
"editor.tabSize": 2,
"explorer.confirmDelete": false,
"explorer.decorations.badges": false,
"files.associations": {
"*.css": "tailwindcss"
},
"files.trimTrailingWhitespace": true,
"git.autofetch": true,
"git.confirmSync": false,
"git.enableSmartCommit": true,
"git.mergeEditor": true,
"github.copilot.enable": {
"*": true,
"yaml": true,
"plaintext": true,
"markdown": true
},
"githubPullRequests.createOnPublishBranch": "never",
"githubPullRequests.fileListLayout": "flat",
"githubPullRequests.pullBranch": "never",
"terminal.external.linuxExec": "/bin/zsh",
"terminal.integrated.enableMultiLinePasteWarning": false,
"typescript.updateImportsOnFileMove.enabled": "always",
"window.commandCenter": true,
"window.menuBarVisibility": "toggle",
"workbench.colorCustomizations": {
"[Material Theme]": {
"activityBarBadge.background": "#FF7042",
"activityBar.activeBorder": "#FF7042",
"list.activeSelectionForeground": "#FF7042",
"list.inactiveSelectionForeground": "#FF7042",
"list.highlightForeground": "#FF7042",
"scrollbarSlider.activeBackground": "#FF704250",
"editorSuggestWidget.highlightForeground": "#FF7042",
"textLink.foreground": "#FF7042",
"progressBar.background": "#FF7042",
"pickerGroup.foreground": "#FF7042",
"tab.activeBorder": "#FF7042",
"notificationLink.foreground": "#FF7042",
"editorWidget.resizeBorder": "#FF7042",
"editorWidget.border": "#FF7042",
"settings.modifiedItemIndicator": "#FF7042",
"settings.headerForeground": "#FF7042",
"panelTitle.activeBorder": "#FF7042",
"breadcrumb.activeSelectionForeground": "#FF7042",
"menu.selectionForeground": "#FF7042",
"menubar.selectionForeground": "#FF7042",
"editor.findMatchBorder": "#FF7042",
"selection.background": "#FF704240",
"statusBarItem.remoteBackground": "#FF7042"
}
},
"workbench.colorTheme": "Community Material Theme Darker",
"workbench.iconTheme": "eq-material-theme-icons-palenight",
"workbench.productIconTheme": "material-product-icons",
"workbench.startupEditor": "none",
"workbench.tree.indent": 12,
"emmet.excludeLanguages": [],
"emmet.includeLanguages": {
"markdown": "html",
"vue-html": "html",
"javascript": "javascriptreact"
},
"tailwindCSS.emmetCompletions": true,
"tailwindCSS.includeLanguages": {
"plaintext": "javascript",
"vue-html": "html",
"vue": "html",
"javascript": "javascriptreact"
},
"[markdown]": {
"files.trimTrailingWhitespace": false
},
"[shellscript]": {
"editor.defaultFormatter": "foxundermoon.shell-format"
},
"materialTheme.accent": "Orange"
}
Step 7: Setup better font rendering and support for Microsoft and Apple fonts
To setup better font rendering, run my font patches using the following command:
curl -sSL https://raw.githubusercontent.com/strangekai/fedora-improvements/main/font-rendering.sh | bash
If you want to see what the script does, you can view it here. It is a work in progress, so it may not work for you. I will update it as I find more things to improve, and once I have an official release with an uninstaller, I will update this guide.
https://github.com/strangekai/fedora-improvements (font-rendering.sh)
If you wanted to keep the default font rendering, but fix microsoft and apple fonts, you can run the following command from chriscowleyunix's fork of fontconfig-font-replacements:
sudo dnf copr enable chriscowleyunix/better_fonts -y
sudo dnf install -y fontconfig-font-replacements
As a sidenote, my mono font of choice is Comic Code Ligatures. It costs but you can download it here: https://tosche.net/fonts/comic-code
Step 8: Install and configure the GTK4 theme for firefox
To install the GTK4 theme for firefox, run the following command:
curl -s -o- https://raw.githubusercontent.com/rafaelmardojai/firefox-gnome-theme/master/scripts/install-by-curl.sh | bash
My preference is to set my bookmarks bar to only appear on the new tab page and add the following gnomeTheme preferences to my firefox about:config page:
gnomeTheme.hideSingleTab: true
gnomeTheme.normalWidthTabs: true
Conclusion
Now you have successfully set up Fedora Workstation with updated packages, configurations, GTK4 themes for firefox, and Visual Studio Code wayland fixes with a dark mode theme enabled. If you have any questions, feel free to email me at kai@macmaster.co.uk.