Introducing a new segment for displaying your github notifications, fully customizable, only showing what you want to see and in the way you want to see it.
Symbol mode (default)
Abbreviation mode
abbreviation
notification type
areq
approval_requested
as
assign
au
author
co
comment
ci
ci_activity
in
invitation
ma
manual
me
mention
rreq
review_requested
sec
security_alert
sc
state_change
sub
subscribed
t
team_mention
Summarize mode
Settings
# github_notifications.sh {
# Github token (https://github.com/settings/tokens) with at least "notifications" scope
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_TOKEN="YOUR_TOKEN"
# Include available notification reasons (https://docs.github.com/en/rest/activity/notifications?apiVersion=2022-11-28#about-notification-reasons),
# in the format "REASON:SEPARATOR"
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_REASONS="approval_requested:- |assign:- |author:- |comment:- |ci_activity:- |invitation:- |manual:- |mention:- |review_requested:- |security_alert:- |state_change:- |subscribed:- |team_mention:- "
# Or if you don't like so many symbols, try the abbreviation variant
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_REASONS="approval_requested:areq|assign:as|author:au|comment:co|ci_activity:ci|invitation:in|manual:ma|mention:me|review_requested:rreq|security_alert:sec|state_change:st|subscribed:su|team_mention:team"
# So in case you only want to see review requests and when someone is mentioning you
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_REASONS="review_requested:areq|mention:me"
# this way, all other notifications reasons are ignored.
# You can also change the abbreviation so you save some space in your statusline
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_REASONS="review_requested:r|mention:m"
# Or even use an symbol instead
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_REASONS="review_requested:👁|mention:🙋"
# Use symbol mode (ignored if you set TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_REASONS yourself)
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_SYMBOL_MODE="yes"
# Summarize all notifications
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_SUMMARIZE="yes"
# Hide if no notifications
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_HIDE_NO_NOTIFICATIONS="no"
# Only show new notifications since date (default: today)
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_SINCE="2024-05-30T00:00:00Z"
# Enable show only notifications since date
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_SINCE_ENABLE="no"
# Maximum notifications to retreive (upstream github default per_page)
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_PER_PAGE="50"
# Maximum pages to retreive
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_MAX_PAGES="10"
# Update interval to pull latest state from github api
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_UPDATE_INTERVAL="60"
# Enable Test Mode (to test how the segment will look like when you have notifications for all types/reasons)
export TMUX_POWERLINE_SEG_GITHUB_NOTIFICATIONS_TEST_MODE="no"
# }
Known issues:
Currently only 50 notifications can be pulled (Needs paging support to pull more) paging implemented
Github API currently does not support to get notifications only for specific "reasons" (like "mention", or "subscribed"), so we always have to pull all of them
Introducing a new segment for displaying your github notifications, fully customizable, only showing what you want to see and in the way you want to see it.
Symbol mode (default)
Abbreviation mode
Summarize mode
Settings
Known issues:
Currently only 50 notifications can be pulled (Needs paging support to pull more)paging implemented