From fb399bc07d582b0deb8921b50850e3a79e7b07b7 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Sat, 3 Apr 2021 10:45:13 +0200 Subject: [PATCH] Add setkeys script --- script/setkeys | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100755 script/setkeys diff --git a/script/setkeys b/script/setkeys new file mode 100755 index 0000000..4a1270b --- /dev/null +++ b/script/setkeys @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# +# set keymap, e.g. `setkeys us` +# +# Note: show current status with `setkeys -l` + +set -e + +case "$1" in + "-l") + setxkbmap -print -verbose 10 + exit 0 + ;; + + "es") + setxkbmap -model pc104alt -layout es,us -variant nodeadkeys,mac -option compose:rctrl + ;; + + "us") + setxkbmap -model pc105 -layout us,es -variant mac, -option compose:rctrl + exit 0 + ;; + + "") + echo "argument required" + exit 1 + ;; + + *) + echo "unknown keymap: $1" + exit 2 + ;; +esac