type helpers update

master
Daniel Napora 2020-09-26 14:54:15 +02:00
parent 25053b91fa
commit c2f4d7ba37
2 changed files with 18 additions and 7 deletions

View File

@ -2,18 +2,21 @@
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)"
;;
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)"
;;
*)
TYPE_TO_SEARCH="Type to filter"
CONFIGURE="Configure Espanso"
EDITCONF="Edit default config file"
OPENCONFDIR="Open config directory"
@ -26,14 +29,14 @@ esac
MENU_ITEMS=/tmp/espanso_list.csv
trap "rm -f $MENU_ITEMS" EXIT
echo "^sep(Espanso - text expander)" >/tmp/espanso_list.csv
if [[ $(espanso status) =~ "not" ]]
then
echo "^sep(Espanso - text expander)" >/tmp/espanso_list.csv
echo "Espanso not running! Run it first by: 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
while read -r line ; do
IFS='-' read -r id string <<< "$line"
@ -54,7 +57,7 @@ fi
if [ $1 == "-s" ]; then
. /usr/bin/pipemenu-standalone.cfg
MENU_PADDING_TOP=0
MENU_PADDING_TOP=24
MENU_HALIGN="center"
MENU_VALIGN="top"
MENU_MARGIN_Y=40

View File

@ -1,14 +1,17 @@
#!/bin/bash
case $LANG in
pl*)
TYPE_TO_SEARCH="pisz, aby wyszukać"
HISTHELPER="Ściągawka z historii"
NOTHING="Niczego tu nie ma... Otwórz terminal (W-t) i wykonaj jakieś polecenie"
;;
es*)
TYPE_TO_SEARCH="Buscar"
HISTHELPER="Historia breve"
NOTHING="Nada que ver aquí...Abrir la terminal (W-t) y ejecutar algunos comandos"
;;
*)
TYPE_TO_SEARCH="Type to filter"
HISTHELPER="History helper"
NOTHING="Nothing to see here... Open terminal (W-t) and run some commands"
;;
@ -17,20 +20,24 @@ esac
MENU_ITEMS=/tmp/history_list.csv
trap "rm -f $MENU_ITEMS" EXIT
echo "^sep($HISTHELPER)" >/tmp/history_list.csv
if [ -f ~/.bash_history ]; then
echo "@search,,10,5,292,20,4,left,top,auto,#262626,\"\"\"<big></big> <i>$TYPE_TO_SEARCH</i>\"\"\"" >/tmp/history_list.csv
echo "^sep($HISTHELPER)" >>/tmp/history_list.csv
while read -r line ; do
printf "\"\"\"<b>%s</b>\"\"\",xdotool type --delay 0 \"%s\"\n" "$line" "$line" >> $MENU_ITEMS
printf "\"\"\"<b>%s</b>\"\"\",xdotool type --delay 0 \'%s\'\n" "$line" "$line" >> $MENU_ITEMS
done < <(cat ~/.bash_history|sort|uniq)
else
echo "^sep($HISTHELPER)" >/tmp/history_list.csv
echo "\"\"\"$NOTHING\"\"\",exo-open --launch TerminalEmulator" >>/tmp/history_list.csv
fi
### RUN
if [ $1 == "-s" ]; then
. /usr/bin/pipemenu-standalone.cfg
MENU_PADDING_TOP=0
MENU_PADDING_TOP=24
MENU_HALIGN="center"
MENU_VALIGN="top"
MENU_MARGIN_Y=40
@ -47,3 +54,4 @@ fi
#cat ${CONFIG_FILE}
cat ${MENU_ITEMS}