diff --git a/usr/bin/jgespanso-pipe b/usr/bin/jgespanso-pipe index 851a9a1..45d808c 100755 --- a/usr/bin/jgespanso-pipe +++ b/usr/bin/jgespanso-pipe @@ -32,7 +32,7 @@ esac MENU_ITEMS=/tmp/espanso_list.csv trap "rm -f $MENU_ITEMS" EXIT -if [[ $(espanso status) =~ "not" ]] +if ! pgrep -x "espanso" > /dev/null then echo "^sep(Espanso - text expander)" >/tmp/espanso_list.csv echo "Espanso not running! Run it first by: espanso start,^term(espanso start)" >>/tmp/espanso_list.csv @@ -47,7 +47,10 @@ echo "^sep($LIST)" >>/tmp/espanso_list.csv while read -r line ; do IFS='-' read -r id string <<< "$line" - printf "\"\"\"%-12s %s\"\"\",xdotool type %s\n" $id "${string//> $MENU_ITEMS + #printf "\"\"\"%-12s %s\"\"\",xdotool type %s\n" $id "${string//> $MENU_ITEMS + string="${string//%-12s %s\"\"\",xdotool type %s\n" $id "${string}" $id >> $MENU_ITEMS done < <(espanso match list)