config_sway/bin/waybar_card.sh
Konstantin Koslowski 711c9a31f9 waybar: update configs
- waybar: rename to start_waybar.sh
- waybar_card: minor formatting in tooltip
- waybar_mediaplayer: add icons to tooltip
2021-05-14 12:05:29 +02:00

16 lines
349 B
Bash
Executable file

#!/bin/bash
CMD="/usr/bin/gpg --card-status"
text=""
tooltip=""
alt="missing"
ret=$($CMD 2> /dev/null)
if [ $? -eq 0 ]; then
tooltip="<b>S/N</b> $(echo $ret | grep -oE 'Serial number[.:0-9 ]*' | grep -oE '[0-9]*')"
alt="available"
fi
json="{\"text\": \"$text\", \"tooltip\": \"$tooltip\", \"class\": \"card\", \"alt\": \"$alt\"}"
echo $json