aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2018-03-24 22:11:25 +0100
committerRasmus Steinke <rasi@xssn.at>2018-03-24 22:11:25 +0100
commitb1cd1a0e35406a90b8d16ca5e3ba1a436f4d64c0 (patch)
tree5166a4d6aeadc2627b22991c4968ceaa332ac940
parent35fb2e753ea956cc4d3836af8c480d2d03bb32e9 (diff)
parent475478191a0e52d733e5f331cbcb9ae8f73400ec (diff)
downloadrofi-pass-b1cd1a0e35406a90b8d16ca5e3ba1a436f4d64c0.tar.gz
add qrcode support2.0.0
-rw-r--r--config.example10
-rwxr-xr-xrofi-pass23
2 files changed, 21 insertions, 12 deletions
diff --git a/config.example b/config.example
index 6524c4b..24f1f26 100644
--- a/config.example
+++ b/config.example
@@ -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
diff --git a/rofi-pass b/rofi-pass
index c334faf..41d52f5 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -10,7 +10,11 @@ _rofi () {
}
_image_viewer () {
+<<<<<<< HEAD
sxiv -
+=======
+ feh -
+>>>>>>> qrcode
}
# We expect to find these fields in pass(1)'s output
@@ -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"
@@ -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
@@ -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" ]]
@@ -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
@@ -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%%: *}"
@@ -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