mirror of
https://github.com/captn3m0/Scripts.git
synced 2024-09-27 22:22:53 +00:00
Removing the unused caps lock bindings.
- This was relevant in ubuntu, not in i3
This commit is contained in:
parent
6380d152f0
commit
00927cb500
@ -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"
|
|
32
caps_lock.sh
32
caps_lock.sh
@ -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;
|
|
Loading…
Reference in New Issue
Block a user