GithubHelp home page GithubHelp logo

pinit's Introduction

Pinit

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.

Requirements

  • 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.

Setup

  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.

Usage

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/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.

pinit's People

Contributors

pigmonkey avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.