Manage Dell laptop keymap

This commit is contained in:
gardouille 2021-02-01 15:16:35 +01:00
parent 69ca9e2528
commit 17542f36d4
Signed by: gardouille
GPG Key ID: E759BAA22501AF32

View File

@ -1,9 +1,7 @@
#!/bin/sh #!/bin/sh
# Manage keyboard disposition if TypeMatrix keyboard is available. # Manage keyboard disposition for TypeMatrix if keyboard is available.
TM_ID="1e54:2030" TM_ID="1e54:2030"
TM_AVAILABLE=$(lsusb | grep -i -- "$TM_ID") TM_AVAILABLE=$(lsusb | grep -i -- "$TM_ID")
if [ "${TM_AVAILABLE}" ]; then if [ "${TM_AVAILABLE}" ]; then
@ -11,6 +9,24 @@ if [ "${TM_AVAILABLE}" ]; then
&& exit 0 && exit 0
fi fi
setxkbmap -model latitude -layout fr -variant bepo # Manage keyboard disposition for Dell if it's a Dell
IS_DELL=$(lsusb | grep -i -- "dell")
IS_LAPTOP=$(grep -qE "^10" /sys/devices/virtual/dmi/id/chassis_type)
if [ "${IS_DELL}" ]; then
# Manage keyboard disposition for Dell laptop if it's a laptop
if [ "${IS_LAPTOP}" ]; then
setxkbmap -model latitude -layout fr -variant bepo \
&& exit 0
else
# Default Dell map to pc104 and bepo
setxkbmap -model pc104 -layout fr -variant bepo \
&& exit 0
fi
else
# Default map to pc104 and bepo
setxkbmap -model pc104 -layout fr -variant bepo \
&& exit 0
fi
exit 0
exit 255