Copy bookmark script
This commit is contained in:
parent
4388e67fba
commit
c709793a7d
4 changed files with 63 additions and 2 deletions
19
src/bin/copy-bookmark
Executable file
19
src/bin/copy-bookmark
Executable file
|
@ -0,0 +1,19 @@
|
|||
#!/bin/sh
|
||||
|
||||
usage(){ printf "Usage: %s -s|f|r|d|R|h\n" $(basename $0); }
|
||||
|
||||
bookmarks="${BOOKMARKS:-"$HOME/.config/qutebrowser/bookmarks/urls"}"
|
||||
while getopts sfrdRh name; do
|
||||
case $name in
|
||||
f) menu="fzf";;
|
||||
r) menu="rofi -dmenu -i -p 'Bookmarks'";;
|
||||
s) menu="sk";;
|
||||
d) menu="${MENU}";;
|
||||
R) shuf -n1 $bookmarks | awk '{print $1}' | xclip -sel clip;;
|
||||
h) usage ;;
|
||||
*) usage
|
||||
exit 2;;
|
||||
esac
|
||||
done
|
||||
choice="$(sort $bookmarks | $menu )"
|
||||
[ -z "$choice" ] || echo "$choice" | awk '{print$1}' | xclip -sel clip
|
Loading…
Add table
Add a link
Reference in a new issue