13 lines
461 B
Bash
Executable file
13 lines
461 B
Bash
Executable file
#!/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 --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" &
|
|
fi
|
|
}
|