Created
March 9, 2019 14:25
-
-
Save nanpuyue/ddbb14c47a035e2271ef436416a2773c to your computer and use it in GitHub Desktop.
a notifier for yubikey-touch-detector
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# file: yubikey-touch-notify | |
# date: 2019-03-09 | |
# license: GPLv3 https://www.gnu.org/licenses/gpl-3.0.txt | |
# author: nanpuyue <[email protected]> https://blog.nanpuyue.com | |
# refer: https://github.com/maximbaz/yubikey-touch-detector | |
SOCKET="$XDG_RUNTIME_DIR/yubikey-touch-detector.socket" | |
NOTIFY_ICON="dialog-information" | |
while read -n5 event; do | |
case "$event" in | |
GPG_1|U2F_1) | |
notify-send -i "$NOTIFY_ICON" "Please touch the YubiKey (${event%_*})." | |
;; | |
GPG_0|U2F_0) | |
# TODO | |
: | |
;; | |
esac | |
done < <(socat unix-connect:"$SOCKET" stdout) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment