Skip to content

Commit

Permalink
add qrcode support
Browse files Browse the repository at this point in the history
  • Loading branch information
carnager committed Mar 24, 2018
2 parents 35fb2e7 + 4754781 commit b1cd1a0
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 12 deletions.
10 changes: 5 additions & 5 deletions config.example
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ _rofi () {
rofi -i -no-auto-select "$@"
}

# rofi-pass can create a qrcode for selected entry.
# This needs qrencode to be installed and an image
# viewer that supports reading from a pipe.
# Working viewers are feh and display
# image viewer to display qrcode of selected entry
# qrencode is needed to generate the image and a viewer
# that can read from pipes. Known viewers to work are feh and display
_image_viewer () {
feh -
feh -
# display
}

# xdotool needs the keyboard layout to be set using setxkbmap
Expand Down
23 changes: 16 additions & 7 deletions rofi-pass
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ _rofi () {
}

_image_viewer () {
<<<<<<< HEAD

This comment has been minimized.

Copy link
@maxice8

maxice8 Mar 25, 2018

merge conflict ? :o

This comment has been minimized.

Copy link
@carnager

carnager Mar 25, 2018

Author Owner

what the hell? this is not present in my local git

This comment has been minimized.

Copy link
@maxice8

maxice8 Mar 25, 2018

it is present in the 2.0.0 tarball

This comment has been minimized.

Copy link
@carnager

carnager Mar 25, 2018

Author Owner

very odd

carnager@caprica ~/git/rofi-pass > git pull
From https://github.com/carnager/rofi-pass
 * [new tag]         2.0.0      -> 2.0.0
Already up to date.
carnager@caprica ~/git/rofi-pass > head -n 15 rofi-pass 
#!/usr/bin/env bash

# rofi-pass
# (c) 2015 Rasmus Steinke <[email protected]>
basecommand="$0"

# set default settings
_rofi () {
    rofi -no-auto-select -i "$@"
}

_image_viewer () {
    feh -
}

This comment has been minimized.

Copy link
@maxice8

maxice8 Mar 25, 2018

$ unpk 2.0.0.tar.gz
rofi-pass-2.0.0/
rofi-pass-2.0.0/LICENSE
rofi-pass-2.0.0/Makefile
rofi-pass-2.0.0/README.md
rofi-pass-2.0.0/addpass
rofi-pass-2.0.0/config.example
rofi-pass-2.0.0/keepass2import.py
rofi-pass-2.0.0/pass2csv.py
rofi-pass-2.0.0/rofi-pass
rofi-pass-2.0.0/screenshot.jpg
$ head -n 17 rofi-pass-2.0.0/rofi-pass
#!/usr/bin/env bash

# rofi-pass
# (c) 2015 Rasmus Steinke <[email protected]>
basecommand="$0"

# set default settings
_rofi () {
    rofi -no-auto-select -i "$@"
}

_image_viewer () {
<<<<<<< HEAD
  sxiv -
=======
    feh -
>>>>>>> qrcode

This comment has been minimized.

Copy link
@carnager

carnager Mar 25, 2018

Author Owner

thanks for reporting. I made a bugfix release.

sxiv -
=======
feh -
>>>>>>> qrcode
}

# We expect to find these fields in pass(1)'s output
Expand All @@ -30,6 +34,7 @@ clip=primary
default_user="${ROFI_PASS_DEFAULT_USER-$(whoami)}"
default_user2=john_doe
password_length=12
fix_layout=false

# default shortcuts
autotype="Alt+1"
Expand Down Expand Up @@ -58,6 +63,10 @@ has_qrencode() {
command -v qrencode >/dev/null 2>&1
}

has_qrencode() {
command -v qrencode >/dev/null 2>&1
}

# get all password files and create an array
list_passwords() {
cd "${root}" || exit
Expand Down Expand Up @@ -240,7 +249,7 @@ copyPass () {
printf '%s' "$password" | doClip
if [[ $notify == "true" ]]
then
notify-send "rofi-pass" "Copied Password\nClearing in 45 seconds"
notify-send "rofi-pass" "Copied Password\\nClearing in 45 seconds"
fi

if [[ $notify == "true" ]]
Expand Down Expand Up @@ -489,8 +498,8 @@ typeMenu () {
if [[ -n $default_do ]]; then
if [[ $default_do == "menu" ]]; then
checkIfPass
local -a keys=(${!stuff[@]})
keys=(${keys[@]/$AUTOTYPE_field})
local -a keys=("${!stuff[@]}")
keys=("${keys[@]/$AUTOTYPE_field}")
typefield=$({ echo ${AUTOTYPE_field} ; printf '%s\n' "${keys[@]}" | sort; } | _rofi -dmenu -p "Choose Field to type > ")
typefield_exit=$?
if [[ $typefield_exit -eq 1 ]]; then
Expand Down Expand Up @@ -557,9 +566,9 @@ actionMenu () {

showEntry () {
if [[ -z $pass_content ]]; then
password_temp=$(PASSWORD_STORE_DIR="${root}" pass show "$selected_password")
password="${password_temp%%$'\n'*}"
pass_key_value=$(printf '%s\n' "${password_temp}" | tail -n+2 | grep ': ')
pass_temp=$(PASSWORD_STORE_DIR="${root}" pass show "$selected_password")
password="${pass_temp%%$'\n'*}"
pass_key_value=$(printf '%s\n' "${pass_temp}" | tail -n+2 | grep ': ')
declare -A stuff
while read -r LINE; do
_id="${LINE%%: *}"
Expand Down Expand Up @@ -596,7 +605,7 @@ showEntry () {
fi
if [[ $notify == "true" ]]
then
notify-send "rofi-pass" "Copied Password\nClearing in 45 seconds"
notify-send "rofi-pass" "Copied Password\\nClearing in 45 seconds"
fi
if [[ $notify == "true" ]]
then
Expand Down

0 comments on commit b1cd1a0

Please sign in to comment.