bin/rofi/passmenu: show notifications with notify-send

Instead of rofi
This commit is contained in:
Henrik Lissner 2020-03-29 01:45:17 -04:00
parent b7162371a3
commit 3b59c6f3f5
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -6,7 +6,7 @@
# Example: passmenu [RESUME] # Example: passmenu [RESUME]
ROFI_CMD='rofi -dmenu -theme theme/passmenu.rasi' ROFI_CMD='rofi -dmenu -theme theme/passmenu.rasi'
ROFI_MSG_CMD='rofi -theme theme/passmenu.rasi -markup -e' MSG_CMD='notify-send'
set -e set -e
shopt -s nullglob globstar shopt -s nullglob globstar
@ -47,7 +47,7 @@ else
fi fi
if [[ -z $entry ]]; then if [[ -z $entry ]]; then
$ROFI_MSG_CMD "<span foreground="red">Failed to select $entry</span>" $MSG_CMD "Error!" "Failed to select $entry"
exit 1 exit 1
fi fi
@ -61,8 +61,8 @@ if [[ -n $secrets ]]; then
otp) printf "%s" "$(pass otp -c "$entry")" ;; otp) printf "%s" "$(pass otp -c "$entry")" ;;
*) printf "%s" "$(awk -v "key=$field:" '$1 == key {print $2}' <<<"$secrets")" | xclip -selection clipboard -in ;; *) printf "%s" "$(awk -v "key=$field:" '$1 == key {print $2}' <<<"$secrets")" | xclip -selection clipboard -in ;;
esac esac
$ROFI_MSG_CMD "Copied <b>$entry/$field</b> to clipboard for 45s" $MSG_CMD "Success!" "Copied <b>$entry/$field</b> to clipboard for 45s"
else else
$ROFI_MSG_CMD "<span foreground="red">Failed to retrieve $entry</span>" $MSG_CMD "Error!" "Failed to retrieve $entry"
exit 2 exit 2
fi fi