Trello

Shows unread Trello notification count with a drop-down list of clickable recent notifications

Image preview of Trello plugin.

trello_notifications.15m.sh

Edit
Open on GitHub
#!/bin/bash
# shellcheck disable=SC2034
# shellcheck disable=SC2154
# shellcheck source=/dev/null

# <xbar.title>Trello</xbar.title>
# <xbar.version>1.0.3</xbar.version>
# <xbar.author>Kodie Grantham</xbar.author>
# <xbar.author.github>kodie</xbar.author.github>
# <xbar.desc>Shows unread Trello notification count with a drop-down list of clickable recent notifications</xbar.desc>
# <xbar.image>https://raw.githubusercontent.com/kodie/bitbar-trello/master/screenshot.png</xbar.image>
# <xbar.dependencies>jq</xbar.dependencies>
# <xbar.abouturl>https://github.com/kodie/bitbar-trello</xbar.abouturl>

ver="1.0.3"

### Note: The below variables can be overwritten by setting them in the ~/.bitbar_trello file

apiKey=""   # Your Trello API Key
apiToken="" # Your Trello API Token
# ^ To get these, go to https://trello.com/app-key

limit="20"  # Number of notifications to fetch (Can be any number from 1 to 1000)

# Fonts, sizes, and colors (Setting to blank will use system default)
readColor=""        # Read notification color (Color names or HEX values can be used)
readFont=""         # Read notification font
readSize="15"       # Read notification font size
unreadColor="blue"  # Unread notification color (Color names or HEX values can be used)
unreadFont=""       # Unread notification font
unreadSize="15"     # Unread notification font size

truncLength="70"    # Number of characters before the notification text is truncated (Set to blank to disable truncating)
truncSuffix="..."   # Text to use after truncating

useIcons="1"  # Whether emoji icons should be displayed next to notifications or not (0=no, 1=yes)

unreadDisplay="1"       # Unread display mode (0=none, 1=beside icon/title, 2=rotated with icon/title, 3=in dropdown)
unreadEcho="%unread%"   # Unread count text (%unread% will be replaced with unread count number)

title=""  # Text to be displayed on system bar (Can be set to blank to display icon only)

# Base64 icon to use in system bar (Can be set to blank to disable icon)
icon="iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAABYlAAAWJQFJUiTwAAA59GlUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGl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ZXNvbHV0aW9uVW5pdD4yPC90aWZmOlJlc29sdXRpb25Vbml0PgogICAgICAgICA8ZXhpZjpDb2xvclNwYWNlPjY1NTM1PC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4zMjwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4zMjwvZXhpZjpQaXhlbFlEaW1lbnNpb24+CiAgICAgIDwvcmRmOkRlc2NyaXB0aW9uPgogICA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgIAo8P3hwYWNrZXQgZW5kPSJ3Ij8+hdGrPAAAACBjSFJNAAB6JQAAgIMAAPn/AACA6QAAdTAAAOpgAAA6mAAAF2+SX8VGAAABOklEQVR42uzXu0oDQRTG8d/GBASVVBIFRbwgKPgAttr7JraW2qilz2BjKdjbiKWivY2dilqZYLzhpXCFsGxkjImDkA+GhcP5mD9n5szsJD41hnUsYEBndY9DrOIMRlHF+x+PJ0zDboTJv8Z+ghr6xVG9iFImeIJlnDcxVbCFxUz8Dkvf+Kawh3JDLJGz/rMB5EXcZHyVAN94xlPNA+gLLN9lxheinixAISep1f1QCsgpZwMFkdUF6AJ0AdoJ8BKQ8xi7AvVOAmwH5OxkA0l6FzT+BQ3hOvAuGM4p8VWT/JGc47pWbHOJe9Mbr9uG/xvgOdD7Fhug2CmAzQDfSruWL+8cuMVF2ud5ZR/ERPr9rWoJHtL+jaGHAl5jd8FBxPmPYTLd+THehnNJSjKDDcz/4GHS8rrjCGs4/RgAcpKcgCV7ut0AAAAASUVORK5CYII="

