Omahub
← All plugins
T

Synology Drive

by tug-benson

Synology Drive sync status, folders, and recent files in the Omarchy bar — bypasses the broken Qt tray UI.

Security review

No obvious issues detected

Deterministic scan — not a security guarantee

None
Risk level
None
Analyzed commit
0fb715b
Scanned
1 month ago

No potentially dangerous behavior detected in the analyzed commit.

Automated analysis only — not a security guarantee.

AI advisory review

No obvious issues detected

Language-model assessment · ~deepseek/deepseek-v4-flash-latest — advisory only

Low
AI risk level
Low
Recommendation
install
Model
~deepseek/deepseek-v4-flash-latest
Analyzed commit
0fb715b
Reviewed
1 month ago

The plugin reads local Synology Drive SQLite databases and performs user-initiated actions (open folders, restart daemon) via standard commands. No network access, no sudo, no hidden or obfuscated code. The deterministic scan found no issues.

How this check works

This review combines the deterministic scan (the rule-based results above) with an independent look at the plugin's code by a language model. The model reads a trimmed sample of the repository's files, the manifest, and the README, then gives a plain-language risk level and a recommendation: install (no notable danger), review (look closer first), or avoid (clearly dangerous).

It runs on the same analyzed commit as the deterministic scan and is strictly advisory — it is not a security guarantee and never blocks a plugin by itself. A human moderator still reviews plugins before they are listed.

AI advisory only — automated analysis, not a security guarantee.

Install
$ omarchy plugin add https://github.com/tug-benson/synology-drive --enable
System #bar #quickshell #system

Synology Drive for Omarchy

A bar-widget + panel for the Omarchy Quattro shell that replaces the broken Qt-tray Synology Drive UI on Wayland.

The official synology-drive AUR package bundles Qt5 without a Wayland platform plugin (qt.qpa.plugin: Could not find the Qt platform plugin "wayland"), so the tray icon and main window render incorrectly under Hyprland/Wayland. This plugin reads the local Synology Drive SQLite state directly and surfaces it natively in the Omarchy bar.

preview

Features

  • Bar icon — live state without the tray (Nerd Font glyphs in the bar; text shown here for readability):
    • Up to date — green
    • Syncing — accent, animated hero phrase
    • Unsynced files — urgent
    • Not linked / Daemon stopped — dim
  • Hero — host (YOUR_NAS example), user, and status phrase cycling while syncing
  • Stats — server, user, daemon PID, folder count, unsynced count
  • Actions — Refresh (R), Open App (O), Logs (L), Restart/Stop via synology-drive wrapper
  • Sync & Backup folders — session-aware (session_table from ~/.SynologyDrive/data/db/sys.sqlite), separated into Backup Tasks (session_type=2, upload) and Sync Tasks (session_type=1, bidirectional), each with distinct header/icon and count, click to xdg-open the local folder. Direction badge per row (Upload / Bidirectional). Headers are collapsible (click to collapse/expand) with a separator between the two kinds.
  • Unsynced files — from file-status.sqlite (syncStatus != 0, e.g. locked ~/.config/some-app/run/lockfile.txt) with reason, collapsible with separator and count.
  • Recent activity — from history.sqlite ordered by update_time with relative times, collapsible with separator and count.

