summaryrefslogtreecommitdiffstats
path: root/keyboards/ergodox/keymaps/algernon/tools/hid-commands
diff options
context:
space:
mode:
authorErez Zukerman <ezuk@madmimi.com>2016-09-22 22:05:18 -0400
committerErez Zukerman <ezuk@madmimi.com>2016-09-22 22:05:18 -0400
commitce6a9a6c38a3efb2b3d403d5b3549b2190102cf3 (patch)
tree2bc92249d2b0937b6bc03462ac23cf555c523c36 /keyboards/ergodox/keymaps/algernon/tools/hid-commands
parent6e5142ca3ee7c45a0776d84ba667c5504dc85cd8 (diff)
parent545f0ca00e817d86486abfd8f5a1ba915ca56309 (diff)
Merge branch 'master' of github.com:jackhumbert/qmk_firmware
Diffstat (limited to 'keyboards/ergodox/keymaps/algernon/tools/hid-commands')
-rwxr-xr-xkeyboards/ergodox/keymaps/algernon/tools/hid-commands61
1 files changed, 61 insertions, 0 deletions
diff --git a/keyboards/ergodox/keymaps/algernon/tools/hid-commands b/keyboards/ergodox/keymaps/algernon/tools/hid-commands
new file mode 100755
index 0000000000..f3b83cf6d1
--- /dev/null
+++ b/keyboards/ergodox/keymaps/algernon/tools/hid-commands
@@ -0,0 +1,61 @@
+#!/bin/bash
+set -e
+
+cmd_wm () {
+ WIN="$(xdotool getactivewindow)"
+ wmctrl -i -r ${WIN} -b remove,maximized_vert,maximized_horz
+ xdotool windowsize ${WIN} 100% 100%
+ wmctrl -i -r ${WIN} -b add,maximized_vert,maximized_horz
+}
+
+_cmd_appsel () {
+ wmctrl -x -a $1 || true
+ xdotool key Escape
+}
+
+cmd_appsel_music () {
+ wmctrl -x -a rhythmbox || wmctrl -x -a spotify || true
+ xdotool key Escape
+}
+
+cmd_appsel_slack () {
+ _cmd_appsel slack
+}
+
+cmd_appsel_emacs () {
+ _cmd_appsel emacs24
+}
+
+cmd_appsel_term () {
+ _cmd_appsel gnome-terminal
+}
+
+cmd_appsel_chrome () {
+ _cmd_appsel chromium
+}
+
+cmd_help () {
+ cat <<EOF
+Use the source, Luke!
+EOF
+}
+
+while read l; do
+ case "$l" in
+ "CMD:"*)
+ ;;
+ *)
+ continue
+ ;;
+ esac
+
+ cmd="$(echo $l | cut -d: -f2-)"
+
+ echo "Got command: ${cmd}"
+
+ if type cmd_${cmd} >/dev/null 2>&1; then
+ cmd_${cmd}
+ fi
+done
+
+