passrofi: Add wayland support (version 0.2.0)
This commit is contained in:
parent
0318d84a6e
commit
695985746e
1 changed files with 16 additions and 2 deletions
18
bin/passrofi
18
bin/passrofi
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# passrofi -- Rofi script for pass (passwordstore.org)
|
||||
# Version: 0.1.1
|
||||
# Version: 0.2.0
|
||||
# Author: binaryDiv
|
||||
|
||||
|
||||
|
|
@ -50,6 +50,15 @@ fail() {
|
|||
exit 1
|
||||
}
|
||||
|
||||
# Copies a string to the clipboard
|
||||
copy_to_clipboard() {
|
||||
if [[ $XDG_SESSION_TYPE == "wayland" ]]; then
|
||||
echo "$@" | wl-copy -n &>/dev/null
|
||||
else
|
||||
echo "$@" | xclip -selection clipboard -r -silent &>/dev/null
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
# Main entrypoint
|
||||
# ---------------
|
||||
|
|
@ -294,7 +303,7 @@ handle_copy_username() {
|
|||
|
||||
# Copy to clipboard
|
||||
coproc (
|
||||
echo "$username" | xclip -selection clipboard -r -silent &>/dev/null
|
||||
copy_to_clipboard "$username"
|
||||
)
|
||||
|
||||
# End here
|
||||
|
|
@ -340,6 +349,11 @@ main "$@"
|
|||
# CHANGELOG
|
||||
# =========
|
||||
#
|
||||
# Version 0.2.0:
|
||||
#
|
||||
# - Add wayland support for copying the username to the clipboard.
|
||||
# (Requires wl-copy from wl-clipboard.)
|
||||
#
|
||||
# Version 0.1.1:
|
||||
#
|
||||
# - Use "view_in_terminal" to view a password file if an executable with that
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue