Last active
June 9, 2017 21:04
-
-
Save ddrscott/dcdaf1a3f04d2d299d972ee2199097d6 to your computer and use it in GitHub Desktop.
Random 10th `e` opens unicorns in browser in the background
This file contains hidden or 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
#!/bin/zsh | |
heart(){ | |
zle self-insert | |
if [ $((RANDOM % 10)) -eq 0 ]; then | |
(head -$((${RANDOM} % $(wc -l < /usr/share/dict/words) + 1)) /usr/share/dict/words | tail -1 | sed -E -e "s~(.*)~https://google.com/search?tbm=isch\&q=\1~" | xargs open -g &) | |
fi | |
} | |
zle -N heart | |
bindkey 'e' heart |
Author
ddrscott
commented
May 18, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment