Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Tray application and Dolphin/Plasma integration for Syncthing

License

NotificationsYou must be signed in to change notification settings

Martchus/syncthingtray

Repository files navigation

Syncthing Tray provides a tray icon and further platform integrations forSyncthing. Checkout thewebsite for an overview.

The following integrations are provided:

  • Tray application (using the Qt framework)
  • Context menu extension for theDolphin file manager
  • Plasmoid forKDE Plasma
  • Command-line interface
  • Qt-ish C++ library

Checkout theofficial forum thread for discussionsand announcement of new features.

This README document currently serves as the only and main documentation. So read on for details aboutthe configuration. If you are not familiar with Syncthing itself already you should also have a look attheSyncthing documentation as this README is only going to cover theSyncthing Tray integration.

Issues can be created on GitHub but please read the "Known bugs and workarounds" section in this documentbefore.

Supported platforms

Official binaries are provided for Windows (for i686, x86_64 and aarch64) and GNU/Linux (for x86_64) and can bedownload from thewebsite and therelease section on GitHub. This is only a fraction ofthe available downloads, though. I also provide further repositories for some GNU/Linux distributions. There arealso binaries/repositories provided by other distributors. For a list with links, checkout the"Download" section of this document.

Syncthing Tray is known to work under:

  • Windows 10 and 11
  • KDE Plasma
  • Openbox using lxqt/LXDE or using Tint2
  • GTK-centered desktops such as Cinnamon, GNOME and Xfce (with caveats, see remarks below)
  • COSMIC (only simple tray menu works, see remarks below)
  • Awesome
  • i3
  • macOS
  • Deepin Desktop Environment
  • Sway/Swaybar/Waybar (with caveats, see remarks below)
  • Android (still experimental and in initial development)

This doesnot mean Syncthing Tray is actively tested on all those platforms ordesktop environments.

For Plasma 5 and 6, there is in addition to the Qt Widgets based version also a "native"Plasmoid. Note that the latest version of the Plasmoid generally also requires thelatest version of Plasma 5 or 6 as no testing on earlier versions is done. Use the QtWidgets based version on other Plasma versions. Checkout the"Configuring Plasmoid" section for further details.

