Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New segment github_notifications #431

Closed
xx4h opened this issue May 30, 2024 · 0 comments · Fixed by #432
Closed

New segment github_notifications #431

xx4h opened this issue May 30, 2024 · 0 comments · Fixed by #432
Assignees

Comments

@xx4h
Copy link
Collaborator

xx4h commented May 30, 2024

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)

image

Abbreviation mode

image

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

image

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
xx4h added a commit that referenced this issue May 30, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment

fixes #431
xx4h added a commit that referenced this issue May 30, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment

fixes #431
xx4h added a commit that referenced this issue May 30, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment

fixes #431
xx4h added a commit that referenced this issue May 30, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment

fixes #431
xx4h added a commit that referenced this issue May 30, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment

fixes #431
@xx4h xx4h changed the title New segment github_notify New segment github_notifications May 30, 2024
xx4h added a commit that referenced this issue May 30, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment

fixes #431
xx4h added a commit that referenced this issue May 30, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment
* add jq requirement to README.md

fixes #431
xx4h added a commit that referenced this issue May 30, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment
* add jq requirement to README.md

fixes #431
xx4h added a commit that referenced this issue Jul 1, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment
* add jq requirement to README.md

fixes #431
xx4h added a commit that referenced this issue Jul 1, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment
* add jq requirement to README.md

fixes #431
xx4h added a commit that referenced this issue Jul 2, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment
* add jq requirement to README.md

fixes #431
xx4h added a commit to xx4h/tmux-powerline that referenced this issue Jul 9, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment
* add jq requirement to README.md

fixes erikw#431
xx4h added a commit that referenced this issue Jul 9, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment
* add jq requirement to README.md

fixes #431
xx4h added a commit that referenced this issue Jul 11, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment
* add jq requirement to README.md

fixes #431
@xx4h xx4h self-assigned this Jul 12, 2024
xx4h added a commit that referenced this issue Jul 12, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment
* add jq requirement to README.md

fixes #431
xx4h added a commit that referenced this issue Jul 13, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment
* add jq requirement to README.md

fixes #431
xx4h added a commit that referenced this issue Jul 13, 2024
* add new util function "is_tmp_valid" to make handling
  of temp files based on last update reusable
* add new segment
* add jq requirement to README.md

fixes #431
@xx4h xx4h closed this as completed in #432 Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant