mabox-pipemenus/usr/bin/jghistory-pipe

50 lines
1.2 KiB
Plaintext
Raw 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*)
HISTHELPER="Ściągawka z historii"
NOTHING="Niczego tu nie ma... Otwórz terminal (W-t) i wykonaj jakieś polecenie"
;;
es*)
HISTHELPER="Historia breve"
NOTHING="Nada que ver aquí...Abrir la terminal (W-t) y ejecutar algunos comandos"
;;
*)
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-25 16:06:39 +02:00
echo "^sep($HISTHELPER)" >/tmp/history_list.csv
2020-09-25 10:42:23 +02:00
2020-09-25 16:06:39 +02:00
if [ -f ~/.bash_history ]; then
while read -r line ; do
2020-09-25 10:42:23 +02:00
printf "\"\"\"<b>%s</b>\"\"\",xdotool type --delay 0 \"%s\"\n" "$line" "$line" >> $MENU_ITEMS
done < <(cat ~/.bash_history|sort|uniq)
2020-09-25 16:06:39 +02:00
else
echo "\"\"\"$NOTHING\"\"\",exo-open --launch TerminalEmulator" >>/tmp/history_list.csv
fi
2020-09-25 10:42:23 +02:00
### RUN
if [ $1 == "-s" ]; then
. /usr/bin/pipemenu-standalone.cfg
MENU_PADDING_TOP=0
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
2020-09-25 16:06:39 +02:00
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