[1815644 views]

[]

Odi's astoundingly incomplete notes

New entries | Code

ratelimiting eject

Mapped the eject key of my old iMac to the following script to rate limit it:
#!/bin/sh
L="/tmp/eject.lock"
[ -e $L ] || touch $L
exec 3<$L
flock -n 3 || exit
eject "$@"
sleep 5
Because I found it really annoying when the kids fill the keyboard buffer with eject events that take forever to be processed.
posted on 2017-07-24 22:02 UTC in Code | 0 comments | permalink