aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md2
-rw-r--r--config.example3
-rwxr-xr-xrofi-pass13
3 files changed, 11 insertions, 7 deletions
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 <kbd>Tab</kbd>,
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 e252fcf..df1cff8 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