Skip to content

Instantly share code, notes, and snippets.

@teohhanhui
Last active May 19, 2025 02:25
Show Gist options
  • Save teohhanhui/44c22c64ef2ebfbb5dcd50c5fc8eeca1 to your computer and use it in GitHub Desktop.
Save teohhanhui/44c22c64ef2ebfbb5dcd50c5fc8eeca1 to your computer and use it in GitHub Desktop.
Fedora Asahi Remix setup notes

dnf-automatic

sudo tee /etc/dnf/dnf5-plugins/automatic.conf <<'EOF'
[commands]
apply_updates = no
download_updates = no
reboot = never

[emitters]
emit_via = stdio,motd
EOF
sudo systemctl enable --now dnf5-automatic.timer

References:

DNS over TLS (DoT) - Cloudflare DNS

sudo mkdir -p /etc/systemd/resolved.conf.d
sudo tee /etc/systemd/resolved.conf.d/dns_over_tls.conf <<'EOF'
[Resolve]
DNS=1.1.1.1#one.one.one.one 1.0.0.1#one.one.one.one 2606:4700:4700::1111#one.one.one.one 2606:4700:4700::1001#one.one.one.one
Domains=~.
DNSOverTLS=yes
EOF
sudo tee /etc/NetworkManager/conf.d/99-default-disable-dns-over-tls.conf <<'EOF'
[connection]
connection.dns-over-tls=0
EOF
sudo systemctl restart systemd-resolved
sudo systemctl restart NetworkManager

References:

dracut

zstd compression

sudo tee /etc/dracut.conf.d/compress_zstd.conf <<'EOF'
compress="zstd"
EOF
sudo dracut -f

References:

fcitx5

sudo dnf5 install fcitx5 fcitx5-chinese-addons fcitx5-configtool fcitx5-gtk fcitx5-qt
sudo dnf5 remove imsettings
    • KDE Plasma: Go to System Settings > Input Devices > Virtual Keyboard. Select Fcitx 5 Wayland Launcher. Apply.
    • GNOME: mkdir -p ~/.config/autostart && cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart/
mkdir -p ~/.config/environment.d
echo 'XMODIFIERS=@im=fcitx' | tee -a ~/.config/environment.d/envvars.conf
  1. Reboot to apply changes.

References:

gnome-settings-daemon

Custom keybindings

Add keyboard shortcuts for keys that don't exist on the MacBook Air (M2, 2022) US keyboard:

  • Ctrl + Screen Brightness Down for Keyboard Brightness Down.
  • Ctrl + Screen Brightness Up for Keyboard Brightness Up.
gsettings set org.gnome.settings-daemon.plugins.media-keys keyboard-brightness-down "['<Ctrl>XF86MonBrightnessDown']"
gsettings set org.gnome.settings-daemon.plugins.media-keys keyboard-brightness-up "['<Ctrl>XF86MonBrightnessUp']"

References:

hid_apple

echo '2' | sudo tee -a /sys/module/hid_apple/parameters/fnmode
echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_fn_leftctrl
echo '1' | sudo tee -a /sys/module/hid_apple/parameters/swap_opt_cmd
sudo tee /etc/modprobe.d/hid_apple.conf <<'EOF'
options hid_apple fnmode=2
options hid_apple swap_fn_leftctrl=1
options hid_apple swap_opt_cmd=1
EOF
sudo tee /etc/dracut.conf.d/hid_apple.conf <<'EOF'
install_items+=" /etc/modprobe.d/hid_apple.conf "
EOF
sudo dracut -f

References:

hwdb

Remap keys

Change some of the keys on MacBook Air (M2, 2022) US keyboard:

  • Right ⌥ option key for rightctrl (instead of rightalt or rightmeta)
sudo tee /etc/udev/hwdb.d/61-macbook-keyboard.hwdb <<'EOF'
evdev:input:b0019v05ACp0351e0240*
 KEYBOARD_KEY_700e6=rightctrl
EOF
sudo systemd-hwdb update
sudo udevadm trigger

References:

Kernel parameters

Use the notch area on MacBook

  1. Edit /etc/defualt/grub file.

Add apple_dcp.show_notch=1 to the end of GRUB_CMDLINE_LINUX_DEFAULT, e.g.:

GRUB_CMDLINE_LINUX_DEFAULT="rhgb quiet rootflags=subvol=root apple_dcp.show_notch=1"
sudo grub2-mkconfig -o /boot/grub2/grub.cfg
  1. Reboot to apply changes.

References:

ntfs3

DO NOT USE - The ntfs3 kernel module still suffers from data corruption issues. Stick to ntfs-3g for now...

sudo dnf5 remove ntfs-3g

References:

udev rules

Hide APFS partitions from udisks

sudo tee /etc/udev/rules.d/61-apfs-partitions.rules <<'EOF'
# Apple APFS container
ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_TYPE}=="7c3457ef-0000-11aa-aa11-00306543ecac", ENV{UDISKS_IGNORE}="1"
         
# Apple APFS preboot partition
ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_TYPE}=="69646961-6700-11aa-aa11-00306543ecac", ENV{UDISKS_IGNORE}="1"
         
# Apple APFS recovery partition
ENV{ID_PART_ENTRY_SCHEME}=="gpt", ENV{ID_PART_ENTRY_TYPE}=="52637672-7900-11aa-aa11-00306543ecac", ENV{UDISKS_IGNORE}="1"
EOF
sudo udevadm trigger

References:

Limit battery charge threshold

sudo tee /etc/udev/rules.d/10-battery.rules <<'EOF'
SUBSYSTEM=="power_supply", KERNEL=="macsmc-battery", ATTR{charge_control_end_threshold}="80", ATTR{charge_control_start_threshold}="75"
EOF
sudo udevadm trigger

References:

zswap

sudo sysctl -w vm.page-cluster=0
sudo sysctl -w vm.swappiness=180
sudo sysctl -w vm.vfs_cache_pressure=75
sudo sysctl -w vm.watermark_boost_factor=0
sudo sysctl -w vm.watermark_scale_factor=125
sudo tee /etc/sysctl.d/99-vm-zswap-parameters.conf <<'EOF'
vm.page-cluster = 0
vm.swappiness = 180
vm.vfs_cache_pressure = 75
vm.watermark_boost_factor = 0
vm.watermark_scale_factor = 125
EOF
echo 'zstd' | sudo tee -a /sys/module/zswap/parameters/compressor
sudo tee /etc/tmpfiles.d/zswap.conf <<'EOF'
#Type Path                                            Mode UID  GID  Age  Content
w     /sys/module/zswap/parameters/compressor         -    -    -    -    zstd
EOF

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment