scripts/keyboard.sh

33 lines
819 B
Bash
Raw Permalink Normal View History

#!/bin/sh
2021-02-01 15:16:35 +01:00
# Manage keyboard disposition for TypeMatrix if keyboard is available.
TM_ID="1e54:2030"
TM_AVAILABLE=$(lsusb | grep -i -- "$TM_ID")
if [ "${TM_AVAILABLE}" ]; then
2021-02-01 14:40:50 +01:00
setxkbmap -model tm2030USB -layout fr -variant bepo \
&& exit 0
fi
2021-02-01 15:16:35 +01:00
# 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
2021-02-01 14:40:50 +01:00
2021-02-01 15:16:35 +01:00
exit 255