No network access, no daemon socket reverse-engineering for v1 — purely reads ~/ .SynologyDrive/data/db/*.sqlite via status.py every 30s (configurable).

Requirements

  • Arch Linux + synology-drive from AUR (yay -S synology-drive) — AUR
  • Source .deb is https://global.synologydownload.com/download/Utility/SynologyDriveClient/4.2.0-20058/Ubuntu/Installer/synology-drive-client-20058.x86_64.deb
  • Omarchy Quattro (omarchy-shell on quickshell)
  • python3 + sqlite3 (standard library)

Optional but assumed installed by the AUR package: curl, glib2, libarchive, qt5-base, qt5-wayland, hicolor-icon-theme, nautilus (for folder open).

Install

omarchy plugin add https://github.com/tug-benson/synology-drive.git --enable --yes
# or manually:
mkdir -p ~/.config/omarchy/plugins
cp -r /path/to/synology-drive ~/.config/omarchy/plugins/io.github.tug-benson.synology-drive
omarchy-shell shell rescanPlugins

The widget lands in right by default. Move it:

omarchy bar move io.github.tug-benson.synology-drive --section right

Usage

  • Left click — toggle panel
  • Right click — refresh now
  • Middle click — open Synology Drive app (synology-drive start with LD_LIBRARY_PATH=/opt/Synology/SynologyDrive/lib)
  • Panel keys — j/k navigate, Enter open folder/file, R refresh, O open app, L open daemon.log, Esc close, Tab switch panels
  • IPC — omarchy-shell shell summon io.github.tug-benson.synology-drive '{}' / hide / call … refresh

Sessions and recent files are clickable. Unsynced files open their path (or parent) via xdg-open. Logs open ~/.SynologyDrive/log/daemon.log in your default handler.

Configuration

~/.config/omarchy/shell.json entry:

{ "id": "io.github.tug-benson.synology-drive", "refreshIntervalSec": 30 }
key type default range effect
refreshIntervalSec integer 30 5–3600 status.py poll interval

Lower values poll the SQLite DBs more often; the helper itself is cheap (< 20 ms, read-only mode=ro).

How it works

  • status.py reads:
    • ~/.SynologyDrive/data/db/sys.sqlite → connection_table (server/linked) + session_table (sync folders)
    • ~/.SynologyDrive/data/db/file-status.sqlite → fstatinfo for unsyncedCount
    • ~/.SynologyDrive/data/db/history.sqlite → history_table for recent files
    • ~/.SynologyDrive/{daemon,ui}.pid + pgrep cloud-drive-daemon for running state
  • Service.qml runs python3 status.py 25 via Quickshell.Io.Process, applies Model.js parsing, and re-polls via refreshTimer.
  • Panel.qml (entry barWidget in manifest.json:11) renders both the BarIconButton and the Panel/KeyboardPanel (same combined pattern as omarchy.dropbox and validated marketplace plugins like harshith.system-monitor). The guide's canonical split is BarWidget.qml + Panel.qml via Loader — this plugin keeps a single file for minimal IPC surface; a split stays compatible and can be adopted when qmllint ships full qs.Ui types.

No daemon socket write in v1; pause/resume is not wired (Synology's daemon.sock/ui.sock protocol is Qt-proprietary). The plugin intentionally does not run sudo or install hooks.

Autostart & tray

Synology Drive's own autostart (checked in the Drive client settings) is sufficient — leave it enabled. The Drive daemon (cloud-drive-daemon) and the UI (cloud-drive-ui) will start at login. No separate systemd unit is needed.

The native Qt tray (qt.qpa.plugin: Could not find the Qt platform plugin "wayland") is broken under Hyprland/Wayland — this plugin replaces it. Hiding the tray icon is optional and left to your preference:

  • The plugin does not hide or disable omarchy.tray automatically — you choose.
  • To keep the tray clean, move Synology's icon from pinned to hidden (one-time):
# via shell.json (recommended)
python3 -c "
import json, pathlib
p = pathlib.Path.home() / '.config/omarchy/shell.json'
j = json.loads(p.read_text())
for e in j['bar']['layout']['right']:
    if e.get('id')=='omarchy.tray':
        if 'cloud-drive-ui' in e.get('pinned',[]): e['pinned'].remove('cloud-drive-ui')
        if 'cloud-drive-ui' not in e.get('hidden',[]): e.setdefault('hidden',[]).append('cloud-drive-ui')
p.write_text(json.dumps(j, indent=4))
"
omarchy-shell shell reloadConfig

Or right-click the tray chevron → Manage → move cloud-drive-ui to Hidden.

  • To keep the native icon alongside the widget, leave pinned unchanged — both can coexist. The widget never stops the daemon; it only reads its SQLite state.

Troubleshooting

  • status.py fails / panel shows Checking… — confirm ~/.SynologyDrive/data/db/sys.sqlite exists and python3 status.py prints JSON: python3 ~/.config/omarchy/plugins/io.github.tug-benson.synology-drive/status.py | jq .
  • Daemon stopped — synology-drive start (wrapper sets LD_LIBRARY_PATH=/opt/Synology/SynologyDrive/lib) or re-enable autostart in Drive settings; check ~/.SynologyDrive/log/daemon.log.
  • Unsynced locked files — e.g. ~/.config/some-app/run/lockfile.txt with syncStatus=2 (locked/permission) is expected for files held open by another process. Exclude it via Drive's selective sync if noisy.

Remove

omarchy plugin remove io.github.tug-benson.synology-drive --yes
# or
rm -rf ~/.config/omarchy/plugins/io.github.tug-benson.synology-drive
omarchy-shell shell rescanPlugins

License

MIT — see LICENSE. Synology Drive itself is under Synology's license; this plugin only reads its local DBs.