-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy patheos-kbd-set
More file actions
executable file
·34 lines (31 loc) · 1014 Bytes
/
eos-kbd-set
File metadata and controls
executable file
·34 lines (31 loc) · 1014 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/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 "$@"