### Notification settings
# nIcon_[$notificationType] - Emoji Icon (See list of possibilities here: http://www.webpagefx.com/tools/emoji-cheat-sheet/)
# nText_[$notificationType] - Text to be displayed for notification. (Useable vars: %name%, %card%, %board%, %organization%)
# nType_[$notificationType] - Notification type. Probably shouldn't ever be changed. (c=card, b=board, o=organization)

# An attachment was added to a card
nIcon_addAttachmentToCard="📎"
nText_addAttachmentToCard="%name% added an attachment to card %card%"
nType_addAttachmentToCard="c"

# The current member was added to a board
nIcon_addedToBoard="📋"
nText_addedToBoard="%name% added you to the board %board%"
nType_addedToBoard="b"

# The current member was added to a card
nIcon_addedToCard="📗"
nText_addedToCard="%name% added you to the card %card%"
nType_addedToCard="c"

# The current member was added to an organization
nIcon_addedToOrganization="🏠"
nText_addedToOrganization="%name% added you to the organization %organization%"
nType_addedToOrganization="o"

# Another member was added to a card
nIcon_addedMemberToCard="📗"
nText_addedMemberToCard="%name% was added to the card %card%"
nType_addedMemberToCard="c"

# The current member was added to a board as an admin
nIcon_addAdminToBoard="📋"
nText_addAdminToBoard="%name% added you as an admin on the board %board%"
nType_addAdminToBoard="b"

# The current member was added to an organization as an admin
nIcon_addAdminToOrganization="🏠"
nText_addAdminToOrganization="%name% added you as an admin of the organization %organization%"
nType_addAdminToOrganization="o"

# A card was changed
nIcon_changeCard="📝"
nText_changeCard="%name% updated the card %card%"
nType_changeCard="c"

# A board was closed
nIcon_closeBoard="📋"
nText_closeBoard="%name% closed the board %board%"
nType_closeBoard="b"

# Another member commented on a card
nIcon_commentCard="💬"
nText_commentCard="%name% commented on the card %card%"
nType_commentCard="c"

# Another member created a card
nIcon_createdCard="📙"
nText_createdCard="%name% created the card %card%"
nType_createdCard="c"

# The current member was invited to a board
nIcon_invitedToBoard="📋"
nText_invitedToBoard="%name% invited you to the board %board%"
nType_invitedToBoard="b"

# The current member was invited to an organization
nIcon_invitedToOrganization="🏠"
nText_invitedToOrganization="%name% invited you to the organization %organization%"
nType_invitedToOrganization="o"

# The current member was removed from a board
nIcon_removedFromBoard="📋"
nText_removedFromBoard="%name% removed you from the board %board%"
nType_removedFromBoard="b"

# The current member was removed from a card
nIcon_removedFromCard="📕"
nText_removedFromCard="%name% removed you from the card %card%"
nType_removedFromCard="c"

# Another member was removed from a card
nIcon_removedMemberFromCard="📕"
nText_removedMemberFromCard="%name% was removed from the card %card%"
nType_removedMemberFromCard="c"

# The current member was removed from an organization
nIcon_removedFromOrganization="🏠"
nText_removedFromOrganization="%name% removed you from the organization %organization%"
nType_removedFromOrganization="o"

# The current member was mentioned on a card
nIcon_mentionedOnCard="🔔"
nText_mentionedOnCard="%name% mentioned you on the card %card%"
nType_mentionedOnCard="c"

# ???
nIcon_unconfirmedInvitedToBoard="❔"
nText_unconfirmedInvitedToBoard="%name% unconfirmedInvitedToBoard %board%"
nType_unconfirmedInvitedToBoard="b"

# ???
nIcon_unconfirmedInvitedToOrganization="❔"
nText_unconfirmedInvitedToOrganization="%name% unconfirmedInvitedToOrganization %organization%"
nType_unconfirmedInvitedToOrganization="o"

# A checklist item on a card was updated
nIcon_updateCheckItemStateOnCard="✅"
nText_updateCheckItemStateOnCard="%name% updated a checklist on the card %card%"
nType_updateCheckItemStateOnCard="c"

