Add a bookmark to Pinboard
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


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.


  1. Buy a Pinboard account.
  2. Export your Pinboard user name $PINBOARD_USER and your Pinboard API key as $PINBOARD_KEY.
  3. There is no step 3.


I bind the script via sxhkd. The script uses interactive input, so rather than calling it directly, I execute it via a terminal (in my case termite, but any will do).

# ~/.config/sxhkd/sxhkdrc
super + d
    termite --title pinit -e ~/bin/

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.