From 00927cb5005be4ebd3e6fe00dfb611ea7717e691 Mon Sep 17 00:00:00 2001 From: Abhay Rana Date: Fri, 14 Aug 2015 01:40:50 +0530 Subject: [PATCH] Removing the unused caps lock bindings. - This was relevant in ubuntu, not in i3 --- caps_lock.cfg | 6 ------ caps_lock.sh | 32 -------------------------------- 2 files changed, 38 deletions(-) delete mode 100644 caps_lock.cfg delete mode 100755 caps_lock.sh diff --git a/caps_lock.cfg b/caps_lock.cfg deleted file mode 100644 index 9f56c87..0000000 --- a/caps_lock.cfg +++ /dev/null @@ -1,6 +0,0 @@ -# Assign program names to key bindings -# Should be understood by xdotool key command -chrome="ctrl+l" -linuxdcpp="ctrl+l" -sublime_text="ctrl+Tab" -sublime_text_double_tap="space" \ No newline at end of file diff --git a/caps_lock.sh b/caps_lock.sh deleted file mode 100755 index 9ce55fa..0000000 --- a/caps_lock.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/bash -# We use bash to get variable variables to work -# http://stackoverflow.com/questions/10757380/bash-variable-variables - -# This script is called whenever I press the caps-lock. -# The key-binding is managed by xbindkey - -# Constants -DELAY=200 -SLEEP_DELAY=0.2 # Delay in milliseconds -DOUBLE_TAP_SUFFIX="_double_tap" -EPOCH=`date +%s%3N` # This is in milliseconds -LOCK=/tmp/caps_lock_double_tap.lock -source /home/nemo/projects/scripts/caps_lock.cfg - -# Get the progam where caps lock was pressed -program=`ps -p $(xdotool getactivewindow getwindowpid) -o command= -c` -window=`xdotool getactivewindow` - -if [ -e $LOCK ]; then - LASTTIME=`cat $LOCK`; - if [ $EPOCH -le $(($LASTTIME + $DELAY)) ]; then - program="$program$DOUBLE_TAP_SUFFIX" - xdotool key --window "$window" ${!program} - else - # This is a single click - sleep $SLEEP_DELAY - - fi; -fi - -echo "$EPOCH" > $LOCK; \ No newline at end of file