2020-09-24 18:42:59 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
case $LANG in
|
|
|
|
pl*)
|
2020-09-26 14:54:15 +02:00
|
|
|
TYPE_TO_SEARCH="pisz, aby wyszukać"
|
2020-09-24 18:42:59 +02:00
|
|
|
CONFIGURE="Konfiguracja Espanso"
|
|
|
|
EDITCONF="Edytuj domyślny plik konfiguracyjny"
|
|
|
|
OPENCONFDIR="Otwórz katalog z konfiguracją"
|
|
|
|
DOCU="Dokumentacja <b>Espanso</b> (online)"
|
|
|
|
;;
|
|
|
|
es*)
|
2020-09-26 14:54:15 +02:00
|
|
|
TYPE_TO_SEARCH="Buscar"
|
2020-09-24 18:42:59 +02:00
|
|
|
CONFIGURE="Configurar Espanso"
|
|
|
|
EDITCONF="Editar archivo x defecto"
|
|
|
|
OPENCONFDIR="Abrir el directorio"
|
|
|
|
DOCU="Leer <b>Documentacion</b> de Espanso (en línea)"
|
|
|
|
;;
|
|
|
|
*)
|
2020-09-26 14:54:15 +02:00
|
|
|
TYPE_TO_SEARCH="Type to filter"
|
2020-09-24 18:42:59 +02:00
|
|
|
CONFIGURE="Configure Espanso"
|
|
|
|
EDITCONF="Edit default config file"
|
|
|
|
OPENCONFDIR="Open config directory"
|
|
|
|
DOCU="Read <b>Espanso</b> documentation (online)"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MENU_ITEMS=/tmp/espanso_list.csv
|
|
|
|
trap "rm -f $MENU_ITEMS" EXIT
|
2020-09-25 16:06:39 +02:00
|
|
|
|
|
|
|
if [[ $(espanso status) =~ "not" ]]
|
|
|
|
then
|
2020-09-26 14:54:15 +02:00
|
|
|
echo "^sep(Espanso - text expander)" >/tmp/espanso_list.csv
|
2020-09-25 16:06:39 +02:00
|
|
|
echo "Espanso not running! Run it first by: espanso start" >>/tmp/espanso_list.csv
|
|
|
|
|
|
|
|
else
|
2020-09-26 14:54:15 +02:00
|
|
|
echo "@search,,10,5,292,20,4,left,top,auto,#262626,\"\"\"<big></big> <i>$TYPE_TO_SEARCH</i>\"\"\"" >/tmp/espanso_list.csv
|
|
|
|
echo "^sep(Espanso - text expander)" >>/tmp/espanso_list.csv
|
2020-09-24 18:42:59 +02:00
|
|
|
while read -r line ; do
|
|
|
|
|
|
|
|
IFS='-' read -r id string <<< "$line"
|
2020-09-25 10:42:23 +02:00
|
|
|
printf "\"\"\"<b><tt>%-12s</tt></b> <i>%s</i>\"\"\",espanso match exec %s\n" $id "$string" $id >> $MENU_ITEMS
|
2020-09-24 18:42:59 +02:00
|
|
|
done < <(espanso match list)
|
|
|
|
echo "^sep($CONFIGURE)" >>/tmp/espanso_list.csv
|
|
|
|
echo "$EDITCONF, geany ~/.config/espanso/default.yml" >>/tmp/espanso_list.csv
|
|
|
|
echo "$OPENCONFDIR,pcmanfm ~/.config/espanso/user/" >>/tmp/espanso_list.csv
|
|
|
|
echo "$DOCU,exo-open --launch WebBrowser https://espanso.org/docs/" >>/tmp/espanso_list.csv
|
|
|
|
|
2020-09-25 16:06:39 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2020-09-24 18:42:59 +02:00
|
|
|
### RUN
|
|
|
|
if [ $1 == "-s" ]; then
|
|
|
|
. /usr/bin/pipemenu-standalone.cfg
|
|
|
|
|
2020-09-26 14:54:15 +02:00
|
|
|
MENU_PADDING_TOP=24
|
2020-09-24 18:42:59 +02:00
|
|
|
MENU_HALIGN="center"
|
2020-09-25 10:42:23 +02:00
|
|
|
MENU_VALIGN="top"
|
2020-09-25 16:06:39 +02:00
|
|
|
MENU_MARGIN_Y=40
|
2020-09-24 18:42:59 +02:00
|
|
|
jgmenu_icon_size=0
|
|
|
|
JGWIDTH=500
|
|
|
|
#MENU_HEIGHT_MAX=600
|
|
|
|
mkconfigfile
|
|
|
|
|
|
|
|
|
|
|
|
jgmenu --config-file=${CONFIG_FILE} --csv-file=/tmp/espanso_list.csv 2>/dev/null
|
|
|
|
rm -f /tmp/espanso_list.csv
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
#cat ${CONFIG_FILE}
|
|
|
|
#cat ${MENU_ITEMS}
|
|
|
|
|
|
|
|
if [ $1 == "-r" ]; then
|
|
|
|
echo "<i>$REMOVE</i>,mb-setvar places_softwarepipe=false" >> /tmp/espanso_list.csv
|
|
|
|
fi
|
|
|
|
cat "${MENU_ITEMS}"
|