diff options
author | Rasmus Steinke <rasi@xssn.at> | 2018-10-05 22:29:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-05 22:29:50 +0200 |
commit | 1c9e6398144567718ae40e1c32bbaf6ffef21477 (patch) | |
tree | c5da9c92c42f965f6fec32e8c1f4ac5957faa518 | |
parent | a2232751291ed2ba3b8e7d0435fa00a931d9d890 (diff) | |
parent | 136644167c06e842dd4f49541de1f9b1feb74c42 (diff) | |
download | rofi-pass-1c9e6398144567718ae40e1c32bbaf6ffef21477.tar.gz |
Merge pull request #147 from ofpau/master
add config variable for pass clearing delay
-rw-r--r-- | config.example | 3 | ||||
-rwxr-xr-x | 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 @@ -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 |