#!/bin/sh selected=`cat ~/.tmux-langs ~/.tmux-coreutils | fzf` if [[ -z $selected ]]; then exit 0 fi read -p "Enter Query: " query if grep -qs "$selected" ~/.tmux-langs; then query=`echo $query | tr ' ' '+'` tmux neww bash -c "curl cht.sh/$selected/$query & while [ : ]; do sleep 1; done" else query=`echo $query | tr ' ' '+'` tmux neww bash -c "curl cht.sh/$selected~$query & while [ : ]; do sleep 1; done" fi