bin/passrofi: Version 0.1.1
Version 0.1.1: - Use "view_in_terminal" to view a password file if an executable with that name exists in the PATH.
This commit is contained in:
parent
f7526687dc
commit
a8456ad259
24
bin/passrofi
24
bin/passrofi
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# passrofi -- Rofi script for pass (passwordstore.org)
|
# passrofi -- Rofi script for pass (passwordstore.org)
|
||||||
# Version: 0.1.0
|
# Version: 0.1.1
|
||||||
# Author: binaryDiv
|
# Author: binaryDiv
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -311,10 +311,25 @@ handle_view_file() {
|
||||||
|
|
||||||
# Open file in a pager inside a terminal
|
# Open file in a pager inside a terminal
|
||||||
coproc (
|
coproc (
|
||||||
rofi-sensible-terminal -e "bash -ic 'pass show \"$USER_SELECTION\" | less'" &>/dev/null
|
#rofi-sensible-terminal -e "bash -ic 'pass show \"$USER_SELECTION\" | less'" &>/dev/null
|
||||||
|
{
|
||||||
|
echo "Password file: $USER_SELECTION"
|
||||||
|
echo "------------------------------------------------------------"
|
||||||
|
pass show "$USER_SELECTION"
|
||||||
|
echo
|
||||||
|
} | view_stdin_in_terminal &>/dev/null
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Opens a terminal that shows data from stdin. Uses 'view_in_terminal' if it exists in $PATH.
|
||||||
|
view_stdin_in_terminal() {
|
||||||
|
if which view_in_terminal &>/dev/null; then
|
||||||
|
view_in_terminal
|
||||||
|
else
|
||||||
|
rofi-sensible-terminal -e "bash -ic 'less < /proc/$BASHPID/fd/0'"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
# Run script
|
# Run script
|
||||||
main "$@"
|
main "$@"
|
||||||
|
|
@ -325,6 +340,11 @@ main "$@"
|
||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
# =========
|
# =========
|
||||||
#
|
#
|
||||||
|
# Version 0.1.1:
|
||||||
|
#
|
||||||
|
# - Use "view_in_terminal" to view a password file if an executable with that
|
||||||
|
# name exists in the PATH.
|
||||||
|
#
|
||||||
# Version 0.1.0:
|
# Version 0.1.0:
|
||||||
#
|
#
|
||||||
# - First version
|
# - First version
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue