Copy bookmark script
This commit is contained in:
parent
4388e67fba
commit
c709793a7d
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
|
38
src/manpages/copy-bookmark.1.scd
Normal file
38
src/manpages/copy-bookmark.1.scd
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
open-bookmark(1)
|
||||||
|
|
||||||
|
# NAME
|
||||||
|
|
||||||
|
*copy-bookmark* - puts a *qutebrowser(1)* bookmark into *xclip(1)* clipboard
|
||||||
|
|
||||||
|
# SYNOPSIS
|
||||||
|
|
||||||
|
*open-bookmark -s|f|r|d|R|h*
|
||||||
|
|
||||||
|
# DESCRIPTION
|
||||||
|
*qutebrowser(1)* saves its bookmarks in
|
||||||
|
'*~/.config/qutebrowser/bookmarks/urls*'.
|
||||||
|
I would like to be able to access those bookmarks more easily outside of
|
||||||
|
qutebrowser sometimes. Hence this script now exists.
|
||||||
|
|
||||||
|
# OPTIONS
|
||||||
|
|
||||||
|
*-s*
|
||||||
|
use *sk(1)* to select bookmark
|
||||||
|
|
||||||
|
*-f*
|
||||||
|
use *fzf(1)* to select bookmark
|
||||||
|
|
||||||
|
*-r*
|
||||||
|
use *rofi(1)* to select bookmark
|
||||||
|
|
||||||
|
*-d*
|
||||||
|
use *$MENU* to select bookmark
|
||||||
|
|
||||||
|
*-R*
|
||||||
|
copy random bookmark
|
||||||
|
|
||||||
|
*-h*
|
||||||
|
print usage and exit
|
||||||
|
|
||||||
|
# SEE ALSO
|
||||||
|
*fzf(1)*, *sk(1)*, *rofi(1)*, *qutebrowser(1)*, *xclip(1)*
|
|
@ -23,6 +23,10 @@ both problems.
|
||||||
*open-bookmark*
|
*open-bookmark*
|
||||||
Opens a bookmark in *xdg-open(1)*, see its own manpage for more information
|
Opens a bookmark in *xdg-open(1)*, see its own manpage for more information
|
||||||
|
|
||||||
|
*copy-bookmark*
|
||||||
|
Adds a bookmark to clipboard using *xclip(1)*, see its own manpage for more
|
||||||
|
information
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
|
|
||||||
*open-bookmark(1)*, *xdg-open(1)*
|
*open-bookmark(1)*, *xdg-open(1)*, *xclip(1)*
|
||||||
|
|
|
@ -35,4 +35,4 @@ qutebrowser sometimes. Hence this script now exists.
|
||||||
print usage and exit
|
print usage and exit
|
||||||
|
|
||||||
# SEE ALSO
|
# SEE ALSO
|
||||||
*fzf(1)*, *sk(1)*, *rofi(1)*, *qutebrowser(1)*
|
*fzf(1)*, *sk(1)*, *rofi(1)*, *qutebrowser(1)*, *xdg-open(1)*
|
||||||
|
|
Loading…
Reference in a new issue