From 68a3a345e90f1ca9133480cd5d7cc6139b274062 Mon Sep 17 00:00:00 2001 From: Simon Rieger Date: Tue, 29 Apr 2025 20:02:47 +0200 Subject: [PATCH] fix apple keyboard --- executable_apple-keyboard-swap.sh | 15 +++++++++++++++ run_onchange_apple-keyboard-swap.sh.tmpl | 20 +++----------------- 2 files changed, 18 insertions(+), 17 deletions(-) create mode 100755 executable_apple-keyboard-swap.sh diff --git a/executable_apple-keyboard-swap.sh b/executable_apple-keyboard-swap.sh new file mode 100755 index 0000000..f921b92 --- /dev/null +++ b/executable_apple-keyboard-swap.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +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 +sudo dracut -f diff --git a/run_onchange_apple-keyboard-swap.sh.tmpl b/run_onchange_apple-keyboard-swap.sh.tmpl index b30b4b8..f64c940 100755 --- a/run_onchange_apple-keyboard-swap.sh.tmpl +++ b/run_onchange_apple-keyboard-swap.sh.tmpl @@ -1,17 +1,3 @@ -{{- if and (eq .chezmoi.os "linux") (eq .chezmoi.arch "arm64") }} -#!/bin/bash - -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 -sudo dracut -f -{{- end }} +{{ if eq .chezmoi.os "linux" -}} +{{ .chezmoi.sourceDir }}/executable_apple-keyboard-swap.sh +{{ end -}}