Commit Diff


commit - b142858f2f511943fb125778cc9326df857c5146
commit + 616e27e645cbfbede57c005b9aa84349ef66216e
blob - /dev/null
blob + 1d526d015d45ec5b5d555b91c4eac4c1c20ad09a (mode 644)
--- /dev/null
+++ bin/gamemode.lp
@@ -0,0 +1,21 @@
+# gamemode
+
+Switches the mice and keyboard back and forth from my custom setup to a
+'normal' one.
+
+	#!/bin/sh
+
+	set -e
+
+	btn1=$(xmodmap -pp | awk '/ 1 / {print $2}')
+	if [ "$btn1" = 3 ]; then	# switch to dx mouse + us
+		xmodmap -e 'pointer = 1 2 3'
+		setxkbmap us
+	else				# switch to sx mouse + dvp-eu
+		xmodmap -e 'pointer = 3 2 1'
+		grep ^setxkbmap ~/.xsession | sh
+	fi
+
+cwm sometime needs an "encouragement" when switching keyboard layout.
+
+	pkill -HUP cwm || true
blob - 1280356c0115047318e33b1b19ce974f48f00452
blob + acdf7c340716c6f36628cbce8245e685dbf30395
--- cwmrc.lp
+++ cwmrc.lp
@@ -91,6 +91,13 @@ control the playback
 	bind-key XF86AudioPlay "amused toggle"
 	bind-key XF86AudioStop "amused stop"
 
+"gamemode" swiches the keyboard from my custom dvp-eu to an us querty
+and vice-versa, and the mouse buttons too.  it's useful when playing
+some games, hence the name, or when in need to share the keyboard with
+someone else.
+
+	bind-key 4-F5 "gamemode"
+
 I don't have a dedicated key for screenshot on this machine, but
 Scroll_Lock is not too awkward to press
 
blob - 5620b6551f7a418383140445a32a176417a9705e
blob + 8535b7d8b845e1ae74f0018ebe87e2dac99becf7
--- gen
+++ gen
@@ -68,6 +68,7 @@ pair bin/acmerc		bin/acmerc.lp	+x
 pair bin/amused-monitor	bin/amused-monitor.lp +x
 pair bin/browser	bin/browser.lp	+x
 pair bin/clip		bin/clip.lp	+x
+pair bin/gamemode	bin/gamemode.lp	+x
 pair bin/sshot		bin/sshot.lp	+x
 pair bin/gmi2txt	bin/gmi2txt.lp	+x