mirror of
https://github.com/kristoferssolo/solorice.git
synced 2025-10-21 20:10:34 +00:00
16 lines
456 B
Bash
Executable File
16 lines
456 B
Bash
Executable File
#!/bin/sh
|
|
|
|
selected=$(cat ~/.config/tmux/tmux-cht-languages ~/.config/tmux/tmux-cht-command | fzf)
|
|
if [[ -z $selected ]]; then
|
|
exit 0
|
|
fi
|
|
|
|
read -p "Enter Query: " query
|
|
|
|
if rg -qs "$selected" ~/.config/tmux/tmux-cht-languages; then
|
|
query=$(echo $query | tr ' ' '+')
|
|
tmux neww zsh -c "echo \"curl cht.sh/$selected/$query/\" & curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done"
|
|
else
|
|
tmux neww zsh -c "curl -s cht.sh/$selected~$query | less"
|
|
fi
|