aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRyan Kavanagh <rak@debian.org>2013-06-27 14:47:32 -0400
committerRyan Kavanagh <rak@debian.org>2013-06-27 14:47:32 -0400
commit23395c0d0f014d0ef32bcbc150ec87638951f31d (patch)
tree4818a0a19ad60eab0db2291a9ad856d90acd3aa7 /bin
parentAdd a Three Column (Middle) mode to the Web desktop in xmonad (diff)
Updated ICD layout switcher
Diffstat (limited to 'bin')
-rwxr-xr-xbin/icd38
1 files changed, 37 insertions, 1 deletions
diff --git a/bin/icd b/bin/icd
index d1b90da..21ff806 100755
--- a/bin/icd
+++ b/bin/icd
@@ -1,3 +1,39 @@
#!/bin/sh
-xkbcomp -I/home/ryan/.xkb /home/ryan/.xkb/keymap/icd $DISPLAY
+
+OPTIONS="-option lv3:ralt_switch_multikey \
+ -option terminate:ctrl_alt_bksp \
+ -option ctrl:swapcaps \
+ -option nbsp:level3n \
+ -I${HOME}/.xkb \
+ -layout icd \
+ -variant icd"
+
+SUN_USB_ID=$(lsusb | grep Sun | awk '{ print $6 }')
+SUN_XINPUT_ID=$(xinput | grep ${SUN_USB_ID} | sed -e 's/.*id=\([0-9]\+\).*/\1/g')
+
+setxkbmap ${OPTIONS} -print > ${HOME}/.xkb/keymap/icd
+xkbcomp -I/home/ryan/.xkb /home/ryan/.xkb/keymap/icd $DISPLAY 2> /dev/null
+
+if [ "x${SUN_XINPUT_ID}" != "x" ]; then
+ setxkbmap \
+ -I${HOME}/.xkb \
+ -keycodes "rak" \
+ -device ${SUN_XINPUT_ID} \
+ -geometry "sun(type6)" \
+ -option "myswap(switch_lalt_lsuper)" \
+ ${OPTIONS} \
+ -print > ${HOME}/.xkb/keymap/icd.sun
+# awk '{ \
+# if (/symbols/) { \
+# sub(/\)\"/, ")+myswap(switch_lalt_lsuper)\""); print \
+# } else { \
+# print \
+# } \
+# }' ${HOME}/.xkb/keymap/icd.sun2 > ${HOME}/.xkb/keymap/icd.sun
+ xkbcomp -i ${SUN_USB_ID} -I${HOME}/.xkb \
+ ${HOME}/.xkb/keymap/icd.sun ${DISPLAY} # 2> /dev/null
+ #xkbcomp -i ${SUN_USB_ID} -I${HOME}/.xkb \
+ # ${HOME}/.xkb/symbols/myswap ${DISPLAY} # 2> /dev/null
+fi
+
echo icd > /home/ryan/.xmonad/layout