aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2018-11-15 18:23:29 +0100
committerRasmus Steinke <rasi@xssn.at>2018-11-15 18:23:29 +0100
commit0b128a4e52a898531d7323f71d0cef1fe28d4984 (patch)
tree5bfa23853a549c7935addc79ff6ea7d72b5c0383
parent6d8c3290d19c3355b94ade01223fc50a4d98a11b (diff)
parenta2f1c3e904351de015564353b556c6a23284de86 (diff)
downloadrofi-pass-0b128a4e52a898531d7323f71d0cef1fe28d4984.tar.gz
Merge branch 'master' of https://github.com/carnager/rofi-pass
-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