mabox-pipemenus/usr/bin/jghistory-pipe

58 lines
1.5 KiB
Plaintext
Raw Permalink Normal View History

2020-09-25 10:42:23 +02:00
#!/bin/bash
2020-09-25 16:06:39 +02:00
case $LANG in
pl*)
2020-09-26 14:54:15 +02:00
TYPE_TO_SEARCH="pisz, aby wyszukać"
2020-09-25 16:06:39 +02:00
HISTHELPER="Ściągawka z historii"
NOTHING="Niczego tu nie ma... Otwórz terminal (W-t) i wykonaj jakieś polecenie"
;;
es*)
2020-09-26 14:54:15 +02:00
TYPE_TO_SEARCH="Buscar"
2020-09-25 16:06:39 +02:00
HISTHELPER="Historia breve"
NOTHING="Nada que ver aquí...Abrir la terminal (W-t) y ejecutar algunos comandos"
;;
*)
2020-09-26 14:54:15 +02:00
TYPE_TO_SEARCH="Type to filter"
2020-09-25 16:06:39 +02:00
HISTHELPER="History helper"
NOTHING="Nothing to see here... Open terminal (W-t) and run some commands"
;;
esac
2020-09-25 10:42:23 +02:00
MENU_ITEMS=/tmp/history_list.csv
trap "rm -f $MENU_ITEMS" EXIT
2020-09-26 14:54:15 +02:00
2020-09-25 10:42:23 +02:00
2020-09-25 16:06:39 +02:00
if [ -f ~/.bash_history ]; then
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/history_list.csv
echo "^sep($HISTHELPER)" >>/tmp/history_list.csv
2020-09-25 16:06:39 +02:00
while read -r line ; do
2020-09-26 14:54:15 +02:00
printf "\"\"\"<b>%s</b>\"\"\",xdotool type --delay 0 \'%s\'\n" "$line" "$line" >> $MENU_ITEMS
2020-09-25 10:42:23 +02:00
done < <(cat ~/.bash_history|sort|uniq)
2020-09-25 16:06:39 +02:00
else
2020-09-26 14:54:15 +02:00
echo "^sep($HISTHELPER)" >/tmp/history_list.csv
2020-09-25 16:06:39 +02:00
echo "\"\"\"$NOTHING\"\"\",exo-open --launch TerminalEmulator" >>/tmp/history_list.csv
fi
2020-09-25 10:42:23 +02:00
### RUN
if [ $1 == "-s" ]; then
2021-09-24 01:40:09 +02:00
. /usr/share/mb-jgtools/pipemenu-standalone.cfg
2020-09-25 10:42:23 +02:00
2020-09-26 14:54:15 +02:00
MENU_PADDING_TOP=24
2020-09-25 10:42:23 +02:00
MENU_HALIGN="center"
MENU_VALIGN="top"
2020-09-25 16:06:39 +02:00
MENU_MARGIN_Y=40
2020-09-25 10:42:23 +02:00
jgmenu_icon_size=0
JGWIDTH=500
2021-09-24 01:49:21 +02:00
MENU_HEIGHT_MAX=600
2020-09-25 10:42:23 +02:00
mkconfigfile
jgmenu --config-file=${CONFIG_FILE} --csv-file=/tmp/history_list.csv 2>/dev/null
rm -f /tmp/history_list.csv
exit 0
fi
#cat ${CONFIG_FILE}
2020-09-25 16:06:39 +02:00
cat ${MENU_ITEMS}
2020-09-25 10:42:23 +02:00
2020-09-26 14:54:15 +02:00