dotwryn/bash/osx/osxfun
2019-09-13 16:45:50 -06:00

60 lines
1.4 KiB
Bash

#!/bin/bash
function voicesed() { sed 's/\([^ ]*\) .*/\1/;'; }
function voicelist() { say -v ? | voicesed; }
function voicelistenglish() { say -v ? | grep 'en_' | voicesed; }
function voicerandom() { voicelistenglish | shuf -n 1; }
function voicelistnormal() {
voicelistenglish |
sed '/Trinoids/d;/Zarvox/d;/Deranged/d;/Hysterical/d;/Bahh/d;/Bubbles/d'
}
function voicerandomnormal() { voicelistnormal | shuf -n 1; }
function sayvoices() {
for voice in $(voicelist); do
say -v "$voice" $(say -v ? | grep $voice | sed 's/[^#]*# //');
done
}
function sayone() {
local voice=$(voicerandom);
say -v "$voice" $(say -v ? | grep $voice | sed 's/[^#]*# //');
}
function meme {
local DIRECTORY="$HOME/Pictures/jest";
[ ! -d $DIRECTORY ] && echo "No meme directory found :c";
echo;
imgcat $DIRECTORY/$1
echo;
}
_meme () { # autocompletion
# Set
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -W "$(ls $HOME/Pictures/jest)" -- $cur) )
}
complete -F _meme meme;
function pika {
local DIRECTORY="$HOME/Pictures/pika";
[ ! -d $DIRECTORY ] && echo "Pikachu directory required." && exit 1;
# count the pikas
IMAGE_COUNT=$(ls -l $DIRECTORY | wc -l);
let "IMAGE_COUNT=IMAGE_COUNT-1";
# pick a random gif from the pikachu directory
IMAGE="$DIRECTORY/$((RANDOM % $IMAGE_COUNT)).gif";
echo;
imgcat $IMAGE
echo;
}
alias pikabox='while true; do reset; pika; sleep 120; done'