|
| 1 | +<!-- omit in toc --> |
| 2 | +# Fedora Asahi Remix on M1 Apple Silicon Mac |
| 3 | + |
| 4 | +<!-- TOC --> |
| 5 | + |
| 6 | +- [KEYBASE](#keybase) |
| 7 | + - [build from source](#build-from-source) |
| 8 | + - [alternatively download the binaries](#alternatively-download-the-binaries) |
| 9 | + - [initialize and set kbfs dir](#initialize-and-set-kbfs-dir) |
| 10 | + - [compile gui](#compile-gui) |
| 11 | + - [start the gui](#start-the-gui) |
| 12 | + - [create launcher icon](#create-launcher-icon) |
| 13 | +- [SIGNAL](#signal) |
| 14 | +- [SIMPLEX\_CHAT](#simplex_chat) |
| 15 | + - [download AppImage](#download-appimage) |
| 16 | + - [launcher icon](#launcher-icon) |
| 17 | +- [FIX MEDIA PLAYER](#fix-media-player) |
| 18 | + - [add rpmfusion repo](#add-rpmfusion-repo) |
| 19 | + - [install codecs](#install-codecs) |
| 20 | + - [vlc](#vlc) |
| 21 | +- [Swap the Fn and Control keys](#swap-the-fn-and-control-keys) |
| 22 | + - [Temporary Solution](#temporary-solution) |
| 23 | + - [Permanent Solution](#permanent-solution) |
| 24 | + - [Verification](#verification) |
| 25 | + - [Alternative Method](#alternative-method) |
| 26 | + |
| 27 | +<!-- /TOC --> |
| 28 | + |
| 29 | +## KEYBASE |
| 30 | + |
| 31 | +### build from source |
| 32 | + |
| 33 | +``` |
| 34 | +sudo dnf install golang yarnpkg fusermount |
| 35 | +
|
| 36 | +git clone https://github.com/keybase/client |
| 37 | +cd client |
| 38 | +
|
| 39 | +KEYBASE_BUILD_ARM_ONLY=1 ./packaging/linux/build_binaries.sh prerelease |
| 40 | +sudo find / -name keybase-redirector |
| 41 | +sudo ls -la /tmp/keybase_build_2024_12_26_115006/binaries/arm64/usr/bin/ |
| 42 | +sudo cp /tmp/keybase_build_2024_12_26_115006/binaries/arm64/usr/bin/* /usr/bin/ |
| 43 | +``` |
| 44 | + |
| 45 | +### alternatively download the binaries |
| 46 | + |
| 47 | +- <https://opensuse.pkgs.org/tumbleweed/opensuse-oss-aarch64/kbfs-6.3.1-2.3.aarch64.html.rpm> |
| 48 | +- <https://opensuse.pkgs.org/tumbleweed/opensuse-oss-aarch64/keybase-client-6.3.1-2.3.aarch64.rpm.html> |
| 49 | + |
| 50 | +``` |
| 51 | +wget https://ftp.lysator.liu.se/pub/opensuse/ports/aarch64/tumbleweed/repo/oss/aarch64/keybase-client-6.3.1-2.3.aarch64.rpm |
| 52 | +wget https://ftp.lysator.liu.se/pub/opensuse/ports/aarch64/tumbleweed/repo/oss/aarch64/kbfs-6.3.1-2.3.aarch64.rpm |
| 53 | +``` |
| 54 | + |
| 55 | +### initialize and set kbfs dir |
| 56 | + |
| 57 | +``` |
| 58 | +keybase config set mountdir ~/kbfs |
| 59 | +run_keybase |
| 60 | +``` |
| 61 | + |
| 62 | +### compile gui |
| 63 | + |
| 64 | +``` |
| 65 | +cd shared |
| 66 | +yarn install |
| 67 | +yarn run package -- --arch arm64 |
| 68 | +``` |
| 69 | + |
| 70 | +### start the gui |
| 71 | + |
| 72 | +``` |
| 73 | +/run/media/s/dev_storage/client/shared/desktop/release/linux-arm64/Keybase-linux-arm64/Keybase |
| 74 | +``` |
| 75 | + |
| 76 | +### create launcher icon |
| 77 | + |
| 78 | +To create a desktop icon for the Keybase application on Fedora GNOME, follow these steps: |
| 79 | + |
| 80 | +1. Create a new .desktop file: |
| 81 | + |
| 82 | +Open a text editor and create a new file named `keybase.desktop` in the following directory: |
| 83 | + |
| 84 | +```bash |
| 85 | +~/.local/share/applications/ |
| 86 | +``` |
| 87 | + |
| 88 | +2. Add the following content to the `keybase.desktop` file: |
| 89 | + |
| 90 | +``` |
| 91 | +[Desktop Entry] |
| 92 | +Name=Keybase |
| 93 | +Comment=Keybase Application |
| 94 | +Exec=/run/media/s/dev_storage/client/shared/desktop/release/linux-arm64/Keybase-linux-arm64/Keybase |
| 95 | +Icon=/run/media/s/dev_storage/client/browser/images/icon-keybase-logo-128.png |
| 96 | +Type=Application |
| 97 | +Categories=Utility; |
| 98 | +``` |
| 99 | + |
| 100 | +Make sure to replace the `Icon` path with the actual path to the Keybase icon file if it's different from what's shown above. |
| 101 | + |
| 102 | +3. Save the file and make it executable: |
| 103 | + |
| 104 | +```bash |
| 105 | +chmod +x ~/.local/share/applications/keybase.desktop |
| 106 | +``` |
| 107 | + |
| 108 | +## SIGNAL |
| 109 | + |
| 110 | +<https://copr.fedorainfracloud.org/coprs/useidel/signal-desktop/> |
| 111 | + |
| 112 | +``` |
| 113 | +sudo dnf copr enable useidel/signal-desktop |
| 114 | +sudo dnf install signal-desktop |
| 115 | +``` |
| 116 | + |
| 117 | +## SIMPLEX_CHAT |
| 118 | + |
| 119 | +### download AppImage |
| 120 | + |
| 121 | +``` |
| 122 | +muvm -- $PWD/simplex-desktop-x86_64.AppImage --appimage-extract |
| 123 | +muvm -- simplex-chat/AppRun |
| 124 | +``` |
| 125 | + |
| 126 | +### launcher icon |
| 127 | + |
| 128 | +``` |
| 129 | +echo "[Desktop Entry] |
| 130 | +Name=simplex-chat-x86_64 |
| 131 | +Comment=simplex-chat-x86_64 Application |
| 132 | +Exec=muvm -- simplex-chat/AppRun |
| 133 | +Icon=/home/s/Pictures/icons/simplex.svg |
| 134 | +Type=Application |
| 135 | +Categories=Utility;" | tee ~/.local/share/applications/simplex-chat-x86_64.desktop |
| 136 | +``` |
| 137 | + |
| 138 | +## FIX MEDIA PLAYER |
| 139 | + |
| 140 | +### add rpmfusion repo |
| 141 | + |
| 142 | +- <https://rpmfusion.org/Configuration> |
| 143 | + |
| 144 | +``` |
| 145 | +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 |
| 146 | +``` |
| 147 | + |
| 148 | +### install codecs |
| 149 | + |
| 150 | +``` |
| 151 | +sudo dnf config-manager setopt fedora-cisco-openh264.enabled=1 |
| 152 | +sudo dnf swap ffmpeg-free ffmpeg --allowerasing |
| 153 | +``` |
| 154 | + |
| 155 | +### vlc |
| 156 | + |
| 157 | +``` |
| 158 | +sudo dnf install vlc |
| 159 | +``` |
| 160 | + |
| 161 | +## Swap the Fn and Control keys |
| 162 | + |
| 163 | +To swap the Fn and Control keys on an M1 Mac running Asahi Linux Fedora, you can use the `hid_apple` kernel module option. Here's how to do it: |
| 164 | + |
| 165 | +### Temporary Solution |
| 166 | + |
| 167 | +For an immediate, temporary change, you can use the following command: |
| 168 | + |
| 169 | +```bash |
| 170 | +echo 1 | sudo tee /sys/module/hid_apple/parameters/swap_fn_leftctrl |
| 171 | +``` |
| 172 | + |
| 173 | +This will swap the Fn and left Control keys, but the change won't persist after a reboot[6]. |
| 174 | + |
| 175 | +### Permanent Solution |
| 176 | + |
| 177 | +To make the change permanent, follow these steps: |
| 178 | + |
| 179 | +1. Create or edit the `hid_apple.conf` file: |
| 180 | + |
| 181 | +```bash |
| 182 | +sudo nano /etc/modprobe.d/hid_apple.conf |
| 183 | +``` |
| 184 | + |
| 185 | +2. Add the following line to the file: |
| 186 | + |
| 187 | +``` |
| 188 | +options hid_apple swap_fn_leftctrl=1 |
| 189 | +``` |
| 190 | + |
| 191 | +3. Save and exit the text editor[7][8]. |
| 192 | + |
| 193 | +4. Regenerate the initramfs to apply the changes: |
| 194 | + |
| 195 | +```bash |
| 196 | +sudo dracut --regenerate-all --force |
| 197 | +``` |
| 198 | + |
| 199 | +5. Reboot your system for the changes to take effect[8]. |
| 200 | + |
| 201 | +### Verification |
| 202 | + |
| 203 | +To verify that the module option has been correctly inserted into the initramfs, you can run: |
| 204 | + |
| 205 | +```bash |
| 206 | +lsinitrd /boot/initramfs-$(uname -r).img | grep modprobe.d/hid_apple.conf |
| 207 | +``` |
| 208 | + |
| 209 | +You should see the `hid_apple.conf` file in the output[6]. |
| 210 | + |
| 211 | +### Alternative Method |
| 212 | + |
| 213 | +Another way to apply this change is by using the `grubby` command: |
| 214 | + |
| 215 | +```bash |
| 216 | +sudo grubby --update-kernel=ALL --args="hid_apple.swap_fn_leftctrl=1" |
| 217 | +``` |
| 218 | + |
| 219 | +This method updates the kernel parameters directly[6]. |
| 220 | + |
| 221 | +Remember that these changes will swap the Fn key with the left Control key. If you need to swap it with the right Control key specifically, you might need to explore additional keyboard remapping tools or custom configurations, as the `hid_apple` module doesn't provide a direct option for that[4]. |
| 222 | + |
| 223 | +Citations: |
| 224 | + |
| 225 | +- [1] <https://www.reddit.com/r/AsahiLinux/comments/wg9v0a/swap_fn_and_ctrl_key_on_a_macbook_air_m1/> |
| 226 | +- [2] <https://discussion.fedoraproject.org/t/how-to-swap-option-and-command-in-italian-layout/87034> |
| 227 | +- [3] <https://github.com/AsahiLinux/docs/issues/29> |
| 228 | +- [4] <https://discussion.fedoraproject.org/t/way-to-switch-fn-and-right-control-key/107703> |
| 229 | +- [5] <https://superuser.com/questions/1863262/how-do-you-remap-keyboard-keys-in-linux> |
| 230 | +- [6] <https://www.reddit.com/r/AsahiLinux/comments/18nnc5n/persistent_remap_of_ctrl_and_fn_on_fedora_asahi/> |
| 231 | +- [7] <https://wiki.archlinux.org/title/Apple_Keyboard> |
| 232 | +- [8] <https://discussion.fedoraproject.org/t/way-to-switch-fn-and-right-control-key/107703/6> |
| 233 | +- [9] <https://askubuntu.com/questions/131900/how-do-i-switch-the-command-key-and-control-key-on-a-macbook-pro> |
| 234 | +- [10] <https://superuser.com/questions/79822/how-to-swap-the-fn-use-of-function-keys-on-an-apple-keyboard-in-linux> |
0 commit comments