[706705 views]

[]

[toggle ads]

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 CEST in Code | 0 comments | permalink