scripts/cheatsheet.sh

15 lines
412 B
Bash
Raw Normal View History

2024-07-11 20:09:02 +05:30
#!/usr/bin/env bash
selected=`cat ~/.tmux-cht-languages ~/.tmux-cht-command | fzf-tmux --reverse -p -h 60% -w 50%`
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 "curl -s cht.sh/$selected/$query | less"
else
tmux neww bash -c "curl -s cht.sh/$selected~$query | less"
fi