mabox-pipemenus/usr/bin/jghistory-pipe

35 lines
679 B
Plaintext
Raw Normal View History

2020-09-25 10:42:23 +02:00
#!/bin/bash
MENU_ITEMS=/tmp/history_list.csv
trap "rm -f $MENU_ITEMS" EXIT
echo "^sep(History helper)" >/tmp/history_list.csv
while read -r line ; do
printf "\"\"\"<b>%s</b>\"\"\",xdotool type --delay 0 \"%s\"\n" "$line" "$line" >> $MENU_ITEMS
done < <(cat ~/.bash_history|sort|uniq)
### RUN
if [ $1 == "-s" ]; then
. /usr/bin/pipemenu-standalone.cfg
MENU_PADDING_TOP=0
MENU_HALIGN="center"
MENU_VALIGN="top"
MENU_MARGIN_Y=30
MENU_MARGIN_X=30
jgmenu_icon_size=0
JGWIDTH=500
#MENU_HEIGHT_MAX=600
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}
#cat ${MENU_ITEMS}