feat: add tmux-cht.sh script of ThePrimagen

This commit is contained in:
Stefan Imhoff
2022-09-24 11:07:57 +02:00
parent 74742bd5af
commit a054204488
3 changed files with 19 additions and 0 deletions

15
bin/tmux-cht.sh Executable file
View File

@@ -0,0 +1,15 @@
#!/usr/bin/env bash
# https://youtu.be/hJzqEAf2U4I
selected=`cat ~/.tmux-cht-languages ~/.tmux-cht-command | fzf`
if [[ -z $selected ]]; then
exit 0
fi
read -p "Enter Query: " query
if grep -qs "$selected" ~/.tmux-cht-languages; then
query=`echo $query | tr ' ' '+'`
tmux neww bash -c "echo \"curl cht.sh/$selected/$query/\" & curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done"
else
tmux neww bash -c "curl -s cht.sh/$selected~$query | less"
fi