Skip to content

Instantly share code, notes, and snippets.

@b23prodtm
Created April 13, 2025 07:53
Show Gist options
  • Save b23prodtm/b0621109291860dbf9e5f5ee64cc7bc2 to your computer and use it in GitHub Desktop.
Save b23prodtm/b0621109291860dbf9e5f5ee64cc7bc2 to your computer and use it in GitHub Desktop.
Install permanent keyboard layout for Mac both in OpenSuse TW and Leap 15.2
#!/usr/bin/env bash
if [ $(id -u) -ne 0 ]
then echo Please run this script as root or using sudo!
exit
fi
locale="fr"
printf "Installing Mac *${locale}* Keyboard Layout in Terminal and X11...\n"
sleep 2
localectl set-x11-keymap --no-convert "$locale" apple mac
localectl set-keymap "$locale"-mac
dracut -f
printf "/etc/vconsole.conf\n"
cat /etc/vconsole.conf
sleep 1
printf "/etc/X11/xorg.conf.d/00-keyboard.conf\n"
cat /etc/X11/xorg.conf.d/00-keyboard.conf
printf "If your keyboard has a different mapping than $locale,
you can choose something else with the help of localectl(1).
For the console and the display manager:
localectl list-x11-keymap-layouts
*list of locales*]
sudo localectl set-x11-keymap --no-convert <locale> apple mac
\n"
printf "For X:
localectl list-x11-keymap-layouts
*list of locales*]
sudo localectl set-x11-keymap --no-convert <locale> apple mac
\n"
@b23prodtm
Copy link
Author

Please reboot the computer after running this script, unless you get the keyboard installed and ready.

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