Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AssyMcGee/1b08dc71415c07a74519752e60b8b2e2 to your computer and use it in GitHub Desktop.
Save AssyMcGee/1b08dc71415c07a74519752e60b8b2e2 to your computer and use it in GitHub Desktop.

2022 Zephyrus G14 Fedora Silverblue Setup

GPU Naming

Most applications in Linux will report the names of the two GPUs as follows.

  • Dimgrey Cavefish is the dedicated GPU (dGPU)
  • Yellow Carp is the integrated GPU (iGPU)

Boot Hotkeys

  • F2: Enter BIOS
  • LSHIFT: Enter GRUB

Wifi Card

The included wifi card has spotty support right now on Linux.

You may consider replacing it with an Intel AX200 or Intel AX210 instead, for plug-and-play support.

BIOS Settings

Secure Boot must be disabled in order for kernel arguments to be respected.

Fractional Scaling

The default settings of 100% / 200% / 300% don't do it for me, I like 150%. Run the following command.

$ gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']"

Log out and log back in.

Create a Toolbox

Toolbox is a containerized command line environment on top of your Fedora base system.

$ toolbox create
$ toolbox enter

Terminal Customization

The default settings are fine but a little boring. First install some pre-requisite packages.

$ sudo dnf install ruby-devel zsh util-linux-user redhat-rpm-config gcc gcc-c++ make

Next install some Nerd Fonts.

$ git clone --depth=1 https://github.com/ryanoasis/nerd-fonts ~/.nerd-fonts
$ cd .nerd-fonts 
$ sudo ./install.sh
$ sudo dnf install fontawesome-fonts

Next install Starship.

$ curl -sS https://starship.rs/install.sh | sh

If you use Bash add this to the end of ~/.bashrc:

eval "$(starship init bash)"

If you use ZSH add this to the end of ~/.zshrc:

eval "$(starship init zsh)"

Configure Starship

$ starship preset pastel-powerline > ~/.config/starship.toml
$ sudo nano ~/.config/starship.toml

Add this to ~/.config/starship.toml:

format = """
[](#9A348E)\
$username\
[](bg:#DA627D fg:#9A348E)\
$directory\
[](fg:#DA627D bg:#FCA17D)\
$git_branch\
$git_status\
[](fg:#FCA17D bg:#86BBD8)\
$c\
$elixir\
$elm\
$golang\
$haskell\
$java\
$julia\
$nodejs\
$nim\
$rust\
[](fg:#86BBD8 bg:#06969A)\
$docker_context\
[](fg:#06969A bg:#33658A)\
$time\
[ ](fg:#33658A)\
"""

# Disable the blank line at the start of the prompt
# add_newline = false

# You can also replace your username with a neat symbol like  to save some space
[username]
show_always = true
style_user = "bg:#9A348E"
style_root = "bg:#9A348E"
format = '[$user ]($style)'

[directory]
style = "bg:#DA627D"
format = "[ $path ]($style)"
truncation_length = 3
truncation_symbol = "…/"

# Here is how you can shorten some long paths by text replacement
# similar to mapped_locations in Oh My Posh:
[directory.substitutions]
"Documents" = " "
"Downloads" = " "
"Music" = " "
"Pictures" = " "
# Keep in mind that the order matters. For example:
# "Important Documents" = "  "
# will not be replaced, because "Documents" was already substituted before.
# So either put "Important Documents" before "Documents" or use the substituted version:
# "Important  " = "  "

[c]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'

[docker_context]
symbol = " "
style = "bg:#06969A"
format = '[ $symbol $context ]($style) $path'

[elixir]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'

[elm]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'

[git_branch]
symbol = ""
style = "bg:#FCA17D"
format = '[ $symbol $branch ]($style)'

[git_status]
style = "bg:#FCA17D"
format = '[$all_status$ahead_behind ]($style)'

[golang]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'

[haskell]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'

[java]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'

[julia]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'

[nodejs]
symbol = ""
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'

[nim]
symbol = " "
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'

[rust]
symbol = ""
style = "bg:#86BBD8"
format = '[ $symbol ($version) ]($style)'

[time]
disabled = false
time_format = "%R" # Hour:Minute Format
style = "bg:#33658A"
format = '[ ♥ $time ]($style)'

I like ZSH, but if you don't you can stop here.

