Add a bookmark to Pinboard. The URL may be given via standard input, as an argument, or copied from the clipboard.
I frequently want to bookmark a URL in Pinboard while not logged in. Maybe I'm in my primary browser but my Pinboard cookie has expired. Maybe I'm in a disposable browser where I'm not logged in to any accounts. Maybe I'm not in a browser at all, but someone sent me a link via email or a chat application. By binding this script to a keystroke, I can easily add a bookmark in any of these scenarios.
- xdotool is used to get the name of the window currently under the mouse pointer (to be used as the default bookmark name).
- xclip is used to get the URL out of the clipboard.
- Buy a Pinboard account.
- Export your Pinboard user name
$PINBOARD_USERand your Pinboard API key as
- There is no step 3.
# ~/.config/sxhkd/sxhkdrc super + d termite --title pinit -e ~/bin/pinit.sh
I use the i3 window manager. Because I gave the terminal a window title, I can tell i3 to float that window.
# ~/.config/i3/config for_window [title="pinit"] floating enable
Now when I want to bookmark a URL I'll copy it to my clipboard and hit
super + d.