From 136644167c06e842dd4f49541de1f9b1feb74c42 Mon Sep 17 00:00:00 2001 From: Pau Oliver Date: Fri, 5 Oct 2018 21:53:32 +0200 Subject: [PATCH 1/2] add config variable for pass clearing delay --- config.example | 3 +++ rofi-pass | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/config.example b/config.example index 7464bb5..cb32391 100644 --- a/config.example +++ b/config.example @@ -67,6 +67,9 @@ help_color="#4872FF" # Possible options: primary, clipboard, both clip=primary +# Seconds before clearing pass from clipboard +clip_clear=45 + ## Options for generating new password entries # open new password entries in editor diff --git a/rofi-pass b/rofi-pass index 3834030..7e164e4 100755 --- a/rofi-pass +++ b/rofi-pass @@ -28,6 +28,7 @@ auto_enter='false' notify='false' help_color="" clip=primary +clip_clear=45 default_user="${ROFI_PASS_DEFAULT_USER-$(whoami)}" default_user2=john_doe password_length=12 @@ -239,13 +240,13 @@ copyPass () { checkIfPass 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 $clip_clear seconds" fi if [[ $notify == "true" ]]; then - (sleep 45; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard | notify-send "rofi-pass" "Clipboard cleared") & + (sleep $clip_clear; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard | notify-send "rofi-pass" "Clipboard cleared") & elif [[ $notify == "false" ]]; then - (sleep 45; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard) & + (sleep $clip_clear; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard) & fi } @@ -602,12 +603,12 @@ showEntry () { printf '%s' "${stuff[${word}]}" | doClip fi if [[ $notify == "true" ]]; then - notify-send "rofi-pass" "Copied Password\\nClearing in 45 seconds" + notify-send "rofi-pass" "Copied Password\\nClearing in $clip_clear seconds" fi if [[ $notify == "true" ]]; then - (sleep 45; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard | notify-send "rofi-pass" "Clipboard cleared") & + (sleep $clip_clear; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard | notify-send "rofi-pass" "Clipboard cleared") & elif [[ $notify == "false" ]]; then - (sleep 45; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard) & + (sleep $clip_clear; printf '%s' "" | xclip; printf '%s' "" | xclip -selection clipboard) & fi exit fi From b9e5aa49a4411f1e4fbb09a3741bebac144c5128 Mon Sep 17 00:00:00 2001 From: Arne Beer Date: Fri, 2 Nov 2018 17:57:11 +0100 Subject: [PATCH 2/2] Fix typo in Readme It should be `user` instead of `UserName` --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e72ec7..0c19053 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ in a convenient way using [rofi](https://github.com/DaveDavenport/rofi). SomeField: foobar AnotherField: barfoo url: http://my.url.foo - autotype: SomeField :tab UserName :tab AnotherField :tab pass + autotype: SomeField :tab user :tab AnotherField :tab pass ``` You can use `:tab`, `:enter`, or `:space` here to type Tab,