Last active
August 29, 2015 14:04
-
-
Save jonEbird/f44e8d68af6b86e63407 to your computer and use it in GitHub Desktop.
Run screenkey for only a brief period. Intention to bind to key and use during screencasts.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defvar screenkey-timeout 4 | |
"Number of seconds to allow screenkey to run normally") | |
(defun screenkey-timed (&optional timeout) | |
"Run an external command and then asynchronously kill it after timeout" | |
(interactive) | |
(start-process "screenkey" "*screenkey*" "screenkey" "--no-detach") | |
(run-at-time (format "%d sec" (or timeout screenkey-timeout)) nil | |
'(lambda () (delete-process "*screenkey*")))) | |
(global-set-key (kbd "C-M-k") 'screenkey-timed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment