Coder Social home page Coder Social logo

rofi-1pass's Introduction

rofi-1pass

Custom script for Rofi that allows you to copy passwords from your 1Password vaults. Based on the wonderfully simple rofi-lpass by Magnus Bergmark.

Features

  • List all your entries
  • Copy password of an entry
  • Copy username / email of an entry
  • Generate 2FA OTP of an entry (if entry has 2FA set up)
  • Copy URL (if entry has an URL)
  • Open URL (if entry has an URL)
  • Interactive password prompt with configurable PINENTRY_PROGRAM

Non-Features

  • Creating or editing new entries through rofi

Dependencies

  • 1Password command-line tool for connecting to 1Password
  • jq for parsing the JSON output of the 1Password CLI
  • xclip for putting the selected entries onto your X11 clipboard

In order to support interactive login (where rofi-1pass will prompt you for your password if you don't currently have a session active), you will need a pinentry program, which are usually part of GnuPG, present in virtually every distribution.

The default pinentry program is pinentry-x11. If you prefer to use another, like pinentry-rofi, just set the PINENTRY_PROGRAM environment variable.

All of the above need to be on your PATH when running rofi-1pass. They are present in most package managers.

Installation

  1. Symlink the script to somewhere on your $PATH: ln -s $(pwd)/rofi-1pass ~/bin/rofi-1pass.
  2. If you don't have pinentry, make sure your environment has an active OP_SESSION. Alternatively, you can put the output of op signin into ~/.op/session where it will be automatically sourced.
  3. Run rofi with this as a custom script: rofi -modi 1pass:rofi-1pass -show 1pass.

Arch Linux

On Arch, the AUR has a rofi-1pass PKGBUILD.

License

Copyright © 2018 Adrian Petrescu. Code released under the MIT license.

rofi-1pass's People

Contributors

apetresc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rofi-1pass's Issues

Assumes a vault called "my"

Thanks so much for this script! I've hit a bit of a snag though; the script fails when there is no account called my.

Perhaps I didn't set up 1password correctly, but I don't have an account called my, so have had to change the signin line.

Unusable on large amount of passwords

Hey! First of all, thank you very much for sharing with this script! Unfortunately, I find it totally unusable as it takes ~4 seconds for the script to finish and also around the same after selecting a specific entry. Do you have any ideas on how this could be improved?

Only handles passwords from templateUuid: 001

The Login template (templateUuid: "001") places the password in detials.fields[].designation = 'password

The Password template (templateUuid: "005") places the password in details.password

>> Copy Password only handles a Login template, not a Password template, and returns jq: error (at <stdin>:1): Cannot iterate over null (null) since there is no matching field.

Perhaps op get item should read the templateUuid and pick the appropriate path based on the response?

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.