-
Notifications
You must be signed in to change notification settings - Fork 87
PluginSmartkey
Display hardware key touch indicator for YubiKey, SoloKeys, Nitrokey and similar security devices.
TOUCH # Key is waiting for touch (attention needed)
(hidden) # No key activity
| Property | Value |
|---|---|
| Platform | macOS, Linux |
| Dependencies |
gpg-connect-agent (optional), pcsc_scan (optional) |
| Content Type | dynamic |
| Presence | conditional |
No mandatory dependencies - the plugin uses multiple detection methods:
# Optional: For GPG/scdaemon detection
# macOS
brew install gnupg
# Linux
sudo apt install gnupg2
# Optional: For PCSC detection
# Linux
sudo apt install pcscd pcsc-tools# Enable plugin
set -g @powerkit_plugins "smartkey"# Enable plugin
set -g @powerkit_plugins "smartkey"
# Icons
set -g @powerkit_plugin_smartkey_icon ""
set -g @powerkit_plugin_smartkey_icon_waiting ""
# Cache - very short TTL since touch state changes quickly
set -g @powerkit_plugin_smartkey_cache_ttl "2"| Option | Type | Default | Description |
|---|---|---|---|
@powerkit_plugin_smartkey_icon |
icon | |
Default plugin icon |
@powerkit_plugin_smartkey_icon_waiting |
icon | |
Icon when waiting for touch |
@powerkit_plugin_smartkey_cache_ttl |
number | 2 |
Cache duration in seconds |
@powerkit_plugin_smartkey_show_only_on_threshold |
bool | false |
Only show when threshold exceeded (N/A) |
| State | Condition | Visibility |
|---|---|---|
active |
Hardware key is waiting for touch | Visible |
inactive |
No key activity | Hidden |
| Level | Condition | Color |
|---|---|---|
error |
Key is waiting for touch (urgent attention needed) | Red |
ok |
No key activity | Green |
| Context | Description |
|---|---|
waiting |
Key is waiting for touch interaction |
idle |
No key activity |
The plugin uses multiple methods to detect when a hardware key is waiting for touch, in priority order:
If installed, the yubikey-touch-detector daemon is the most reliable method:
# Install on Linux
yay -S yubikey-touch-detector
systemctl --user enable --now yubikey-touch-detector.socketDetects when SSH is waiting for FIDO2 key touch:
-
ssh-keygenprocesses (git signing, resident keys) -
ssh-sk-helper(SSH authentication) -
libfido2tools
Detects when pinentry is prompting for smartcard PIN/touch.
Detects when GPG's scdaemon is blocked waiting for card interaction.
Detects when ykman is waiting for user interaction.
Detects when YubiKey USB device is busy (transaction in progress):
- macOS: Uses
ioregto check busy state - Linux: Uses
/sys/class/hidrawandlsof
set -g @powerkit_plugins "smartkey"set -g @powerkit_plugins "smartkey"
set -g @powerkit_plugin_smartkey_icon_waiting "🔑"set -g @powerkit_plugins "smartkey"
set -g @powerkit_plugin_smartkey_cache_ttl "1"When using a YubiKey for GPG signing git commits:
git commit -m "Signed commit"
# Plugin shows "TOUCH" when key needs touchWhen using FIDO2 key for SSH:
ssh user@server
# Plugin shows "TOUCH" when key needs touchWhen decrypting files with smartcard:
gpg --decrypt file.gpg
# Plugin shows "TOUCH" when key needs touch- YubiKey (all models with touch)
- SoloKeys (Solo, Solo V2)
- Nitrokey (Nitrokey 3, Nitrokey FIDO2)
- Google Titan
- Feitian (ePass FIDO)
- Any FIDO2/U2F key with touch requirement
-
Verify key requires touch:
# For YubiKey ykman info -
Check if detection methods are available:
which gpg-connect-agent which pcsc_scan
-
Test with a signing operation:
echo "test" | gpg --sign # Plugin should show during touch wait
The cache TTL is 2 seconds by default. Touch states can be very brief. This is expected behavior.
If the plugin shows "TOUCH" when not expected:
- Check for background GPG operations
- Verify no other processes are accessing the key
- Ensure yubikey-touch-detector (if installed) is working correctly
Different operations use different detection methods. If a specific operation isn't detected:
- Try installing yubikey-touch-detector for most reliable detection
- Check if the operation uses scdaemon, FIDO2, or CCID
- Report the issue with details about the operation
- Very short cache TTL (2 seconds) for responsiveness
- Detection methods are checked in priority order, early exit on first match
- Minimal overhead when no key activity
- Uses
ioregfor YubiKey busy state detection - Uses
osascriptfor pinentry-mac detection
- Uses
/sys/class/hidrawfor device detection - Uses
/procfilesystem for process inspection - PCSC daemon integration available
- PluginBitwarden - Bitwarden vault status (can use hardware key)
- PluginGit - Git status (signing uses hardware key)
- PluginSsh - SSH session indicator