How zocker-160/syncthingy works
Purpose and Runtime
SyncThingy is a minimal Linux desktop wrapper around Syncthing: it launches/manages the sync daemon and exposes a system-tray indicator with access to Syncthing’s Web UI. It is primarily designed for Flatpak distribution, though CMake supports native installation when syncthing is available on PATH.
Primary executable entry point: src/main.cpp. Build, install, and packaging behavior originate in CMakeLists.txt.
Application Bootstrap and Single-Instance Control
Startup in src/main.cpp initializes the Qt application, enforces single-application behavior through the vendored/submodule-backed src/singleapplication, and establishes the tray-oriented desktop process lifecycle. A second invocation should be routed to the existing process rather than creating another daemon/controller instance.
Shared application-level constants, including identifiers and likely configuration/service values, are centralized in src/Constants.h.
Syncthing Process and Web UI Boundary
The application’s core external boundary is the Syncthing executable/service. SyncThingy does not implement file synchronization; it starts or coordinates Syncthing and opens its locally hosted Web UI using the configured URL.
Relevant boundaries:
• Application controller/bootstrap: src/main.cpp
• Shared runtime identifiers/defaults: src/Constants.h
• User-configured Web UI target: src/SettingsDialog.cpp
Syncthing configuration remains owned by Syncthing, under the Flatpak application data area described in the README.
Tray UI and User Actions
The tray indicator is the principal UI surface. Its action flow is: user selects a tray command → SyncThingy opens the Web UI, adjusts settings, or invokes service-management behavior. This keeps the app intentionally smaller than a full Syncthing management client.
The main control wiring is in src/main.cpp; settings-related actions are handled through src/SettingsDialog.h and src/SettingsDialog.cpp.
Settings and Persistent Preferences
SettingsDialog owns the user-facing configuration boundary for SyncThingy-specific preferences: autostart, icon variant, Web UI URL, notifications, and installation of a background system service.
Paths:
• src/SettingsDialog.h
• src/SettingsDialog.cpp
• src/Constants.h
For Flatpak installs, preferences are persisted under the application configuration directory, separate from Syncthing’s own configuration/state.
Background Service Installation
ServiceDialog supports generating or presenting the commands/instructions needed to install SyncThingy as a system service, aimed at Steam Deck background operation. The repository includes the service unit distributed for this purpose:
• src/ServiceDialog.cpp
• src/ServiceDialog.h
• linux_packaging/syncthingy.service
This is an integration boundary with the host’s systemd/service manager rather than an in-process scheduler.
Distribution and Desktop Integration
CMake defines the native build/install graph: CMakeLists.txt. Linux desktop integration assets provide launcher, application metadata, and system-service packaging:
• linux_packaging/SyncThingy.desktop
• linux_packaging/metainfo.xml
• linux_packaging/syncthingy.service
Qt 5 and libportal-qt5 are material runtime/build dependencies; portal support is relevant to sandboxed Flatpak desktop integration. Syncthing itself is the critical external executable and synchronization service.
Main entry points: main.cpp Application bootstrap · SettingsDialog.cpp Settings dialog · ServiceDialog.cpp Service dialog · CMakeLists.txt Build and install
Components 17
Desktop Application
Qt tray wrapper runtime.
- Application bootstrap · Initializes the tray process and wires primary actions.
src/main.cpp - Single-instance guard · Routes subsequent launches to the existing process.
src/singleapplication - Runtime constants · Defines application identifiers and shared values.
src/Constants.h - Tray actions · Provides Web UI, settings, and service-management commands.
src/main.cpp - Settings dialog · Configures autostart, icon, Web UI URL, notifications, and service installation.
src/SettingsDialog.cpp - Settings interface
src/SettingsDialog.h - SyncThingy preferences · Stored separately from Syncthing configuration in Flatpak installs.
- Service dialog · Presents installation commands for background operation.
src/ServiceDialog.cpp - Service interface
src/ServiceDialog.h
External Integration
Syncthing and host desktop boundaries.
- Syncthing daemon · Owns synchronization and its own configuration/state.
- Syncthing Web UI · Opened at the user-configured URL.
- Host service manager · Installs and runs the optional background service.
- Desktop portal · Supports sandboxed Flatpak desktop integration.
Distribution
Build and Linux desktop assets.
- Build and install · Defines native build, installation, and packaging behavior.
CMakeLists.txt - Desktop launcher
linux_packaging/SyncThingy.desktop - Application metadata
linux_packaging/metainfo.xml - Service unit · Distributed unit for background SyncThingy operation.
linux_packaging/syncthingy.service
Connections 19
- Application bootstrap → Single-instance guard: enforces
- Application bootstrap → Runtime constants: uses
- Application bootstrap → Tray actions: creates
- Application bootstrap → Syncthing daemon: launches or manages
- Tray actions → Settings dialog: opens
- Tray actions → Syncthing Web UI: opens
- Tray actions → Service dialog: opens
- Settings dialog → Settings interface: implements
- Settings dialog → SyncThingy preferences: persists
- Settings dialog → Syncthing Web UI: configures URL for
- Settings dialog → Service dialog: initiates service setup
- Service dialog → Service interface: implements
- Service dialog → Service unit: uses
- Service unit → Host service manager: installed for
- Syncthing daemon → Syncthing Web UI: hosts
- Application bootstrap → Desktop portal: integrates through
- Build and install → Desktop launcher: installs
- Build and install → Application metadata: packages
- Build and install → Service unit: distributes