Skip to content

Gotify Notifications Widget - #298

Open
Owen-3456 wants to merge 1 commit into
glanceapp:mainfrom
Owen-3456:gotify-recent-notifications
Open

Gotify Notifications Widget#298
Owen-3456 wants to merge 1 commit into
glanceapp:mainfrom
Owen-3456:gotify-recent-notifications

Conversation

@Owen-3456

@Owen-3456 Owen-3456 commented Jul 7, 2026

Copy link
Copy Markdown

Widget description

Shows recent Gotify notifications with priority-based colour coding in a list

repo: Owen-3456/gotify-glance-widget

Widget yaml

- type: custom-api
  title: Notifications
  title-url: ${SERVER_ADDRESS}      # example - http://192.168.1.1:8070
  cache: 1m
  url: ${SERVER_ADDRESS}/message
  parameters:
    limit: 10
    collapse-after: 5
  headers:
    X-Gotify-Key: ${GOTIFY_CLIENT_TOKEN}
  template: |
    {{ $messages := .JSON.Array "messages" }}
    {{ if eq (len $messages) 0 }}
      <p style="color: var(--color-text-subdue);">No notifications.</p>
    {{ else }}
      <ul class="list list-gap-14 collapsible-container" data-collapse-after="5">
        {{ range $messages }}
          {{ $priority := .Int "priority" }}
          {{ $date := .String "date" | parseTime "rfc3339" }}
          {{ $title := .String "title" }}
          {{ $message := .String "message" }}
          <li data-popover-type="text" data-popover-text="{{ $title }}: {{ $message }}">
            <div class="flex items-center gap-10" style="margin-bottom: 3px;">
              {{ if ge $priority 8 }}
                <span class="color-negative">●</span>
              {{ else if ge $priority 4 }}
                <span class="color-primary">●</span>
              {{ else }}
                <span style="color: var(--color-text-subdue);">●</span>
              {{ end }}
              <span class="color-highlight size-h4 grow" style="overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;">{{ $title }}</span>
              <span class="size-h6" style="color: var(--color-text-subdue); white-space: nowrap;">{{ $date.Format "Jan 2 15:04" }}</span>
            </div>
            <p class="size-h5" style="padding-left: 18px; white-space: pre-line; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;">{{ $message }}</p>
          </li>
        {{ end }}
      </ul>
    {{ end }}

Widget preview

preview

Copilot AI review requested due to automatic review settings July 7, 2026 23:31

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new community widget definition for displaying recent Gotify notifications in Glance, including end-user configuration and widget metadata.

Changes:

  • Added widgets/gotify-notifications/README.md documenting a custom-api template that renders Gotify messages with priority-based styling.
  • Added widgets/gotify-notifications/meta.yml to register the widget’s title/description/author.

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 3 comments.

File Description
widgets/gotify-notifications/README.md Documents the widget configuration, template, and usage details
widgets/gotify-notifications/meta.yml Adds widget metadata for catalog/discovery

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread widgets/gotify-notifications/README.md
Comment thread widgets/gotify-notifications/README.md
Comment thread widgets/gotify-notifications/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants