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:
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:
- https://wiki.archlinux.org/title/Systemd-resolved#DNS_over_TLS
- https://wiki.archlinux.org/title/Systemd-resolved#Manually
- https://developers.cloudflare.com/1.1.1.1/setup/linux/#systemd-resolved
- https://www.freedesktop.org/software/systemd/man/latest/resolved.conf.html
- https://networkmanager.pages.freedesktop.org/NetworkManager/NetworkManager/NetworkManager.conf.html#id-1.2.3.11
sudo tee /etc/dracut.conf.d/compress_zstd.conf <<'EOF'
compress="zstd"
EOF
sudo dracut -f
References:
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
. SelectFcitx 5 Wayland Launcher
.Apply
. - GNOME:
mkdir -p ~/.config/autostart && cp /usr/share/applications/org.fcitx.Fcitx5.desktop ~/.config/autostart/
- KDE Plasma: Go to
mkdir -p ~/.config/environment.d
echo 'XMODIFIERS=@im=fcitx' | tee -a ~/.config/environment.d/envvars.conf
- Reboot to apply changes.
References:
- https://fcitx-im.org/wiki/Setup_Fcitx_5#XDG_Autostart
- https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#KDE_Plasma
- https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#GNOME
Add keyboard shortcuts for keys that don't exist on the MacBook Air (M2, 2022) US keyboard:
Ctrl
+Screen Brightness Down
forKeyboard Brightness Down
.Ctrl
+Screen Brightness Up
forKeyboard 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:
- https://discourse.gnome.org/t/screen-brightness-with-keyboard-shorcuts-osd/9005/2
- https://gitlab.gnome.org/GNOME/gnome-settings-daemon/-/issues/142
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:
- https://wiki.archlinux.org/title/Apple_Keyboard#hid_apple_module_options
- https://wiki.archlinux.org/title/Kernel_module#Using_files_in_/etc/modprobe.d/
Change some of the keys on MacBook Air (M2, 2022) US keyboard:
- Right
⌥ option
key forrightctrl
(instead ofrightalt
orrightmeta
)
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:
- https://wiki.archlinux.org/title/Map_scancodes_to_keycodes#Using_udev
- https://wiki.archlinux.org/title/Keyboard_input#Using_evtest
- 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
- Reboot to apply changes.
References:
- https://wiki.archlinux.org/title/Kernel_parameters#GRUB
- https://discussion.fedoraproject.org/t/fedora-asahi-remix-installation-report-for-m1-pro-after-10-years-of-arch/91662/2
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:
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:
- https://wiki.archlinux.org/title/udisks#Hide_selected_partitions
- https://en.wikipedia.org/wiki/GUID_Partition_Table#Partition_type_GUIDs
- https://wiki.archlinux.org/title/Udev#Loading_new_rules
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:
- https://social.treehouse.systems/@AsahiLinux/110560192550506827
- https://wiki.archlinux.org/title/Udev#Loading_new_rules
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: