dotfiles/run_onchange_apple-keyboard-swap.sh.tmpl
2025-04-12 16:29:26 +02:00

21 lines
802 B
Bash
Executable file

#!/bin/bash
# Config hash: {{ "options hid-apple swap_fn_leftctrl=1" | sha256sum }}
# Überprüfen, ob das System Linux mit aarch64 ist
if [[ "$(uname -s)" != "Linux" || "$(uname -m)" != "aarch64" ]]; then
echo "Dieses Skript ist nur auf Linux mit der Architektur aarch64 ausführbar."
exit 0
fi
echo "Ändere Apple Funktionstaste mit der Kontrolltaste!!!"
echo "Ändere Apple Commandtaste mit der Altasten!!!"
# Temporäre Änderung
# Command (⌘) und Alt (⌥) tauschen
echo 1 | sudo tee /sys/module/hid_apple/parameters/swap_opt_cmd
# Fn und linke Control-Taste tauschen
echo 1 | sudo tee /sys/module/hid_apple/parameters/swap_fn_leftctrl
# Dauerhafte Konfiguration
echo -e "options hid_apple swap_opt_cmd=1\noptions hid_apple swap_fn_leftctrl=1" | sudo tee /etc/modprobe.d/hid_apple.conf