Add history file to launch-menu
This commit is contained in:
parent
4ba91b1753
commit
1b9fff48b1
2 changed files with 9 additions and 4 deletions
|
@ -1,10 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
SCRIPTS="$HOME/.config/hypr/menu.list"
|
||||
HISTORY_FILE="$HOME/.cache/tofi/launch-menu.txt"
|
||||
|
||||
# Kill existing tofi instance if running
|
||||
pkill -x tofi || {
|
||||
chosen=$(cut -d'=' -f1 "$SCRIPTS" | tofi)
|
||||
chosen=$(cut -d'=' -f1 "$SCRIPTS" | tofi --history-file="$HISTORY_FILE" --history=true --require-match=true --fuzzy-match=true)
|
||||
if [ -n "$chosen" ]; then
|
||||
script=$(awk -F= -v sel="$chosen" '$1==sel {print $2}' "$SCRIPTS")
|
||||
[ -n "$script" ] && eval "$script" &
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue