From 1d1174dc51c83fb247dbc62de3579bd48ac48427 Mon Sep 17 00:00:00 2001 From: Hsieh Chin Fan Date: Mon, 3 Oct 2022 20:36:48 +0800 Subject: Update --- X11/rofi/pass.edit | 7 +++---- X11/rofi/pass.get | 9 ++++----- X11/rofi/pass.rm | 5 ++--- X11/rofi/rofi-pass | 4 +--- 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/X11/rofi/pass.edit b/X11/rofi/pass.edit index fb6ade9..428564d 100755 --- a/X11/rofi/pass.edit +++ b/X11/rofi/pass.edit @@ -1,6 +1,5 @@ #! /bin/sh -ROFI_ARGS=( '-font' 'Hack 22' ) ENTRIES="$(find ~/.password-store -name '*gpg' -printf %P\\n | sed 's/.gpg$//')" # Give rofi available passwords and exit @@ -15,8 +14,8 @@ fi # If password doesn't exist, just quit <<<"$ENTRIES" grep -q $1 || exit 0 -# Use alacritty to edit password +# Use detected terminal emulator to edit password coproc ( - alacritty -e pass edit $1 && pass $1 --clip - rofi "${ROFI_ARGS[@]}" -e "Copied: $1" + rofi-sensible-terminal -e pass edit $1 && pass $1 --clip + rofi -e "Copied: $1" ) diff --git a/X11/rofi/pass.get b/X11/rofi/pass.get index df70652..44857db 100755 --- a/X11/rofi/pass.get +++ b/X11/rofi/pass.get @@ -1,6 +1,5 @@ #! /bin/sh -ROFI_ARGS=( '-font' 'Hack 22' ) OPTIONS_NEW=( 'NO' 'YES' 'YES, and edit it' ) # Generate a new password @@ -9,14 +8,14 @@ if [ -n "${ROFI_DATA}" ]; then coproc ( export POST=false pass generate ${ROFI_DATA} --clip - rofi "${ROFI_ARGS[@]}" -e "Generate and Copied: ${ROFI_DATA}" + rofi -e "Generate and Copied: ${ROFI_DATA}" ) [ "$1" == "${OPTIONS_NEW[2]}" ] && \ coproc ( export POST=false pass generate ${ROFI_DATA} --clip - alacritty -e pass edit ${ROFI_DATA}; \ + rofi-sensible-terminal -e pass edit ${ROFI_DATA}; \ ) exit 0 @@ -40,8 +39,8 @@ if [ -n "$RESULT" ]; then echo "$RESULT" | head -1 | xsel -ib # And show extra message - EXTRA="$(echo; echo; echo "$RESULT" | sed '1d; 1{/^$/d}')" - coproc ( rofi "${ROFI_ARGS[@]}" -e "Copied: $1$EXTRA" ) + EXTRA="$(echo; echo; echo "$RESULT" | sed '1d' | sed '1{/^$/d}')" + coproc ( rofi -e "Copied: $1$EXTRA" ) # Password doesn't exist yet # Go to next rofi execution else diff --git a/X11/rofi/pass.rm b/X11/rofi/pass.rm index 44bdc33..a407792 100755 --- a/X11/rofi/pass.rm +++ b/X11/rofi/pass.rm @@ -1,6 +1,5 @@ #! /bin/sh -ROFI_ARGS=( '-font' 'Hack 22' ) ENTRIES="$(find ~/.password-store -name '*gpg' -printf %P\\n | sed 's/.gpg$//')" # Give rofi available passwords and exit @@ -16,6 +15,6 @@ fi <<<"$ENTRIES" grep -q $1 && \ coproc ( pass rm $1 &>/dev/null && \ - rofi "${ROFI_ARGS[@]}" -e "Removed: $1" || \ - rofi "${ROFI_ARGS[@]}" -e "Fail to remove $1" + rofi -e "Removed: $1" || \ + rofi -e "Fail to remove $1" ) diff --git a/X11/rofi/rofi-pass b/X11/rofi/rofi-pass index 1730b93..b6a1e01 100755 --- a/X11/rofi/rofi-pass +++ b/X11/rofi/rofi-pass @@ -2,6 +2,4 @@ cd $(dirname $0) -rofi -show get\ - -modes get:./pass.get,edit:./pass.edit,rm:./pass.rm \ - -font 'Hack 22' +rofi -show get -modes get:./pass.get,edit:./pass.edit,rm:./pass.rm -- cgit v1.2.3-70-g09d2