Go to your gnome-terminal settings and under your default profile go to the Command tab.

Check off the "Run a custom command instead of my shell".

Add zsh to the text box below that check box

Next install Oh-My-ZSH

$ sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Go through the configuration.

Next install the Powerlevel10k Theme

$ git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k
$ echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>~/.zshrc

Go through the configureation by typing p10k configure.

Install syntax-highlighting and syntax-autosuggestions plug-ins.

$ git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
$ git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Add them to your plug-ins list in your file ~/.zshrc.

plugins=( [plugins...] zsh-syntax-highlighting zsh-autosuggestions)

Reload the configuration.

$ source ~/.zshrc

Fixing Suspend

S2 sleep doesn't work on the machine by default. To enable it, some pre-requisite packages need to be installed.

$ rpm-ostree install acpica-tools pcre-tools
$ reboot

Next, run the following commands to generate a working DSDT table, which will allow the machine to enter S3 sleep.

$ cd ~/Downloads
$ git clone https://gitlab.com/marcaux/g14-2021-s3-dsdt.git
$ cd g14-2021-s3-dsdt
$ ./modify-dsdt.sh

Next, update the GRUB configuration.

$ sudo nano /etc/default/grub

And add the following contents to the file:

GRUB_EARLY_INITRD_LINUX_CUSTOM="../../acpi_override"

Save and exit the editor with CTRL+X. Press y to confirm saving the file changes.

Regenerate grub next.

$ sudo grub2-mkconfig -o /etc/grub2.cfg

Finally, append a kernel argument to enable deep sleep as follows, and shutdown instead of rebooting.

$ rpm-ostree kargs --append=mem_sleep_default=deep
$ shutdown

When you boot back up, verify the changes were successful with the following command.

$ grep -q '\[deep\]' /sys/power/mem_sleep && echo 'success'

If the output says success, you should be able to resume from suspend with no issues.

Optionally, you can remove the two installed packages as follows.

$ rpm-ostree uninstall acpica-tools pcre-tools
$ reboot

Keep in mind that the steps in this section will need to be repeated with each BIOS update.

Fixing Random Crashing

There is an open issue here regarding random freezes with the 6900HS / 6800HS hardware. As a workaround:

$ rpm-ostree kargs --append=initcall_blacklist=amd_pstate_init
$ reboot

When you boot back up, verify the changes were successful with the following command.

$ grep -q 'acpi-cpufreq' /sys/devices/system/cpu/cpu0/cpufreq/scaling_driver && echo 'success'

If the output says success, you should no longer be prone to frequent crashes.

Asus Linux Repo

Add the Asus Linux repository for additional necessary software.

$ sudo nano /etc/yum.repos.d/asus.repo

Paste the following in to the file:

[copr:copr.fedorainfracloud.org:lukenukem:asus-linux]
name=Copr repo for asus-linux owned by lukenukem
baseurl=https://download.copr.fedorainfracloud.org/results/lukenukem/asus-linux/fedora-$releasever-$basearch/
type=rpm-md
skip_if_unavailable=True
gpgcheck=1
gpgkey=https://download.copr.fedorainfracloud.org/results/lukenukem/asus-linux/pubkey.gpg
repo_gpgcheck=0
enabled=1
enabled_metadata=1

Don't put a newline at the end. CTRL+X to exit the file. Press y to confirm saving.

asusctl

$ rpm-ostree install asusctl supergfxctl
$ reboot
$ systemctl enable --now supergfxd.service
$ reboot

asusctl-gex

Install the asusctl-gex extension to control certain features of the hardware. Learn more here.

RPMFusion

RPMFusion is a third party repository with additional commonly installed packages. Install it as follows.

$ rpm-ostree install --apply-live \
    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
$ rpm-ostree update
$ reboot

Firefox

The default install of Firefox is not packaged as a Flatpak. There are certain issues with codecs on streaming sites that can be fixed by using the Flathub package instead. To install it:

$ rpm-ostree override remove firefox firefox-langpacks
$ flatpak remove --all
$ flatpak install flathub \
    org.mozilla.firefox \
    org.freedesktop.Platform.ffmpeg-full
$ sudo flatpak override \
    --socket=wayland \
    --env=MOZ_ENABLE_WAYLAND=1 \
    org.mozilla.firefox
$ reboot

Be sure to add the following to about:config in Firefox to enable hardware decoding and disable Pocket integration.

media.ffmpeg.vaapi.enabled = true
media.ffvpx.enabled = false
media.rdd-vpx.enabled = false
extensions.pocket.enabled = false
full-screen-api.warning.timeout = 0
 

GNOME Applications

To install a starter set of GNOME & GNOME-related applications:

$ flatpak install flathub \
    org.gnome.TextEditor \
    org.gnome.Evince \
    org.gnome.eog \
    org.gnome.Cheese \
    org.gnome.SoundRecorder \
    io.github.celluloid_player.Celluloid \
    org.gnome.Lollypop \
    org.gnome.Geary \
    org.gnome.Calendar \
    org.gnome.baobab \
    org.gnome.Firmware \
    org.gnome.Boxes \
    com.usebottles.bottles \
    com.github.tchx84.Flatseal \
    com.mattjakeman.ExtensionManager

GNOME Extensions

GNOME extensions can be installed from extensions.gnome.org. They can be configured using the Extension Manager application.

Some popular ones include the following.

Other Applications

Install any other software you like, as well. For example:

$ flatpak install flathub \
    org.signal.Signal \
    com.discordapp.Discord \
    com.visualstudio.code \
    org.telegram.desktop 

Steam, Proton, Lutris, Gamemode, & MangoHud

  • Use Steam to buy & play Linux-native games.
  • Use Proton to play Windows-only games on Linux via Steam.
  • Use Lutris to play Windows-only games not on Steam.
  • Use Gamemode to see increased performance in games.
  • Use MangoHud to see system stats in games.
$ flatpak install flathub \
    net.lutris.Lutris \
    org.freedesktop.Platform.VulkanLayer.MangoHud \
    com.valvesoftware.Steam \
    com.valvesoftware.Steam.Utility.gamescope \
    net.davidotek.pupgui2 \
    com.github.Matoking.protontricks
$ rpm-ostree install gnome-shell-extension-gamemode
$ reboot

Controllers in Steam Games Fix

This section requires that the rpmfusion-nonfree repository has been installed on your system.

The Steam Flatpak has issues detecting controllers by default. To fix this:

$ rpm-ostree install steam-devices
$ reboot

Next, perform the following steps.

  1. Launch Steam
  2. Lauch Big Picture Mode
  3. Go to Settings
  4. Go to Base configurations in the Controller section
  5. Select Desktop configuration
  6. Select Browse Configs
  7. Select templates
  8. Select Show other controller types
  9. Select Gamepad (the variant for your specific controller, ex. PlayStation 5 controller)

Setup MangoHud

MangoHud can be used to show system stats in games. To create a MangoHud config file:

$ mkdir ~/.var/app/com.valvesoftware.Steam/config/MangoHud
$ touch ~/.var/app/com.valvesoftware.Steam/config/MangoHud/MangoHud.conf

You can edit the config as follows:

$ nano ~/.var/app/com.valvesoftware.Steam/config/MangoHud/MangoHud.conf

Documentation here on the config file.

If you just want to see everything available, add full to the file and save.

Default Keybinds

  • Shift_L+F2: Toggle Logging
  • Shift_L+F4: Reload Config
  • Shift_R+F12: Toggle Hud

Enabling Gamemode & MangoHud in a Steam Game

  1. Right click on the game
  2. Click Properties
  3. In the General tab, put the following in launch options
gamemoderun mangohud %command%

If you have other things set in there, make sure gamemoderun mangohud comes first.

Final Fantasy XIV Setup

FFXIV is a real pain to set up now. To do so anyway, perform the following steps. The steps have been broken into parts for ease of readability.

Part 1: Steam Play and ProtonUp

  • In Steam, go to Settings, Steam Play
  • Enable Steam Play for all other titles
  • Run other titles with whatever the latest official Proton version is
  • Restart Steam
  • Install FFXIV through Steam library
  • Wipe the existing game install by deleting the below directory, if it exists
$HOME/.steam/steam/steamapps/compatdata/39210
  • Use ProtonUp to get Proton-6.21-GE-2 and GE-Proton7-14

Part 2: Configuring Proton-6.21-GE-2

  • Navigate to the below directory using the file manager
/var/home/jacob/.var/app/com.valvesoftware.Steam/.steam/steam/compatibilitytools.d/Proton-6.21-GE-2/protonfixes
  • Open terminal in this directory.
  • Run the below command.
$ ./winetricks --self-update
  • Navigate to the gamefixes directory in the current directory.
  • Rename 39210.py to 39210.py.bak
  • Put this file in that directory

Part 3: Creation of compatdata with Proton 6.3-8

  • In Steam, right click FFXIV, Properties
  • Make sure no launch args in General tab
  • Set compatibility to Proton 6.3-8
  • Launch the game
  • Let the launcher sit there doing nothing for 10 seconds
  • Verify the below directory was created, then close the launcher
$HOME/.steam/steam/steamapps/compatdata/39210

Part 4: Launcher preparations with Proton-6.21-GE-2

  • In Steam, right click FFXIV, Properties
  • Set compatibility to Proton-6.21-GE-2
  • Launch ProtonTricks
  • Click FFXIV in the app
  • Click OK through all warnings in this entire process
  • Click Install an Application
  • Click OK
  • Click Cancel in the new window
  • Click Install a Windows DLL or Component
  • Click dotnet48
  • Click OK
  • Run through the process until you return to the main window
  • Repeat the above steps, but select vcrun2019 this time
  • Run through the process until you return to the main window
  • Close ProtonTricks
  • In Steam, right click FFXIV, Properties
  • In General tab, add the following launch arguments
XL_NO_SPACE_REQUIREMENTS=true XL_WINEONLINUX=true DSSENH=n %command%

Part 5: Installing the game with the launcher

  • Launch the game
  • If any error appears, click "No" or "OK"
  • The launcher should appear!
  • In Steam, right click FFXIV, Manage, Browse local files
  • Copy the file path of this directory and paste it into the launch directory the launcher asks for
  • Be sure to select that this is a steam service account when configuring the launcher
  • Sign in
  • Let the launcher download the game
  • Get to the title screen
  • Close the game

Part 6: Fixing the cutscenes with GE-Proton7-14

  • In Steam, right click FFXIV, Properties
  • Set compatibility to GE-Proton7-14
  • Navigate to the below directory using the file manager
/var/home/jacob/.var/app/com.valvesoftware.Steam/.steam/steam/compatibilitytools.d/GE-Proton7-14/protonfixes/gamefixes
  • Rename 39210.py to 39210.py.bak
  • Put the same replacement file used previously into this directory
  • Launch FFXIV
  • Verify the cutscenes in the game work from the title screen
  • Done

Prism Laucher

To play Minecraft, install Prism Launcher.

$ flatpak install flathub org.prismlauncher.PrismLauncher

By default, Prism Launcher will launch on iGPU. To change this:

$ cp /var/lib/flatpak/exports/share/applications/org.prismlauncher.PrismLauncher.desktop ~/.local/share/applications/
$ echo "PrefersNonDefaultGPU=true" >> ~/.local/share/applications/org.prismlauncher.PrismLauncher.desktop

You can verify the change worked by right clicking Prism Launcher in the GNOME app grid. If an option "Launch using Integrated Graphics Card" appears in the list, it worked.

You can verify the game is running on dGPU by opening the F3 menu in-game. GPU should say "Dimgrey Cavefish".

Setup Emulation

Execute the following commands to install emulators for many popular game consoles.

$ flatpak install flathub \
    dev.ares.ares \
    io.github.simple64.simple64 \
    org.DolphinEmu.dolphin-emu \
    org.yuzu_emu.yuzu \
    io.mgba.mGBA \
    org.desmume.DeSmuME \
    org.citra_emu.citra \
    org.duckstation.DuckStation \
    net.pcsx2.PCSX2 \
    net.rpcs3.RPCS3 \
    org.ppsspp.PPSSPP \
    org.libretro.RetroArch

Setup Melee

  • Download Slippi
  • Download m-overlay
    • Download love-11.3-x86_64.AppImage linked on the above page
    • Download m-overlay-x64.love from the Releases page
    • Run the following commands:
$ cd ~/Downloads
$ chmod +x ./Slippi-Launcher-2.1.15-x86_64.AppImage
$ chmod +x ./love-11.3-x86_64.AppImage
$ sudo setcap cap_sys_ptrace=eip ./love-11.3-x86_64.AppImage
$ rpm-ostree install libcap-devel
$ reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment