Skip to content

Implement Linux DBus Integration for KDE Connect #8

@gloomcheng

Description

@gloomcheng

Parent Epic

Part of #6 (Mobile Notification Sync via KDE Connect Protocol)

Objective

On Linux, integrate with the KDE Connect daemon via DBus to receive phone notifications.

Prerequisites

  • User has KDE Connect installed
  • Phone is paired with the computer
  • KDE Connect daemon is running

Technical Implementation

Dependencies

npm install dbus-next

Architecture

┌─────────────────┐     DBus Session Bus     ┌─────────────────┐
│ KDE Connect     │ ◄══════════════════════► │ inboxd          │
│ Daemon          │  org.kde.kdeconnect      │ (dbus-next)     │
└─────────────────┘                          └─────────────────┘

Files to Create

src/services/mobileSync/
├── KDEConnectBridge.ts      # DBus client
├── KDEConnectService.ts     # Business logic
├── MobileSyncManager.ts     # Platform router
└── types.ts                 # TypeScript interfaces

Key Features

  1. Device Discovery

    • List paired devices via DBus
    • Monitor device connection status
  2. Notification Subscription

    • Subscribe to notificationPosted signal
    • Subscribe to notificationRemoved signal
    • Get notification details
  3. Reply Support

    • Call sendReply(replyId, message) method

DBus Interface

// Service: org.kde.kdeconnect
// Path: /modules/kdeconnect/devices/{deviceId}/notifications

interface NotificationsPlugin {
  // Methods
  activeNotifications(): string[];
  sendReply(replyId: string, message: string): void;
  sendAction(key: string, action: string): void;
  
  // Signals
  notificationPosted(publicId: string): void;
  notificationRemoved(publicId: string): void;
  notificationUpdated(publicId: string): void;
}

Tasks

  • Create KDEConnectBridge.ts with dbus-next
  • Implement device listing
  • Implement notification subscription
  • Implement reply functionality
  • Create KDEConnectService.ts for message pipeline integration
  • Add platform detection in MobileSyncManager.ts
  • Write unit tests
  • Test with real Android device

Acceptance Criteria

  • Can detect paired Android devices
  • Receives notifications in real-time
  • Notifications appear in inboxd message list
  • Can reply to notifications from inboxd
  • Graceful degradation if KDE Connect not installed

Estimated Effort

~1 week

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions