mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 22:56:12 -04:00
Nearby File Share Tray App
This folder contains the Qt/QML FileShareTray application — a system tray app for file sharing via Nearby Connections, wired to:
nearby::sharing::linux::NearbyConnectionsServiceLinux- Send mode (discovery + connect)
- Receive mode (incoming requests + accept/reject)
- Transfer status list (progress + payload status)
- Connected medium display per endpoint
- Persistent tray behavior (window close hides app to tray)
- File logging to
/tmp/nearby_qml_tray.log
Files
file_share_tray_main.cpp: Qt app bootstrap + system tray behavior.file_share_tray_controller.h/.cc: QML-facing backend wrapper around Nearby Connections.FileShareTray.qml: Top-level UI for the file share tray app.components/: Shared QML UI components used byFileShareTray.qml.resources_file_share.qrc: EmbedsFileShareTray.qmland components.
Runtime behavior
- Close button does not terminate the process; it hides to tray.
- Use tray icon menu to show/hide/quit.
- Mode
Send:- Starts discovery.
- Shows discovered endpoints.
- Lets you connect and send text payloads.
- Mode
Receive:- Starts advertising.
- Shows pending incoming connection requests.
- Lets you accept/reject incoming requests.
- Transfers are shown with endpoint, direction, status, progress, and medium.
- Logs are appended to
/tmp/nearby_qml_tray.log.
Building
This CMake app links against the installed Nearby shared library and header:
libnearby_connections_service_linux_shared.sosharing/linux/nearby_connections_qt_facade.h
Install them first (repo root):
./sharing/linux/install_nearby_connections_service.sh
Then build the app (from sharing/linux/qml_tray_app):
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DNEARBY_INSTALL_PREFIX=/usr/local
cmake --build build -j
Bundle libnearby_connections_service_linux_shared.so with the app
From sharing/linux/qml_tray_app:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$PWD/dist"
cmake --build build -j
cmake --install build
Bundle output:
dist/bin/nearby_qml_file_tray_appdist/bin/libnearby_connections_service_linux_shared.so
The app is installed with INSTALL_RPATH=$ORIGIN, so it resolves the Nearby
shared library from the same folder in the bundle.
Build a distributable .zip (includes runtime dependencies)
From sharing/linux/qml_tray_app:
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j
cpack --config build/CPackConfig.cmake -G ZIP
Output:
build/nearby_qml_tray_app-Linux-x86_64.zip
This zip is created from the CMake install tree and includes:
nearby_qml_file_tray_applibnearby_connections_service_linux_shared.so- Qt runtime libs/plugins/QML imports discovered by Qt deploy tooling