Files
rune-docker/notification-bridge.py
Seth Van Niekerk e36e9bc4b5
All checks were successful
Build & Push Docker Image / build-and-publish (push) Successful in 56s
Test Notifications & Title Updates
2026-02-05 16:24:18 -05:00

37 lines
1.1 KiB
Python

#!/usr/bin/env python3
"""
D-Bus notification bridge for Selkies
Monitors desktop notifications and forwards them to the browser via Web Notifications API
"""
import gi # type: ignore
gi.require_version('Notify', '0.7') # type: ignore
from gi.repository import Notify, GLib # type: ignore
import sys
import os
def on_notification(notification):
"""Callback when a notification is received"""
# Selkies will automatically capture notifications sent via libnotify
# This script ensures the notification daemon is properly initialized
pass
def main():
# Initialize libnotify
if not Notify.init("notification-bridge"):
print("Failed to initialize libnotify", file=sys.stderr)
sys.exit(1)
print("Notification bridge started - forwarding desktop notifications to browser")
# Keep the script running to maintain D-Bus connection
try:
loop = GLib.MainLoop()
loop.run()
except KeyboardInterrupt:
print("\nNotification bridge stopped")
Notify.uninit()
if __name__ == "__main__":
main()