On GTK-centered desktops have a look at theArch Wikifor how to achieve a more native look and feel. Under GNOME one needs to installan extension for tray icon support (unlessone's distribution already provides such an extension by default).

Limitations of your system tray might affect Syncthing Tray. For instance when using the mentioned GNOMEextension the Syncthing Tray UI shown in the screenshots below is only shown bydouble-clicking the icon.If your system tray is unable to show the Syncthing Tray UI at all like on COSMIC you can still use SyncthingTray for the tray icon and basic functionality accessible via the menu.

Note that under Wayland-based desktops there will be positioning issues. The Plasmoid is not affectedby this, though.

The section "Known bugs and workarounds" below contains further informationand workarounds for certain caveats like the positioning issues under Wayland.

Features

  • Provides quick access to most frequently used features but does not intend to replace the official web-based UI
    • Check state of folders and devices
    • Check current traffic statistics
    • Display further details about folders and devices, like last file, lastscan, items out of sync, ...
    • Display ongoing downloads
    • Display Syncthing log
    • Trigger re-scan of a specific folder or all folders at once
    • Open a folder with the default file browser
    • Pause/resume a specific device or all devices at once
    • Pause/resume a specific folder
    • View recent history of changes (done locally and remotely)
  • Shows "desktop" notifications
    • The events to show notifications for can be configured
    • Uses Qt's notification support or a D-Bus notification daemon directly
  • Provides a wizard for a quick setup
  • Allows monitoring the status of the Syncthing systemd unit and to start and stop it (see section"Configuring systemd integration")
  • Provides an option to conveniently add the tray to the applications launched when the desktop environment starts
  • Can launch Syncthing automatically when started and display stdout/stderr (useful under Windows)
  • Browsing the global file tree and selecting items to add to ignore patterns.
  • Provides quick access to the official web-based UI
    • Can be opened as regular browser tab
    • Can be opened in a dedicated window utilizing either
      • Qt WebEngine/WebKit
      • the "app mode" of a Chromium-based browser (e.g. Chrome and Edge)
  • Allows switching quickly between multiple Syncthing instances
  • Also features a simple command line utilitysyncthingctl
    • Check status
    • Trigger rescan/pause/resume/restart
    • Wait for idle
    • View and modify raw configuration
    • Supports Bash completion, even for folder and device names
  • Also bundles a KIO plugin which shows the status of a Syncthing folder and allows to trigger Syncthing actionsin the Dolphin file manager
    • Rescan selected items
    • Rescan entire Syncthing folder
    • Pause/resume Syncthing folder
    • See also thescreenshots below
  • Allows building Syncthing as a library to run it in the same process as the tray/GUI
  • English and German localization

Does this launch or bundle Syncthing itself? What about my existing Syncthing installation?

Syncthing Tray doesnot launch Syncthing itself by default. There should be no interference with your existingSyncthing installation. You might consider different configurations:

  • If you're happy how Syncthing is started on your system so far just tell Syncthing Tray to connect to your currentlyrunning Syncthing instance in the settings. If you're currently starting Syncthing via systemd you might considerenabling the systemd integration in the settings (see section "Configuring systemd integration").
  • If you would like Syncthing Tray to take care of starting Syncthing for you, you can use the Syncthing launcheravailable in the settings. Note that this isnot supported when using the Plasmoid.
    • The Linux and Windows builds provided in therelease section on GitHubcome with a built-in version of Syncthing which you can consider to use. Keep in mind that automatic updates of Syncthing arenot possible this way.
    • In any case you can simply point the launcher to the binary of Syncthing (which you have to download/installseparately).
    • Checkout the "Configuring the built-in launcher" section for further details.
  • It is also possible to let Syncthing Tray connect to a Syncthing instance running on a different machine.

Note that the experimental UI tailored for mobile devices is more limited. So far it can only start a built-inversion of Syncthing or connect to an externally started Syncthing instance. It will set a custom config/datadirectory for Syncthing so any Syncthing instance launched via the mobile UI will not interfere with existing setups.

Installation and deinstallation

Checkoutthe website for obtaining the executableor package. This README also lists more options and instructions for building from sources.

If you are using one of the package manager options you should follow the usual workflow of that package manager.

Otherwise, you just have to extract the archive and launch the contained executable. Especially on Windows, pleaseread the notes on the website before filing any issues. Note that automatic updates haven't been implemented yet.To uninstall, just delete the executable again.

For further cleanup you may ensure that autostart is disabled (to avoid a dangling autostart entry). You may alsodelete the configuration files (see "Location of the configuration file"section below).

Screenshots

The screenshots are not up-to-date.

Qt Widgets based GUI under Windows 11

Qt Widgets based GUI under Windows 11

Qt Widgets based GUI under Openbox/Tint2 with dark Breeze theme

Qt Widgets based GUI under Openbox/Tint2

Plasmoid (for KDE's Plasma shell)

Light theme

Plasmoid (light theme)

Dark theme

Plasmoid (dark theme)

Icon customization dialog

Plasmoid (customized icons)

Settings dialog

Settings dialog

Web view

Web viewWeb view (dark)

Syncthing actions for Dolphin

Rescan/pause/status

General remarks on the configuration

You need to configure how Syncthing Tray should connect to Syncthing itself. The previoussection "Does this launch or bundle Syncthing itself…" mentions available options. Additionally,a wizard is shown on the first launch which can guide though the configuration for commonsetups. If you have dismissed the wizard you can still open it at any point via a button on thetop-right corner of the settings dialog.

It may be worthwhile to browse though the pages of the configuration dialog to tweak SyncthingTray to your needs, e.g. to turn off notification you may find annoying.

Location of the configuration file

The configuration file is usually located under~/.config/syncthingtray.ini on GNU/Linux andunder%appdata%\syncthingtray.ini on Windows. For other platforms and further details,checkout theQt documentation(Syncthing Tray uses the "IniFormat"). For portable installations it is also possible to placean empty file calledsyncthingtray.ini directly next to the executable.

You may remove the configuration file under the mentioned location to start from scratch.

Note that this only counts for Syncthing Tray. For Syncthing itself, checkoutits own documentation.

The Plasmoid is using the same configuration file but in addition also Plasma's configurationmanagement for settings specific to a concrete instance of the Plasmoid.

The experimental UI tailored for mobile devices is using a distinct configuration which islocated under~/.config/Martchus/Syncthing Tray on GNU/Linux and/storage/emulated/0/Android/data/io.github.martchus.syncthingtray on Android and%appdata%\Martchus\Syncthing Tray on Windows. The configuration and database of Syncthingitself are also located within this directory when Syncthing is launched via the mobile UI.

Configuring Plasmoid

The Plasmoid requires installing Syncthing Tray via distribution-specific packaging. It isnot available via the generic GNU/Linux download or the Flatpak. Checkout the relevant noteson thedownloads page foravailable options and details on package names. For further information about supported versionsof Plasma, checkout the "Supported platforms" section.

Once installed, Plasma might need to be restarted for the Plasmoid to be selectable.

The Plasmoid can be added/shown in two different ways:

  1. It can be shown as part of the system tray Plasmoid.
    • This is likely the preferred way of showing it and may also happen by default.
    • Whether the Plasmoid is shown as part of the system tray Plasmoid can be configuredin the settings of the system tray Plasmoid. You can access the settings of thesystem tray Plasmoid from its context-menu which can be opened by right-clicking onthe arrow for expanding/collapsing.
    • This way it is also possible to show the icon only in certain states by choosing toshow it only when important and selecting the states in the Plasmoid's settings.
    • Configuring the size has no effect when the Plasmoid is displayed as part of thesystem tray Plasmoid.
  2. It can be added to a panel or the desktop like any other Plasmoid.

This allows you to add multiple instances of the Plasmoid but it is recommended to pickonly one place. For that it makes also most sense to ensure the autostart of thestand-alone tray application is disabled. Otherwise you would end up having two iconsat the same time (one of the Plasmoid and one of the stand-alone application).

The Plasmoid cannot be closed via its context menu like the stand-alone application.Instead, you have to disable it in the settings of the system tray Plasmoid as explainedbefore. If you have added the Plasmoid to a panel or the desktop you can delete it likeany other Plasmoid.

In case the Plasmoid won't show up, checkout the"Troubleshooting KDE integration" section below forfurther help.

Configuring Dolphin integration

The Dolphin integration can be enabled/disabled in Dolphin's context menu settings. It willread Syncthing's API key automatically from its config file. If your Syncthing config file isnot in the default location you need to select it via the corresponding menu action.

Configuring systemd integration

The next section explains what it is good for and how to use it. If it doesn't work on yoursystem please read the subsequent sections as well before filing an issue.

Using the systemd integration

With the system configured correctly and systemd support enabled at build-time the followingfeatures are available:

  • Starting and stopping the systemd unit of Syncthing
  • Consider the unit status when connecting to the local instance to prevent connection attemptswhen Syncthing isn't running anyways
  • Detect when the system has just been resumed from standby to avoid the "Disconnect"notification in that case

However, these features are optional. To use them they must be enabled in the settings dialogfirst.

It is recommended to enable "Consider unit status …". Note that Syncthing might still not be immediatelyready to serve API requests when the systemd unit turns active. Hence it is still required to configurea re-connect interval. The re-connect interval will only be in effect while the systemd unit is active.So despite the re-connect interval there will be no connection attempts while the systemd unit isinactive. That's all the systemd integration can optimize in that regard.

Be aware that Syncthing Tray assumes by default that the systemd unit is auser unit. If you are usinga regular system-wide unit (including those started with…@username) you need to enable the"System unit" checkbox in the settings. Note that starting and stopping the system-wide Syncthingunit requires authorization (systemd can ask through PolicyKit).

Required system configuration

The communication between Syncthing Tray and systemd is implemented using systemd's D-Bus service.That means systemd's D-Bus service (which is calledorg.freedesktop.systemd1) must be running onyour D-Bus. Foruser units the session D-Bus isrelevant and for regular units (including those started with…@username) the system D-Bus is relevant.

It seems that systemd's D-Bus service is only available when D-Bus itself is started via systemd. Thatis by default the case under Arch Linux and openSUSE and likely most other modern distributions whereit is usually started via "socket activation" (e.g./usr/lib/systemd/user/dbus.socket for the sessionD-Bus).

All of this counts for the session D-Busand for the system D-Bus although the startup of the sessionD-Bus can be screwed up particularly easy. One easy way to screw it up is to start a second instance ofthe session D-Bus manually e.g. viadbus-run-session. When starting the session D-Bus this way thesystemd integration willnot work and you will likely end up with two session D-Bus processes. It isalso worth noticing that you donot need to set theDBUS_SESSION_BUS_ADDRESS variable manuallybecause the systemd filedbus.socket should take care of this.

Note that the Plasma Wayland session screwed things up in the way I've described. This has been fixed withOnly spawn dbus-run-session if there isn't a session alreadybut this change might not be available on older distributions.

Build-time configuration

The systemd integration can be explicitly enabled/disabled at compile time by adding-DSYSTEMD_SUPPORT=ON/OFF to the CMake arguments. If the systemd integration does not work be sure yourversion of Syncthing Tray has been compiled with systemd support.

Note for distributors: There will be no hard dependency to systemd in any case. Distributions supportingalternative init systems donot need to provide differently configured versions of Syncthing Tray.Disabling the systemd integration is mainly intended for systems which do not use systemd at all (e.g.Windows and MacOS).

Configuring the built-in launcher

The built-in launcher can be accessed and configured within the settings dialog. The GUI should beself-explaining.

It is recommended to enable "Consider process status …". Note that Syncthing might not be immediatelyready to serve API requests when started. Hence it is still required to configure a re-connect interval.The re-connect interval will only be in effect while the Syncthing process is running. So despite there-connect interval there will be no connection attempts while the Syncthing process is not running.

Using the command-line interface

Syncthing Tray provides two command-line interfaces:

  • The separate executablesyncthingctl allows to interact with a running instance of Syncthing totrigger certain actions like rescans, editing the Syncthing config and more. It complementsSyncthing's own command-line interface. Invokesyncthingctl --help for details.
  • The GUI/tray executablesyncthingtray also exposes a command-line interface to interact witha running instance of the GUI/tray. Invokesyncthingtray --help for details. Additional remarks:
    • If Syncthing itself is built into Syncthing Tray (like the Linux and Windows builds found inthe release-section on GitHub) then Syncthing's own command-line interface is exposed viasyncthingtray as well.
    • On Windows, you'll have to use thesyncthingtray-cli executable to see output in the terminal.
    • The experimental mobile UI can be launched on the desktop with theqt-quick-gui sub-commandwhen Syncthing Tray was built with support for it.

Configuring hotkeys

Use the same approach as for launching an arbitrary application via a hotkey in your graphicalenvironment. Make it invoke

  • syncthingtray --trigger to show the Qt Widgets based tray menu.
  • syncthingtray --webui to show the web UI.
  • syncthingctl [...] to trigger a particular action. Seesyncthingctl -h for details.

The Plasmoid can be shown via a hot-key as well by configuring one in the Plasmoid settings.

Using the Android app

The Android app requires Android 9 or later. It is mainly tested on Android 14 and 15, though.Depending on the Android version and vendor-specific limitations you might run into permissionerrors and problems with the app being stopped by the OS. For me it works well enough on athree year old average Samsung device. It probably works on most recent phones except verylow-end devices.

The Android app is still experimental. Use it with care and create backups of yourconfiguration and data before trying it. No builds are provided at this point so you have tobuild it from sources.See the section "Caveats on Android" below for further limitations.

If you're starting from scratch you can simply install and start the app. Otherwise, checkoutthe sections about migrating after reading the general remarks.

In any case, you need to give the appnotification permission andstorage permission via theapp settings of Android. The start page of the app shows "Request … permission" actions at thetop for opening the app settings if the permissions haven't been granted yet.

The app will start Syncthing automatically by default. Once Syncthing is running you can adddevices and folders as usual. The official Syncthing documentation applies. There are also manyhelp texts provided within the app itself. A few additional remarks:

  • You can select device IDs of nearby devices from the combo box when adding a new device. Sothere's usually no need to copy & paste device IDs. If you nevertheless need to scan a QR-codeI recommended to simply use your camera app to scan and copy the QR-code information and pasteit into the Syncthing Tray app. So far there is no in-app QR-code scanning.
  • You can leave the device name empty to use the name the device advertises. The device name canalso be changed later (in contrast to IDs).
  • If you have already another Syncthing app installed or you have an existing configuration fromanother device, read the next sections for testing/migrating.
  • The app does not automatically trigger media library rescans, so e.g. synchronized music mightnot show up immediately in your music app. However, you can trigger a rescan manually if needed.You can do this per folder from the context menu on the folders page.
  • It is highly recommended to enable the option "Ignore permissions" on all folders under Androidand when certain file systems are used. The app enables this option therefore by default insuch cases when a path for a new folder has been selected. You can still disable the optionagain manually.

Testing the app without migrating

To only test the app without migrating your setup you can follow the steps of this section. Notethat changes done via the appwill affect your existing Syncthing setup. You arenot workingin read-only mode or on a copy.

  1. Start the Syncthing app you are currently using (e.g. the Syncthing-Fork app) and ensure thatSyncthing itself is running as well.
  2. Lookup the listening address and API key in the options of the app you are currently using.Alternatively, do an export/backup in the app you are currently using. This might be a goodidea anyway. The backup directory will contain the fileconfig.xml which also contains thelistening address and API key. The export will also contain the HTTPs certificate which youneed if HTTPs is used.
  3. Install and start the Syncthing app from Syncthing Tray.
  4. Ensure that running Syncthing is disabled under the runtime condition settings.
  5. Configure the information from step 1 in the connection settings. When using HTTPs thecertificate is required.
  6. After applying all settings, the app UI can be used to control your existing Syncthing setup.

Migrating data from your existing app setup

You can follow these steps when switching apps on the same device. If you decided to import onlyspecific devices and folders (recommended) you can still keep using your existing app setup(keeping both apps installed in parallel).

You can also follow these steps when setting up Syncthing on a new device based on theconfiguration from another device.

  1. Start the Syncthing app you are currently using (e.g. the Syncthing-Fork app) and wait untileverything is in-sync.
  2. Do an export in the app you are currently using. This will populate a directory on the internalor external storage.
  3. Stop the Syncthing app you are currently using.
  4. Start the Syncthing app from Syncthing Tray and enable running Syncthing in the app settings.
  5. Import the config and data from step 1 in the app settings. When clicking on "Import …" youwill be prompted to select the directory you stored the export made in step 1. After selectingthe directory no changes will be made immediately; the app will show you what it found andallow you to and select what parts you want to import.
    • It is recommended to select only specific folders and devices. Then the Syncthing Tray appwill keep its current device ID. This means it will appear as a new device on other devices.So you will have to add it on other devices as a new device and accept sharing relevantfolders.
      • All devices and folders will be added in paused state. So you can still tweak settingsand ignore patterns before any scanning or syncing takes place.
      • Changing folder paths is not possible after the import anymore, though. Therefore youhave to change the paths of the folders during the import if necassary.
      • When setting up a completely new device you can simply select/create empty folderswhere you want the imported folders to be. Then Syncthing will pull the contents fromother devices once you unpause the folders/devices.
    • It is also possible to do a full import. This will import the Syncthing configuration anddatabase from the export. That means the device ID from your existing app setup will bereused. In fact, the entire Syncthing configuration and database will be reused. So thesetup will be identical to how it was before - except that now a different app is used.That also means that no changes are required on other devices.The big caveat of this methodis that you should not start the other app anymore unless you re-import the config/databasethere and make sure the app from Syncthing Tray is stopped. Reusing the Syncthing databaseis also generally considered dangerious and therefore not recommended when setting up a newdevice.

Differences between Syncthing Tray on Android and the Syncthing-Fork app

  • TheSyncthing-Fork app is generally moremature/stable. Syncthing Tray has still many caveats on Android (see next section).
  • The Syncthing-Fork app uses Android's native UI framework and therefore has a more native UIthan Syncthing Tray which uses Qt. The UI of Syncthing Tray still follows the Material styleguidelines and provides native file dialogs and notifications.
  • The UI of Syncthing Tray on Android is more in-line with the UI of Syncthing Tray on the desktopand the official web-based UI.
  • The UI of Syncthing Tray on Android allows changing all advanced settings and has built-in helptexts for many options in accordance with the official Syncthing documentation.
  • Syncthing Tray allows browsing the global file tree of a folder. Items can be selected and addedto ignore patterns.
  • The Syncthing-Fork app provides many features that haven't been implemented yet by Syncthing Tray,e.g. advanced run conditions. Syncthing Tray allows stopping Syncthing on metered networkconnections, though.
  • The Syncthing-Fork app works probably better on older or very low-budget devices.

Caveats on Android

While Syncthing Tray basically works on Android, there are still some unresolved issues:

  • A foreground service is used but Syncthing is nevertheless terminated when the activity isdestroyed. Decoupling the activity from the rest of the application requires changes in Qt. Itwill probably become feasible as of Qt 6.9.
  • All native libraries need to be extracted taking quite some space on the device. This will befixed with Qt 6.9.
  • The performance can be problematic due to the use of FUSE as of Android 11. WithFUSE Passthrough things haveimproved but especially if one has many files in one directory the performance is still bad.There is nothing one can do about it except storing the data in app's private directory. Whilethis is possible it of course doesn't cover all use cases. A file provider to be able to sharethe private app directory also still needs to be implemented.
  • Media rescans need to be triggered manually.
  • There are probably still many small UI bugs in the Qt Quick based UI used on Android.
  • The Syncthing home directory needs to be within the private directory of the app on the mainstorage. The app allows moving the home directory to other locations, e.g. the private directoryof the app on the SD card. However, Syncthing fails to open its database on other locations.
  • Not all features the official web UI offers have been implemented in the Qt Quick based UI yet.One can easily open the official web UI in a web browser, though.

Download

Checkout thedownload section on the website for an overview.Keep reading here for a more detailed list.

Source

See therelease section on GitHub.

Packages and binaries

  • Arch Linux
  • Tumbleweed, Leap, Fedora
    • RPM *.spec files and binaries are available via openSUSE Build Service
      • remarks
        • Be sure to add the repository that matches the version of your OS and to keep itin sync when upgrading.
        • The linked download pages might be incomplete, use the repositories URL for a fulllist.
        • Old packages might remain as leftovers when upgrading and need to be cleaned upmanually, e.g.zypper rm libsyncthingconnector1_1_20 libsyncthingmodel1_1_20 libsyncthingwidgets1_1_20.
      • latest releases:download page,repositories URL,project page
      • Git master:download page,repositories URL,project page
    • available split packages
      • syncthingtray/syncthingtray-qt6: Qt-widgets based GUI
      • syncthingplasmoid/syncthingplasmoid-qt6: applet/plasmoid for Plasma desktop
      • syncthingfileitemaction/syncthingfileitemaction-qt6: Dolphin/KIO integration
      • syncthingctl/syncthingctl-qt6: command-line interface
  • Debian ≥12 "bookworm" and its derivatives (Ubuntu, Pop!_OS, etc, but not Neon)
    • sudo apt install syncthingtray-kde-plasma if using KDE Plasma; otherwise,sudo apt install syncthingtray.
    • Installation from a Software Centre such asGNOME Software orDiscover should be possible as well.
  • Exherbo
    • packages for my other project "Tag Editor" and dependencies could serve as a base and are providedbythe platypus repository
  • Gentoo
  • NixOS
    • the package syncthingtray is available from the official repositories
  • Void Linux
    • available as split packages from theofficial repositories:
      • syncthingtray: GUI and command-line interface
      • syncthingtray-plasma: applet/plasmoid for Plasma desktop
      • syncthingtray-dolphin: Dolphin/KIO integration
  • Other GNU/Linux systems
    • for generic, self-contained binaries checkout therelease section on GitHub
      • Requires glibc>=2.26, OpenGL and libX11
        • openSUSE Leap 15, Fedora 27, Debian 10 and Ubuntu 18.04 are recent enough (be surethe packagelibopengl0 is installed on Debian/Ubuntu)
      • Supports X11 and Wayland (set the environment variableQT_QPA_PLATFORM=xcb to disablenative Wayland support if it does not work on your system)
      • Binaries are signed with the GPG keyB9E36A7275FC61B464B67907E06FE8F53CDC6A4C.
    • a Flatpak is hosted onFlathub
  • Windows
    • for binaries checkout therelease section on GitHub
      • Windows SmartScreen will likely block the execution (you'll get a window saying "Windows protected your PC");right click on the executable, select properties and tick the checkbox to allow the execution
      • Antivirus software oftenwrongly considers the executable harmful. This is a known problem. Please don't createissues about it.
      • The Qt 6 based version is stable and preferable but only supports Windows 10 version 1809 and newer.
      • The Qt 5 based version should still work on older versions down to Windows 7 although this is not regularly checked.
        • On Windows 7 the bundled Go/Syncthing will nevertheless be too new; use a version of Go/Syncthing that isolderthan 1.21/1.27.0 instead.
      • The Universal CRT needs to beinstalled.
      • Binaries are signed with the GPG keyB9E36A7275FC61B464B67907E06FE8F53CDC6A4C.
    • or, using Winget, typewinget install Martchus.syncthingtray in a Command Prompt window.
    • or, usingScoop, typescoop bucket add extras & scoop install extras/syncthingtray.
    • or, via thisChocolatey package, typechoco install syncthingtray.
    • for mingw-w64 PKGBUILDs checkoutmy GitHub repository
  • FreeBSD
  • Mac OS X/macOS
    • the package syncthingtray is available fromMacPorts

Build instructions

The application depends onc++utilities,qtutilities andqtforkawesome and is built the same way as these libraries.For basic instructions and platform-specific details checkout the README file ofc++utilities.

To avoid building c++utilities/qtutilities/qtforkawesome separately, follow the instructions under"Building this straight". There's also documentation aboutvarious build variables whichcan be passed to CMake to influence the build.

Further dependencies

The following Qt modules are required (only the latest Qt 5 and Qt 6 version tested): Qt Core, Qt Concurrent,Qt Network, Qt D-Bus, Qt Gui, Qt Widgets, Qt Svg, Qt WebEngineWidgets/WebKitWidgets

It is recommended to use at least Qt 5.14 to avoid limitations in previous versions (see"Known bugs" section).

The built-in web view and therefore the modules WebEngineWidgets/WebKitWidgets are optional (seesection "Select Qt module for web view and JavaScript").

The Qt Quick UI needs at least Qt 6.8 and also additional Qt modules found in the Qt Declarative repository.It also contains experimental code for a built-in web view which uses the Qt WebView module. This is optionaland not used at this point.

To build the plugin for Dolphin integration KIO is also required. To skip building the plugin,add-DNO_FILE_ITEM_ACTION_PLUGIN:BOOL=ON to the CMake arguments.

To build the Plasmoid for the Plasma desktop, the Qt module QML and the KDE Frameworks module Plasma arerequired as well. Additionally, the Plasmoid requires the latest Qt version (5.15) for certain Qt Quick features.To skip building the Plasmoid, add-DNO_PLASMOID:BOOL=ON to the CMake arguments.

To specify the major Qt version to use, setQT_PACKAGE_PREFIX (e.g. add-DQT_PACKAGE_PREFIX:STRING=Qt6to the CMake arguments). There's alsoKF_PACKAGE_PREFIX for KDE dependencies. Note that KDE integrationsalways require the same major Qt version as your KDE installation uses.


The following Boost libraries are required:Boost.Asio,Boost.Process,Boost.Filesystem

The launcher uses these libraries by default to handle sub processes correctly (and avoid leftover processes).Add-DUSE_BOOST_PROCESS:BOOL:OFF to the CMake arguments to get rid of the dependency to Boost libraries.This disables handling sub processes andQProcess (from Qt Core) is used instead.


To build Syncthing itself as a library Go is required and Syncthing needs to be checked out as a Git submodule.Checkout thedocumentation of Syncthing itself fordetails.

Sometimes it can be useful to use a different version of Go then what is provided by the packaging one wouldnormally use. To download and install a different version of Go intoGOPATH one can invoke the followingcommand:

go install golang.org/dl/go1.22.11@latest && $GOPATH/src/go/bin/go1.22.11 download`

Checkout therelease history of Go for available versions.

Then the version can be used by adding-DGO_BIN=$GOPATH/bin/go1.22.11 to the CMake arguments. It is notnecassary to clean an existing build directly. All relevant parts will be re-built as necassary with thenew version.


It is also possible to build only the CLI (syncthingctl) by adding-DNO_MODEL:BOOL=ON and-DNO_FILE_ITEM_ACTION_PLUGIN:BOOL=ON to the CMake arguments. Then only the Qt modulescore,network anddbus are required.


To get rid of systemd support, add-DENABLE_SYSTEMD_SUPPORT_BY_DEFAULT:BOOL=OFF to the CMake arguments.In this case the Qt moduledbus is not required anymore. Note that there is no hard dependencyto systemd in any case.


Building the testsuite requires CppUnit and Syncthing itself. Tests will spawn (and eventually terminate)a test instance of Syncthing that does not affect a possibly existing Syncthing setup on the build host.

Building this straight

  1. Install (preferably the latest version of) the GCC toolchain or Clang, the required Qt modules,iconv, CMake and Ninja.
  2. Get the sources. For the latest version from Git clone the following repositories:
    cd "$SOURCES"export MSYS=winsymlinks:nativestrict # only required when using MSYS2git clone -c core.symlinks=true https://github.com/Martchus/cpp-utilities.git c++utilitiesgit clone -c core.symlinks=true https://github.com/Martchus/qtutilities.gitgit clone -c core.symlinks=true https://github.com/Martchus/qtforkawesome.gitgit clone -c core.symlinks=true https://github.com/ForkAwesome/Fork-Awesome.git forkawesomegit clone -c core.symlinks=true https://github.com/Martchus/syncthingtray.gitgit clone -c core.symlinks=true https://github.com/Martchus/subdirs.git
    Note thatcore.symlinks=true is only required under Windows to handle symlinks correctly. This requires arecent Git version and a filesystem which supports symlinks (NTFS works). Additionally, you need toenable Windows Developer Mode.If you run into "not found" errors on symlink creation usegit reset --hard within the repository tofix this.
  3. Configure the build
    cd "$BUILD_DIR"cmake \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX="/install/prefix" \ -DFORK_AWESOME_FONT_FILE="$SOURCES/forkawesome/fonts/forkawesome-webfont.woff2" \ -DFORK_AWESOME_ICON_DEFINITIONS="$SOURCES/forkawesome/src/icons/icons.yml" \ "$SOURCES/subdirs/syncthingtray"
    • Replace/install/prefix with the directory where you want to install.
    • Checkout the "Providing the font file"section of qtforkawesome's README for details regarding theForkAwesome-related parameters.
  4. Build and install everything in one step:
    cd "$BUILD_DIR"ninja install
    • If the install directory is not writable, donot conduct the build as root. Instead, setDESTDIR to awritable location (e.g.DESTDIR="temporary/install/dir" ninja install) and move the files from there tothe desired location afterwards.

Select Qt module for web view and JavaScript

  • Add-DWEBVIEW_PROVIDER:STRING=webkit/webengine/none to the CMake arguments to use either Qt WebKit (works with'revived' version as well), Qt WebEngine or no web view at all. If no web view is used, the Syncthing web UI isopened in the default web browser. Otherwise the user can choose between the built-in web view and the web browser.Note that this is only about the Qt Widgets based UI. The Qt Quick based UI uses Qt WebView if available.
  • Add-DJS_PROVIDER:STRING=script/qml/none to the CMake arguments to use either Qt Script, Qt QML or no JavaScriptengine at all. If no JavaScript engine is used, the CLI does not support scripting configuration changes.

Troubleshooting KDE integration

All KDE integrations are provided for KDE 5 and 6. The Qt version you have built Syncthing Tray againstmust match the KDE version you want to build the integrations for.

If the Dolphin integration or the Plasmoid does not work, check whether the files for those componentshave been installed in the right directories.

For instance, under Tumbleweed it looks like this for the Plasmoid:

/usr/lib64/qt5/plugins/plasma/applets/libsyncthingplasmoid.so/usr/share/kservices5/plasma-applet-martchus.syncthingplasmoid.desktop/usr/share/plasma/plasmoids/martchus.syncthingplasmoid/contents/ui/*.qml/usr/share/plasma/plasmoids/martchus.syncthingplasmoid/metadata.desktop/usr/share/plasma/plasmoids/martchus.syncthingplasmoid/metadata.json

The files for the Dolphin integration look like this under Tumbleweed:

/usr/lib64/qt5/plugins/libsyncthingfileitemaction.so/usr/share/kservices5/syncthingfileitemaction.desktop

These examples were for KDE 5. It looks a bit different for KDE 6. Checkout my Arch Linux andopenSUSE packaging for further examples.

The directory where the*.so file needs to be installed to, seems to differ from distribution todistribution. The right directory for your distribution can be queried using qmake using, e.g.qmake-qt5 -query QT_INSTALL_PLUGINS orqmake6 -query QT_INSTALL_PLUGINS depending on the Qtversion. In doubt, just look where other Qt plugins are stored.

The build system is able to do that query automatically. In case this does not work, it is alsopossible to specify the directory manually, e.g. for Tumbleweed one would add-DQT_PLUGIN_DIR=/usr/lib64/qt6/plugins to the CMake arguments.


Also be sure that the version of the Plasma framework the Plasmoid was built against isnot newerthan the version actually installed on the system. This can happen if repositories are misconfigured,e.g. when using Fedora 39 but adding the Fedora 40 repo.


If the Plasmoid still won't load, checkout the log ofplasmashell/plasmoidviewer/plasmawindowed.Also consider using strace to find out at which paths the shell is looking for*.desktop and*.so files.

For a development setup of the KDE integration, continue reading the subsequent section.

Contributing, developing, debugging

Translations

Currently translations for English and German are available. Qt's built-in localization/translationframework is used under the hood.

Note thatsyncthingctl has not been internationalized yet so it supports only English.

Add a new locale

Translations for further locales can be added quite easily:

  1. Append a new translation file for the desired locale to theTS_FILES listinconnector/CMakeLists.txt,model/CMakeLists.txt,widgets/CMakeLists.txt,fileitemactionplugin/CMakeLists.txt,plasmoid/CMakeLists.txt andtray/CMakeLists.txt.
  2. Configure a new build, e.g. follow steps underBuilding this straight.
  3. Conduct a full build or generate only translation files via thetranslations target.
  4. New translation files should have been created by the build system underconnector/translations,model/translations,widgets/translations,fileitemactionplugin/translations,plasmoid/translations andtray/translations and thetranslations folder ofqtutilities.
  5. Open the files with Qt Linguist to add translations. Qt Linguist is part oftheQt Tools repository and its usageiswell documented.

Extend/update existing translations

  • For English, update the corresponding string literals within the source code.
  • If necassary, sync the translation files with the source code like in step2./3. of"Add a new locale". Check that no translations have been lost (except ones which are nolonger required of course).
  • Change the strings within the translation files found within thetranslationsdirectories like in step4./5. of "Add a new locale".

Remarks

  • Syncthing Tray displays also text fromqtutilities.Hence it makes sense adding translations there as well (following the same procedure).
  • The CLIsyncthingctl currently does not support translations.

Using backend libraries

The contained backend libraries (which provide connecting to Syncthing, data models and more) are written for internaluse within the components contained by this repository.

Hence those libraries donot provide a stable ABI/API. If you like touse them to develop Syncthing integration or tooling with Qt and C++, it makes most sense to contribute it as an additional componentdirectly to this repository. Then I will be able to take it into account when changing the API.

KDE integration

Since the Dolphin integration and the Plasmoid are plugins, testing and debugging requires a few extra steps.SeeTesting and debugging Dolphin/KIO plugin with Qt CreatorandTesting and debugging Plasmoid with Qt Creator.

Logging

It is possible to turn on logging of the underlying library by setting environment variables:

  • LIB_SYNCTHING_CONNECTOR_LOG_ALL: log everything mentioned in points below
  • LIB_SYNCTHING_CONNECTOR_LOG_API_CALLS: log calls to Syncthing's REST-API
  • LIB_SYNCTHING_CONNECTOR_LOG_API_REPLIES: log replies from Syncthing's REST-API (except events)
  • LIB_SYNCTHING_CONNECTOR_LOG_EVENTS: log events emitted by Syncthing's events REST-API endpoint
  • LIB_SYNCTHING_CONNECTOR_LOG_DIRS_OR_DEVS_RESETTED: log when folders/devices are internally reset
  • LIB_SYNCTHING_CONNECTOR_LOG_NOTIFICATIONS: log computed high-level notifications/events
  • SYNCTHINGTRAY_LOG_JS_CONSOLE: log message from the JavaScript console of the built-in web view

Useful environment variables for development

  • QT_QPA_PLATFORM: set tooffscreen to disable graphical output, e.g. to run tests in headlessenvironment
  • QT_QPA_PLATFORMTHEME: the platform theme to use (e.g.gtk3) which influences file dialogs andother parts of the UI where Qt can make use of native APIs
  • QSG_RHI_BACKEND: set the underlying graphics API used by the Qt Quick GUI, checkout theQt documentationfor details
  • QT_QUICK_CONTROLS_STYLE: the style to use in the Qt Quick GUI, checkout theQt documentation for available options
  • QT_QUICK_CONTROLS_MATERIAL_THEME/QT_QUICK_CONTROLS_UNIVERSAL_THEME: the theme to use in the QtQuick GUI, the variable and options depend on the style being used
  • LIB_SYNCTHING_CONNECTOR_SYNCTHING_CONFIG_DIR: override the path where Syncthing Tray's backend expectsSyncthing'sconfig.xml file to be in
  • SYNCTHINGTRAY_FAKE_FIRST_LAUNCH: assume Syncthing Tray (or the Plasmoid) has been launched for thefirst time
  • SYNCTHINGTRAY_ENABLE_WIP_FEATURES: enable work-in-progress/experimental features
  • SYNCTHINGTRAY_QML_MAIN_PATH: specifies the Qt Quick GUI entry point to use externally provided QMLcode, e.g. set to something likeG:\projects\main\syncthingtray\tray\gui\qml\Main.qml; useful tohot-reload the Qt Quick GUI with QML code changes with F5 without recompiling and relaunching theapplication
  • SYNCTHING_PATH: override the path of Syncthing's executable when running tests
  • SYNCTHING_PORT: override the port of the Syncthing test instance spawned when running tests
  • SYNCTHINGTRAY_SYSTEMD_USER_UNIT: override the name of the systemd user-unit checked by the wizard'ssetup detection
  • SYNCTHINGTRAY_CHROMIUM_BASED_BROWSER: override the path of the Chromium-based browser to openSyncthing in app mode
  • LIB_SYNCTHING_CONNECTOR_USE_DEPRECATED_ROUTES: change whether to use deprecated routes (enabled bydefault for compatibility with older Syncthing versions, set to0 to change the behavior)

Known bugs and workarounds

The following bugs are caused by dependencies or limitations of certainplatforms. For bugs of Syncthing Tray itself, checkout the issues on GitHub.

Workaround positioning issues under Wayland

The Qt Widgets based version basically works under Wayland but there arepositioning issues and the settings regarding positioning have no effect (see"List of bugs" section below). One can workaround this limitation by telling thewindow manager how to place the window, e.g. under Sway one could add aconfiguration like this:

for_window [title="^Syncthing Tray( \(.*\))?$"] floating enable, border none, resize set 450 400, move position 916 0

Alternatively, one can also configure Syncthing Tray to use a normal window inthe appearance settings. That doesn't fix the positioning issue but then itlooks just like a normal application so not being positioned in the tray area isless problematic.

You can also select the window type "None". This disables Syncthing Tray's own UIcompletely and instead opens Syncthing directly when the tray icon is clicked.

Tweak GUI settings for dark mode under Windows

The dark mode introduced in Windows 10 does not affect traditional desktopapplications like Syncthing Tray. As of version 6.7 the underlying toolkit Qtnevertheless provides a style specifically for Windows 11 that supports dark mode.So as of Qt 6.7 the dark mode should work out of the box on Windows 11. Otherwiseyou can select the widgets style "Fusion" under "Qt/Appearance". Then SyncthingTray will no longer use native styling of traditional desktop apps and follow thedark mode setting (asQt 6.5 added dark mode support).

It is also recommended to apply some further tweaks:

  • Ensure an icon theme that looks good on dark backgrounds is selected. The Windowsbuilds provided on GitHub bundle a version of Breeze for light and dark themes. Bydefault the version matching the current color palette is selected automatically.If you had an icon theme configured explicitly, you may need to manually select adifferent icon theme in the settings under "Qt/Appearance" when enabling dark mode.
  • To make Syncthing icons fit better with the dark color palette, configure theircolors in Syncthing Tray's settings under "Tray/UI icons" and "Tray/Systemicons". The "Use preset" button allows to select pre-defined colors suitable fora dark color palette.

When using an older Qt version than 6.5 you will also have to resort to more manualtweaking:

  • To enable dark colors for Syncthing Tray's UI elements, configure a dark colorpalette in Syncthing Tray's settings under "Qt/Appearance". You can download andloaddark-palette.inias a base and tweak the colors to your liking.
  • As of Qt 6.4, dark window borders will be enabled automatically if Windows'dark mode setting is enabled and a dark color palette has been selected asmentioned in the previous step.To enable dark window borders in earlier Qt versions, set the environmentvariableQT_QPA_PLATFORM towindows:darkmode=1 or create a file calledqt.conf next tosyncthingtray.exe with the contents:
    [Platforms]WindowsArguments = darkmode=1

When using Syncthing Tray 1.3.x or older, you need to restart Syncthing Tray forthese changes to have any effect. It is not sufficient to close the last window;the process needs to be restarted.

Note that one can alternatively also enable Windows' "High contrast" setting whichseems to bring back the traditional theming/coloring (which has normally beenremoved).Unfortunately it doesn't look very nice overall. Checkouthttps://github.com/tomasz1986/classic2000 to see how Windows looks like with highcontrast applied, or if you're in need for themes that look at least nicer thanwhat's shipped with Windows.

DPI awareness under Windows

Syncthing Tray supportsPMv2out of the box as of Qt 6. You may tweak settings according to theQt documentation.

Workaround broken High-DPI scaling of Plasmoid under X11

This problemhas been resolved somake sure you are using an up-to-date Plasma version. Otherwise, setting the environmentvariablePLASMA_USE_QT_SCALING=1 might help.

List of bugs

  • Wayland limitations
    • The tray menu can not be positioned correctly under Wayland because the protocol does not allow setting window positions fromthe client-side (at least I don't know a way to do it). This issue can not be fixed unless Wayland provides an API to set thewindow position to specific coordinates or a system tray icon.See discussion onfreedesktop.org.Note that the Plasmoid is not affected by this limitation.
    • While the tray menu is shown its entry is shown in the taskbar. Not sure whether there is a way to avoid this.
  • Qt limitations and bugs
    • Qt < 6.7:
      • The native style does not look good under Windows 11. Therefore the style "Fusion" is used instead by default.
    • Qt < 6.5:
    • Qt < 5.14
    • Qt < 5.9:
      • Pausing/resuming folders and devices doesn't work when using scan-intervals with a lot of zeros because ofSyncthing bugsyncthing/syncthing#4001. This has already been fixed on the Qt-side withhttps://codereview.qt-project.org/#/c/187069/. However, the fix is only available in Qt 5.9 and above.
      • Redirections cannot be followed (e.g. from HTTP to HTTPS) becauseQNetworkRequest::RedirectPolicyAttribute andQNetworkRequest::NoLessSafeRedirectPolicy are not available yet.
    • any Qt version:
      • The tray disconnects from the local instance when the network connection goes down. The network connection must be restoredor the tray restarted to be able to connect to local Syncthing again. This is caused by Qt bughttps://bugreports.qt.io/browse/QTBUG-60949.
  • KDE limitations
  • Systemd integration

Legal information

Copyright notice and license

Copyright © 2016-2025 Marius Kittler

All code - unless stated otherwise in a comment on top of the file - is licensed underGPL-2-or-later. This doesnot applyto code contained in Git repositories included as Git submodule (which contain their own README and licensing information).

Attribution for 3rd party content

Syncthing Tray contains icons from various sources:

None of these icons have been (intentionally) modified so no copyright for modifications is asserted.

Some of the code is based on code from other open source projects:

  • Code intray/gui/quick/quickicon.cpp and the corresponding header file originates fromKirigami. The comments at the beginning of those files state the originalauthors/contributors.
  • Parts oftray/android/src/io/github/martchus/syncthingtray/Util.java are based oncom.nutomic.syncthingandroid.util.
  • The icon filesic_stat_notify* undertray/android/res andtray/resources are taken fromsyncthing-android.
  • Many of the descriptions used in the Qt Quick GUI are taken fromSyncthingandits documentation.
  • Theuncamel function used in the Qt Quick GUI is taken fromSyncthing.

The original code has been modified. Copyright as mentioned in the previous section applies to modifications.


[8]ページ先頭

©2009-2025 Movatter.jp