# The current member was made an admin of a board
nIcon_makeAdminOfBoard="📋"
nText_makeAdminOfBoard="%name% made you an admin on the board %board%"
nType_makeAdminOfBoard="b"

# The current member was made an admin of an organization
nIcon_makeAdminOfOrganization="🏠"
nText_makeAdminOfOrganization="%name% made you an admin of the organization %organization%"
nType_makeAdminOfOrganization="o"

# A card's due date is approaching
nIcon_cardDueSoon="🕓"
nText_cardDueSoon="The card %card% is due soon"
nType_cardDueSoon="c"

# Another member declined the current member's invitation to a board
nIcon_declinedInvitationToBoard="📋"
nText_declinedInvitationToBoard="%name% declined your invite to the board %board%"
nType_declinedInvitationToBoard="b"

# Another member declined the current member's invitation to an organization
nIcon_declinedInvitationToOrganization="🏠"
nText_declinedInvitationToOrganization="%name% declined your invite to the organization %organization%"
nType_declinedInvitationToOrganization="o"

# Another member joined Trello because of the current member's recommendation
nIcon_memberJoinedTrello="👋"
nText_memberJoinedTrello="%name% joined Trello on your recommendation"
nType_memberJoinedTrello="o"

### End of notification settings

apiLink="https://api.trello.com/1" # API Link. Probably shouldn't ever be changed.
nLink="https://trello.com"                                  # Base for notification links. Probably shouldn't ever be changed.

configFile="$HOME/.bitbar_trello" # Config file path
createConfigFile="1"              # Create the config file if one is not found (0=no, 1=yes)

###
### No editing below this line unless you know what you are doing.
###

# Check if there's a config file
if [ -e "$configFile" ]; then
  . "$configFile"
elif [ "$createConfigFile" == "1" ]; then
  printf "# To get your Trello API Key and Token, go to https://trello.com/app-key\napiKey=\"%s\"\napiToken=\"%s\"" "$apiKey" "$apiToken" > "$configFile"
fi

# Export PATH
export PATH="/usr/local/bin:/usr/bin:$PATH"

# "Mark All Notifications As Read" function
if [ "$1" == "markRead" ]; then
  curl -s -X POST "$apiLink/notifications/all/read?key=$apiKey&token=$apiToken"
fi

# Get response from API
response=$(curl -s -X GET "$apiLink/members/me/notifications?key=$apiKey&token=$apiToken&limit=$limit")

# Check for errors
if [ "${response:0:1}" == "[" ]; then
  error=false
  ids=($(echo "$response" | jq -r -c '.[].id'))
else
  error=true
  if [[ ! "$response" || "${response:0:1}" == "<" ]]; then response="no response"; fi
fi

# Set the title to "Trello" if we're running it BitBar and both the title and icon have been set to blank
if [[ "${BitBar}" && ! "$title" && ! "$icon" ]]; then title="Trello"; fi

