You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
444 B
Bash
16 lines
444 B
Bash
3 years ago
|
#!/usr/bin/env bash
|
||
|
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
|
||
|
|