mirror of
https://github.com/SqrtMinusOne/dotfiles.git
synced 2025-12-11 11:43:03 +03:00
22 lines
593 B
Bash
Executable file
22 lines
593 B
Bash
Executable file
#!/bin/sh
|
|
COMMAND="buku -o %"
|
|
# COMMAND="qutebrowser $(buku -f 10 -p %)"
|
|
if [[ $1 == '-e' ]]; then
|
|
COMMAND="buku -w %"
|
|
fi
|
|
buku -f 5 -p | awk -F'\t' -v OFS='\t' '{
|
|
split($3, tags, ",")
|
|
joined = sep = ""
|
|
for (i = 1; i in tags; i++) {
|
|
joined = joined sep "[" tags[i] "]"
|
|
sep = " "
|
|
}
|
|
if ($1 != "waiting for input") {
|
|
printf "%-5s %-40s %s\n", $1, $2, joined
|
|
}
|
|
}' | dmenu -l 20 | cut -d ' ' -f 1 | {
|
|
read index;
|
|
url=$(buku -f 10 p $index)
|
|
echo $url
|
|
# echo ${$()#"waiting for input"} | cut -d ' ' -f 1 | xargs -I % qutebrowser %
|
|
}
|