# If there's no errors, get the unread notification count
if [[ ! "$unreadDisplay" == "0" && "$error" == false ]]; then
  unread=($(echo "$response" | jq -c '.[].unread | select(.==true)'))
  unreadCount=${#unread[@]}

  if [[ "$unreadCount" -gt 0 ]]; then
    unreadEcho=${unreadEcho//%unread%/$unreadCount}
    if [ "$unreadDisplay" == "1" ]; then title="$title$unreadEcho"; fi
  fi
fi

# BitBar title formatting
if [ "${BitBar}" ]; then
  # Set title properties
  titleProperties=" | dropdown=false"

  # Set the icon if there is one
  if [ "$icon" ]; then titleProperties="$titleProperties templateImage="$icon; fi
fi

# Our first echo
titleEcho="$title$titleProperties"
if [ "$titleEcho" ]; then echo "$titleEcho"; fi

# Display unread count if there are no errors and unreadDisplay is set to 2 or 3
if [[ "$error" == false && "$unreadCount" -gt 0 ]]; then
  if [ "$unreadDisplay" == "2" ]; then
    echo "$unreadEcho"
  elif [ "$unreadDisplay" == "3" ]; then
    echo "---";
    echo "$unreadEcho";
  fi
fi

if [ "$titleEcho" ]; then echo "---"; fi

# Echo the error in the drop-down
if [ "$error" == true ]; then echo "⁉️ $response"; fi

# If there's no errors, let's loop through the notifications
if [ "$error" == false ]; then
  x=0

  # Notifications were found
  if [[ "${#ids[@]}" -gt 0 ]]; then
    for i in "${ids[@]}"; do
      # Get the data for this notification
      this=$(echo "$response" | jq -c '.['$x']')
      notificationType=$(echo "$this" | jq -r '.type')

      # Get notification type settings
      if [ "$useIcons" == "1" ]; then itemIcon="nIcon_$notificationType"; itemIcon=${!itemIcon}; fi
      itemText="nText_$notificationType"; itemText=${!itemText}
      itemType="nType_$notificationType"; itemType=${!itemType}

      # Start the link
      itemLink="$nLink"

      # Deal with different notification types
      case $itemType in
        # Cards
        "c")
          shortLink=$(echo "$this" | jq -r '.data.card.shortLink')
          itemLink="$itemLink/c/$shortLink"

          cardName=$(echo "$this" | jq -r '.data.card.name')
          itemText="${itemText//%card%/$cardName}"
        ;;

        # Boards
        "b")
          shortLink=$(echo "$this" | jq -r '.data.board.shortLink')
          itemLink="$itemLink/b/$shortLink"

          boardName=$(echo "$this" | jq -r '.data.board.name')
          itemText="${itemText//%board%/$boardName}"
        ;;

        # Organizations
        "o")
          orgId=$(echo "$this" | jq -r '.data.organization.id')
          itemLink="$itemLink/$orgId"

          orgName=$(echo "$this" | jq -r '.data.organization.name')
          itemText="${itemText//%organization%/$orgName}"
        ;;
      esac

      # Name replace
      memberName=$(echo "$this" | jq -r -c ".memberCreator.fullName")
      if [ "$memberName" ]; then
        itemText="${itemText//%name%/$memberName}"
      fi

      # Only set item properties if we're in BitBar
      if [ "${BitBar}" ]; then
        # Item properties
        itemProperties=" | href="$itemLink

        # Colors and fonts
        itemUnreadStatus=$(echo "$this" | jq -r '.unread')
        if [ "$itemUnreadStatus" == true ]; then
          color=$unreadColor
          font=$unreadFont
          size=$unreadSize
        else
          color=$readColor
          font=$readFont
          size=$readSize
        fi

        if [ "$color" ]; then itemProperties="$itemProperties color="$color; fi
        if [ "$font" ]; then itemProperties="$itemProperties font="$font; fi
        if [ "$size" ]; then itemProperties="$itemProperties size="$size; fi
      fi

      # Add a space after icon if there is one
      if [ "$itemIcon" ]; then itemIcon="$itemIcon "; fi

      # Truncate the item text
      if [ "$truncLength" ]; then
        if [ "${#itemText}" -gt "$truncLength" ]; then
          itemText="${itemText:0:$truncLength-${#truncSuffix}}$truncSuffix"
        fi
      fi

      # Print it
      echo "$itemIcon$itemText$itemProperties"

      # Break out if we hit our limit
      if [[ $x == $((limit-1)) ]]; then break; fi

      # Increment x
      ((x+=1))
    done

    # Display "Mark All Notificatins As Read" option if there are any unread notifications
    if [[ "${BitBar}" && "$unreadCount" -gt 0 ]]; then
      echo "---"
      echo "Mark All Notifications As Read | bash='$0' param1=markRead refresh=true terminal=false"
    fi
  else
    # No notifications were found
    echo "🙈 no notifications found"
  fi
fi

# Display about menu
if [ "${BitBar}" ]; then
  echo "---"
  echo "BitBar Trello Plugin v$ver"
  echo "--by Kodie Grantham | href=http://kodieg.com"
  echo "-----"
  echo "--GitHub Page | href=https://github.com/kodie/bitbar-trello"
  echo "--Changelog | href=https://github.com/kodie/bitbar-trello/blob/master/CHANGELOG.md"
  echo "-----"
  echo "--Refresh | refresh=true terminal=false"
fi