90 lines
2.5 KiB
Bash
Executable File
90 lines
2.5 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
case $LANG in
|
|
pl*)
|
|
TYPE_TO_SEARCH="pisz, aby wyszukać"
|
|
CONFIGURE="Konfiguracja Espanso"
|
|
EDITCONF="Edytuj domyślny plik konfiguracyjny"
|
|
OPENCONFDIR="Otwórz katalog z konfiguracją"
|
|
DOCU="Dokumentacja <b>Espanso</b> (online)"
|
|
LIST="Lista wyzwalaczy:"
|
|
;;
|
|
es*)
|
|
TYPE_TO_SEARCH="Buscar"
|
|
CONFIGURE="Configurar Espanso"
|
|
EDITCONF="Editar archivo x defecto"
|
|
OPENCONFDIR="Abrir el directorio"
|
|
DOCU="Leer <b>Documentacion</b> de Espanso (en línea)"
|
|
LIST="List of triggers:"
|
|
;;
|
|
*)
|
|
TYPE_TO_SEARCH="Type to filter"
|
|
CONFIGURE="Configure Espanso"
|
|
EDITCONF="Edit default config file"
|
|
OPENCONFDIR="Open config directory"
|
|
DOCU="Read <b>Espanso</b> documentation (online)"
|
|
LIST="List of triggers:"
|
|
;;
|
|
esac
|
|
|
|
|
|
|
|
MENU_ITEMS=/tmp/espanso_list.csv
|
|
trap "rm -f $MENU_ITEMS" EXIT
|
|
|
|
if [[ $(espanso status) =~ "not" ]]
|
|
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
|
|
|
|
else
|
|
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
|
|
echo "^sep($CONFIGURE)" >>/tmp/espanso_list.csv
|
|
echo "$EDITCONF, xdg-open ~/.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
|
|
echo "^sep($LIST)" >>/tmp/espanso_list.csv
|
|
while read -r line ; do
|
|
|
|
IFS='-' read -r id string <<< "$line"
|
|
printf "\"\"\"<b><tt>%-12s</tt></b> <i>%s</i>\"\"\",espanso match exec %s\n" $id "${string//</<}" $id >> $MENU_ITEMS
|
|
done < <(espanso match list)
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
### RUN
|
|
if [ $1 == "-s" ]; then
|
|
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
|
|
. $HOME/.config/mabox/mabox.conf
|
|
|
|
MENU_PADDING_TOP=${jgtools_padding:-0}
|
|
MENU_PADDING_TOP=24
|
|
MENU_HALIGN="center"
|
|
MENU_VALIGN="top"
|
|
MENU_MARGIN_Y=40
|
|
jgmenu_icon_size=0
|
|
JGWIDTH=500
|
|
MENU_HEIGHT_MAX=600
|
|
[ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
|
|
[ -z $jgmenu_use_borders ] && menu_border=0
|
|
|
|
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}"
|