Skip to content

About

KDE Connect in the Omarchy bar (pairing, battery, replies, share, SFTP, SMS, MPRIS) via the kcd daemon

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

OMAConnect — KDE Connect for the Omarchy bar

OMAConnect panel

ekollof.omaconnect puts your phone in the Omarchy bar: pairing, battery, notification replies, file sharing, ping, and find-my-phone. The KDE Connect protocol (TLS, discovery, pairing, crypto) is handled by the kcd daemon — this plugin is a thin quickshell frontend over its CLI and live event stream. No protocol code lives in QML.

Prerequisites

yay -S kcd-bin        # daemon (> 1.17.0; contacts need > 1.19.0) + systemd user unit + firewall rules

Runtime needs are covered by any Omarchy install: bash, coreutils, python3 (framing layer), libnotify, plus the optionals below. SMS watch events update the panel only; kcd owns SMS notifications and applies its notification preferences and filters. OMAConnect does not send SMS bodies, sender numbers or attachment names to a notification process.

Recommended optional deps (all present in kcd-bin's optdepends):

  • libnotify — phone notifications with icons via notify-send
  • wl-clipboard — clipboard push (kcd clipboard)
  • sshfs — SFTP file browsing (v2 feature)
  • ydotool — phone-as-trackpad (handled entirely by the daemon)

The phone needs the KDE Connect Android app on the same network.

Install

omarchy plugin add https://github.com/ekollof/omaconnect.git --enable

Then enable the widget in the bar (default section: right), or:

omarchy plugin enable ekollof.omaconnect

Remove

omarchy plugin remove ekollof.omaconnect

This deletes the plugin only. Optionally clean up its companions (all opt-in, none required):

kcd sftp unmount <device-id>   # unmount phone storage first, if mounted
systemctl --user disable --now kcd
yay -R kcd-bin
rm -rf ~/.config/kcd ~/.config/systemd/user/kcd.service.d

First run

  1. Click the 󰄜 pill. If the daemon is stopped, the panel offers a Start kcd daemon button (runs systemctl --user enable --now kcd — only on explicit click, never automatically).
  2. Open KDE Connect on the phone — the desktop appears. Either accept the phone's pair request from the panel (Accept pair) or send one (Pair) and accept on the phone. The panel always shows the device name + full ID before you trust it (trust-on-first-use).
  3. Firewall: kcd-bin ships the rules (1716 TCP/UDP discovery + control, 1739–1764 TCP file transfers). Manual installs: allow those ports.

What works (MVP)

  • Devices + pairing: discovered/paired/offline states, pair/unpair with optimistic "Pair requested…" state.
  • Bar pill: phone glyph + battery % with charging indicator.
  • Notification replies: replyable phone notifications (WhatsApp, SMS, …) appear in the panel's reply section; answers go directly to kcd's protected Unix socket. SMS recipients and message/reply text travel over the helper's stdin and the socket, never process arguments, environment variables or temporary files. Private actions have a 64 KiB input/response limit and a five-second deadline; socket access requires current-user ownership, private permissions and a matching peer UID. Backend failure details are suppressed because they may echo message content. Each card has Send + Dismiss, plus a Clear all button — dismissing only clears the desktop offer, the phone keeps its copy. Display itself needs no plugin code — kcd forwards through notify-send, so toasts land in Omarchy's notification history/DND like any other app.
  • Share: send a file to the primary device; incoming files/links/text raise toasts pointing at the download dir.
  • Quick actions: ping, find-my-phone (ring), call mute hint on incoming calls.
  • Phone files (SFTP): list volumes, mount into the file manager, unmount. Needs sshfs (optdepend of kcd-bin).
  • SMS: compose by number; watch events update the panel, while kcd controls notification preferences and filters. No real SMS is sent by the tests.
  • Contacts (kcd ≥ 1.18): phone address book via kcd contacts sync/list with search; tapping a number fills the SMS composer. Sync progress arrives as contacts.updated events and refreshes the list automatically. Older daemons keep the manual number-entry behaviour (SMS shows a "needs kcd 1.18+" hint, no contacts section). Support is probed via the contacts subcommand itself, not the daemon version string — release builds before 1.19.0 report version: "dev" in status --json. Note: kcd contacts list --json requires the flag before the device id (urfave/cli stops flag parsing at the first positional). Names arriving quoted-printable–encoded (vCard 2.1, upstream kcd#38) are decoded client-side; kcd ≥ 1.19.1 will handle this natively once fixed.
  • Phone media (MPRIS): now-playing title/artist with play/pause toggle, previous/next. Shows "No media playing" when the phone is quiet.
  • Clipboard push: per-device "Clip" button sends the desktop clipboard to the phone (daemon handles sync; needs wl-clipboard).
  • Text entry: contact search, SMS, and notification replies guard against automatic native Qt clipboard reads. Ctrl+V/Shift+Insert explicitly paste plain text through wl-paste, limited to 16 KiB and a two-second timeout. Middle-click paste is disabled. These guarded fields support direct keyboard entry, selection, copy/cut, and undo/redo; native input-method composition is unavailable while the underlying Qt control remains read-only.

IPC

qs ipc call ekollof.omaconnect toggle
qs ipc call ekollof.omaconnect refresh

Resource limits

Phone-influenced data is untrusted input. Every backend call runs through bin/omaconnect-exec, which caps one-shot stdout/stderr (1 MiB each) and watch-stream records (64 KiB each, overlong records dropped). Overflow kills the producer and surfaces exit code 3, which the panel reports as a dropped action. Parsed strings and lists are additionally clipped in Model.js (device names, titles, message bodies) and the file browser caps at 2000 entries.

Validate / lint

omarchy plugin validate /home/ekollof/src/omaconnect
qmllint -I "$OMARCHY_PATH/shell" /home/ekollof/src/omaconnect/*.qml

Troubleshooting

Phone says "Failed receiving file": file transfers need the phone to open a TCP connection back to the desktop (ports 1739–1764), while the control channel usually works because the desktop dials out. With Omarchy's default-deny ufw, allow the pre-installed kcd profile:

sudo ufw allow kcd
sudo ufw reload

(kcd-bin ships the profile; it just isn't enabled automatically.)

Phone refuses to send a file: the Android app rejects 0-byte files client-side. Test with a real (non-empty) file.

Notification icons (kcd + quickshell quirks)

Two gaps, both worked around outside Omarchy core. Everything here is optional: without it, notifications arrive promptly with text and actions — just with generic/missing icons.

  1. kcd needs show_icons = true under [notification_plugin] in ~/.config/kcd/kcd.toml (default off), then systemctl --user restart kcd.

  2. quickshell 0.3.1 drops bare icon paths from the image role and renders a magenta tile for themed names missing from the icon theme. An opt-in, kcd-scoped notify-send shim fixes both — bare paths become file:// URLs, unknown names fall back to an existing icon. It never runs automatically and touches nothing outside kcd (PATH override applies to the kcd service unit only):

    mkdir -p ~/.config/kcd/bin ~/.config/systemd/user/kcd.service.d
    # copy extras/kcd-notify-shim/notify-send to ~/.config/kcd/bin/ and
    # extras/kcd-notify-shim/notify-shim.conf to
    # ~/.config/systemd/user/kcd.service.d/, then:
    systemctl --user daemon-reload && systemctl --user restart kcd

    Fallback names in the shim must exist in your icon theme — verify with a Quickshell.iconPath(name, true) probe returning non-empty.

Note: some Android apps (e.g. Conversations) send no icon payload at all; those show the generic fallback. Nothing on the desktop can conjure an icon the phone never sent.

Known quirks

  • IPC answers lag one reload behind: after omarchy plugin update, the panel UI refreshes immediately but omarchy-shell ekollof.omaconnect … keeps hitting the pre-update handler instance (first-registered wins and old instances linger). A shell restart promotes the new code. Symptom: new IPC functions report "Function not found" until restart.

Roadmap (v2)

SFTP browse/mount opener, SMS compose, MPRIS phone-playback controls, clipboard toggle, direct Unix-socket IPC instead of process spawns.

About

KDE Connect in the Omarchy bar (pairing, battery, replies, share, SFTP, SMS, MPRIS) via the kcd daemon

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages