mirror of
https://github.com/endeavouros-team/eos-bash-shared.git
synced 2026-06-13 01:34:36 +00:00
35 lines
1014 B
Bash
Executable File
35 lines
1014 B
Bash
Executable File
#!/bin/bash
|
|
|
|
Main() {
|
|
echo "Session type: $XDG_SESSION_TYPE" >&2
|
|
local country=$(show-location-info --tolower country)
|
|
echo "Detected country: $country" >&2
|
|
|
|
case "$XDG_SESSION_TYPE" in
|
|
x11)
|
|
case "$country" in
|
|
us | gb | fr | it | es | de | fi | jp | cn | se)
|
|
echo "Setting keymap: $country" >&2
|
|
;;
|
|
*)
|
|
local c="$country"
|
|
country=us
|
|
echo "Country '$c' not handled, falling back to '$country'" >&2
|
|
;;
|
|
esac
|
|
setxkbmap "$country"
|
|
;;
|
|
wayland)
|
|
case "$country" in
|
|
us) echo "Setting keymap: $country" >&2 ;;
|
|
*) case "$XDG_CURRENT_DESKTOP" in
|
|
KDE) ;; # systemsettings kcm_keyboard 2>/dev/null ;; # need a better way...
|
|
esac
|
|
;;
|
|
esac
|
|
;;
|
|
esac
|
|
}
|
|
|
|
Main "$@"
|