You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
450 B
20 lines
450 B
5 years ago
|
#!/usr/bin/env bash
|
||
|
|
||
|
BOOKMARKS="$HOME/.surf/bookmarks/"
|
||
|
|
||
|
function formatFile(){
|
||
|
keywords="$(grep -E '^keywords:' "$1" | sed 's/^keywords://')"
|
||
|
echo "$1 : $keywords" | sed 's/ / /g'
|
||
|
}
|
||
|
export -f formatFile
|
||
|
|
||
|
if [ -d "$BOOKMARKS" ]; then
|
||
|
cd "$BOOKMARKS"
|
||
|
selection=$(find . -type f -exec bash -c 'formatFile "{}"' \; | dmenu -l 20 | sed 's/ : .*//')
|
||
|
if [ -f "$selection" ]; then
|
||
|
head -n 1 "$selection"
|
||
|
fi
|
||
|
else
|
||
|
echo "$BOOKMARKS doesn't exist"
|
||
|
fi
|