Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/carnager/rofi-pass
Browse files Browse the repository at this point in the history
  • Loading branch information
carnager committed Nov 15, 2018
2 parents 6d8c329 + a2f1c3e commit 0b128a4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>,
Expand Down
3 changes: 3 additions & 0 deletions config.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions rofi-pass
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0b128a4

Please sign in to comment.