mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-15 07:06:11 -04:00
Nearby File Share Tray App
This folder contains the Qt/QML FileShareTray application — a system tray app for file sharing via Nearby Sharing, wired to:
nearby::sharing::linux::NearbySharingApi- Send mode (discover nearby share targets + send file)
- Receive mode (incoming requests + accept/reject)
- Transfer status list (progress + transfer status)
- Persistent tray behavior (window close hides app to tray)
- Process log redirection to file (
stdout/stderr)
Files
file_share_tray_main.cpp: Qt app bootstrap + system tray behavior.file_share_tray_controller.h/.cc: QML-facing backend wrapper around Nearby Sharing.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 share targets.
- Sends the selected file to a chosen target.
- Mode
Receive:- Starts advertising.
- Shows pending incoming transfer requests.
- Lets you accept/reject incoming requests.
- Transfers are shown with target, direction, status, and progress.
stdoutandstderrare redirected at startup to the configuredlogPathsetting.- Default log path is
/tmp/nearby_qml_file_tray.logwhenlogPathis unset. - If
logPathis changed from Settings, restart the app to apply redirection.
Building
This CMake app links against the installed Nearby shared library and header:
libnearby_sharing_api_shared.sosharing/linux/nearby_sharing_api.h
Install them first (repo root):
./sharing/linux/install_nearby_sharing_service.sh
Then build the app (from sharing/linux/qml_tray_app):
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DNEARBY_PREFIX=/usr/local
cmake --build build -j
Bundle libnearby_sharing_api_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_sharing_api_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_sharing_api_shared.so- Qt runtime libs/plugins/QML imports discovered by Qt deploy tooling