From c084ab11f5f649dd8f564152e336e2aae9cd09a4 Mon Sep 17 00:00:00 2001 From: Ryan Kavanagh Date: Fri, 17 Dec 2021 09:48:56 -0500 Subject: make icd portable --- bin/executable_icd | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/executable_icd b/bin/executable_icd index e419b7f..367b87f 100755 --- a/bin/executable_icd +++ b/bin/executable_icd @@ -33,10 +33,20 @@ ERG_OPTIONS="\ -option lv3:switch \ -option caps:escape" -LAPTOP_ID=$(xinput | grep "AT Translated Set 2 keyboard" | sed -e 's/.*id=\([0-9]\+\).*/\1/g') -KIN_USB_ID=$(lsusb | grep -i "Kinesis Advantage Pro" | awk '{ print $6 }') -ERG_USB_ID=$(lsusb | grep -i "feed:1307" | awk '{ print $6 }') -SUN_USB_ID=$(lsusb | grep -i "Sun Microsystems, Inc. Type 6 Keyboard" | awk '{ print $6 }') + +case `uname` in + OpenBSD) + LAPTOP_ID=$(xinput | grep "/dev/wskbd" | sed -e 's/.*id=\([0-9]\+\).*/\1/g') + ;; + Linux) + LAPTOP_ID=$(xinput | grep "AT Translated Set 2 keyboard" | sed -e 's/.*id=\([0-9]\+\).*/\1/g') + KIN_USB_ID=$(lsusb | grep -i "Kinesis Advantage Pro" | awk '{ print $6 }') + ERG_USB_ID=$(lsusb | grep -i "feed:1307" | awk '{ print $6 }') + SUN_USB_ID=$(lsusb | grep -i "Sun Microsystems, Inc. Type 6 Keyboard" | awk '{ print $6 }') + ;; + *) + ;; +esac echo "Setting up laptop" setxkbmap ${LAPTOP_OPTIONS} -device ${LAPTOP_ID} -print > ${XKB_DIR}/keymap/icd.laptop -- cgit v1.2.3