Skip to content

Linux + iPhone Continuity / iMessage / SMS

feat: flatpak

Zack Bartelfe609ecb0827
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index f6a24d7..d15cabc 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -94,8 +94,29 @@ jobs:
path: build/appimage/*.AppImage
if-no-files-found: error
+ flatpak:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
+
+ - name: dependencies
+ run: |
+ sudo apt-get update
+ sudo apt-get install -y --no-install-recommends flatpak flatpak-builder ca-certificates
+
+ - name: build
+ run: ./packaging/flatpak/build.sh
+
+ - uses: actions/upload-artifact@v4
+ with:
+ name: flatpak
+ path: build/flatpak/*.flatpak
+ if-no-files-found: error
+
release:
- needs: [package, appimage]
+ needs: [package, appimage, flatpak]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
diff --git a/README.md b/README.md
index 953d56a..18425cc 100644
--- a/README.md
+++ b/README.md
@@ -78,6 +78,12 @@ The extension communicates with `tetherd` via native messaging. This allows user
### Mail Extension
- Thunderbird: [Tether Mail Extension](https://addons.thunderbird.net/en-US/thunderbird/addon/tether-mail-extension/)
+### Arch Linux
+
+```bash
+yay -S tether
+```
+
### AppImage
One file, no install, for distros without a package and for immutable systems.
@@ -94,12 +100,21 @@ chmod +x tether-*-x86_64.AppImage
Requires glibc 2.38 and libstdc++ from GCC 13 (Fedora 39+, Ubuntu 23.10+, Debian 13+, Arch, not Debian 12).
`--install-extension-host` writes the native messaging manifests into your browser and mail client directories
-### Arch Linux
+### Flatpak
+
+Download `tether-<version>.flatpak` from the
+[releases page](https://github.com/zackb/tether/releases) if you're into that, then:
```bash
-yay -S tether
+flatpak install ./tether-*.flatpak
+flatpak run com.tether.desktop # the GTK app
+flatpak run --command=tether com.tether.desktop --bt-setup # the CLI
+flatpak run --command=tether com.tether.desktop --install-extension-host
```
+Clipboard sync will most likely not work as it is a privileged protocol (`data-control`).
+Use the AppImage instead if you want clipboard sync.
+
### Nix
#### Build from source
diff --git a/packaging/flatpak/build.sh b/packaging/flatpak/build.sh
new file mode 100755
index 0000000..24ee6b9
--- /dev/null
+++ b/packaging/flatpak/build.sh
@@ -0,0 +1,45 @@
+#!/bin/bash
+# Build a single-file Flatpak bundle of tether.
+# Needs flatpak-builder or org.flatpak.Builder,
+# and the org.gnome.Platform//49 runtime and matching SDK.
+
+set -euo pipefail
+
+ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)
+MANIFEST=$ROOT/packaging/flatpak/com.tether.desktop.yml
+BUILD_DIR=${BUILD_DIR:-$ROOT/build/flatpak}
+APP_ID=com.tether.desktop
+RUNTIME_VERSION=49
+
+flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
+flatpak install -y --user --noninteractive flathub \
+ "org.gnome.Platform//$RUNTIME_VERSION" "org.gnome.Sdk//$RUNTIME_VERSION"
+
+# flatpak install exits 0 even when it resolved nothing, so check rather than trust.
+for ref in org.gnome.Platform org.gnome.Sdk; do
+ flatpak info "$ref//$RUNTIME_VERSION" >/dev/null 2>&1 ||
+ { echo "$ref//$RUNTIME_VERSION is not installed" >&2; exit 1; }
+done
+
+# The distro package if there is one, otherwise the builder ships as a flatpak.
+if command -v flatpak-builder >/dev/null; then
+ BUILDER=(flatpak-builder)
+else
+ flatpak install -y --user --noninteractive flathub org.flatpak.Builder
+ flatpak info org.flatpak.Builder >/dev/null 2>&1 ||
+ { echo "org.flatpak.Builder is not installed" >&2; exit 1; }
+ BUILDER=(flatpak run org.flatpak.Builder)
+fi
+
+mkdir -p "$BUILD_DIR"
+"${BUILDER[@]}" --force-clean --user --install-deps-from=flathub \
+ --repo="$BUILD_DIR/repo" \
+ "$BUILD_DIR/build" "$MANIFEST"
+
+VERSION=$(git -C "$ROOT" describe --tags --always --dirty 2>/dev/null | sed 's/^v//')
+VERSION=${VERSION:-unknown}
+OUTPUT=$BUILD_DIR/tether-$VERSION.flatpak
+
+flatpak build-bundle "$BUILD_DIR/repo" "$OUTPUT" "$APP_ID" --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
+
+echo "==> $OUTPUT"
diff --git a/packaging/flatpak/com.tether.desktop.yml b/packaging/flatpak/com.tether.desktop.yml
new file mode 100644
index 0000000..f482801
--- /dev/null
+++ b/packaging/flatpak/com.tether.desktop.yml
@@ -0,0 +1,76 @@
+# Flatpak manifest for tether.
+
+app-id: com.tether.desktop
+runtime: org.gnome.Platform
+runtime-version: "49"
+sdk: org.gnome.Sdk
+command: tether-gtk
+rename-desktop-file: tether-gtk.desktop
+rename-icon: tether
+
+finish-args:
+ - --share=network # mDNS discovery and the mTLS listener
+ - --socket=wayland
+ - --system-talk-name=org.bluez # adapter, devices, GATT for ANCS
+ - --system-talk-name=org.freedesktop.Avahi # Bonjour, so the iPhone finds this PC
+ - --talk-name=org.bluez.obex # MAP messages and PBAP contacts
+ - --talk-name=org.freedesktop.Notifications
+ - --filesystem=xdg-download # where received files go
+ - --filesystem=xdg-run/tether:create
+ - --allow=bluetooth
+ - --filesystem=~/.mozilla/native-messaging-hosts:create
+ - --filesystem=~/.thunderbird/native-messaging-hosts:create
+ - --filesystem=~/.betterbird/native-messaging-hosts:create
+ - --filesystem=~/.config/chromium/NativeMessagingHosts:create
+ - --filesystem=~/.config/google-chrome/NativeMessagingHosts:create
+ - --filesystem=~/.var/app/org.mozilla.firefox/.mozilla/native-messaging-hosts:create
+ - --filesystem=~/.var/app/org.mozilla.Thunderbird/.thunderbird/native-messaging-hosts:create
+ - --filesystem=~/.var/app/eu.betterbird.Betterbird/.betterbird/native-messaging-hosts:create
+ - --filesystem=~/.var/app/org.chromium.Chromium/config/chromium/NativeMessagingHosts:create
+ - --filesystem=~/.var/app/com.google.Chrome/config/google-chrome/NativeMessagingHosts:create
+ - --filesystem=~/.local/bin:create
+
+modules:
+ - name: gtk-layer-shell
+ buildsystem: meson
+ config-opts:
+ - -Dexamples=false
+ - -Ddocs=false
+ - -Dtests=false
+ sources:
+ - type: archive
+ url: https://github.com/wmww/gtk-layer-shell/archive/refs/tags/v0.10.1.tar.gz
+ sha256: 88c3a3e0a5300532f3d368d5df64838a87f1fb85273f22d41df0a6b8d0ec59c6
+
+ - name: bluez-btmgmt
+ buildsystem: autotools
+ config-opts:
+ - --disable-systemd
+ - --disable-udev
+ - --disable-cups
+ - --disable-obex
+ - --disable-monitor
+ - --disable-manpages
+ - --enable-tools
+ - --enable-library
+ no-make-install: true
+ post-install:
+ - install -Dm755 tools/btmgmt /app/bin/btmgmt
+ sources:
+ - type: archive
+ url: https://www.kernel.org/pub/linux/bluetooth/bluez-5.87.tar.xz
+ sha256: 26bdcf2cebd7310c6f598850606b037ef0c515fe6608ebc54d22c50c4c32b35f
+
+ - name: tether
+ buildsystem: cmake-ninja
+ config-opts:
+ - -DCMAKE_BUILD_TYPE=Release
+ - -DTETHER_BUILD_EXTENSIONS=OFF
+ build-options:
+ build-args:
+ - --share=network
+ post-install:
+ - rm -rf /app/share/icons/hicolor/1024x1024
+ sources:
+ - type: dir
+ path: ../..
diff --git a/po/cs.po b/po/cs.po
index c2a0fc7..e0347e4 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Czech\n"
@@ -1080,6 +1080,14 @@ msgstr "Složky nelze odeslat — přetáhněte místo nich soubory."
msgid "Clipboard, files, and OTP are connected."
msgstr "Schránka, soubory a OTP jsou připojeny."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"Soubory a OTP jsou připojeny. Tento kompozitor nedává Tetheru přístup ke "
+"schránce, takže synchronizace schránky je vypnutá."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/de.po b/po/de.po
index c217ed3..4b5e16b 100644
--- a/po/de.po
+++ b/po/de.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: German\n"
@@ -1105,6 +1105,14 @@ msgstr ""
msgid "Clipboard, files, and OTP are connected."
msgstr "Zwischenablage, Dateien und OTP sind verbunden."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"Dateien und OTP sind verbunden. Dieser Compositor gibt Tether keinen Zugriff "
+"auf die Zwischenablage, daher ist die Zwischenablage-Synchronisierung aus."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/es.po b/po/es.po
index 200efae..2d8fcfb 100644
--- a/po/es.po
+++ b/po/es.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: Spanish\n"
@@ -1097,6 +1097,15 @@ msgstr "No se pueden enviar carpetas — suelte archivos en su lugar."
msgid "Clipboard, files, and OTP are connected."
msgstr "El portapapeles, los archivos y los OTP están conectados."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"Los archivos y el OTP están conectados. Este compositor no da a Tether "
+"acceso al portapapeles, así que la sincronización del portapapeles está "
+"desactivada."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/fr.po b/po/fr.po
index ab00d17..c327d4d 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: French\n"
@@ -1104,6 +1104,15 @@ msgstr ""
msgid "Clipboard, files, and OTP are connected."
msgstr "Le presse-papiers, les fichiers et les OTP sont connectés."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"Les fichiers et l'OTP sont connectés. Ce compositeur ne donne pas à Tether "
+"l'accès au presse-papiers, la synchronisation du presse-papiers est donc "
+"désactivée."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/it.po b/po/it.po
index 1b2731d..139bf1f 100644
--- a/po/it.po
+++ b/po/it.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Italian\n"
@@ -1095,6 +1095,14 @@ msgstr "Le cartelle non possono essere inviate — trascina dei file."
msgid "Clipboard, files, and OTP are connected."
msgstr "Appunti, file e OTP sono connessi."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"File e OTP sono connessi. Questo compositor non dà a Tether l'accesso agli "
+"appunti, quindi la sincronizzazione degli appunti è disattivata."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/ja.po b/po/ja.po
index 0edd15b..4e16dc5 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Japanese\n"
@@ -1065,6 +1065,14 @@ msgstr "フォルダは送信できません。ファイルをドロップして
msgid "Clipboard, files, and OTP are connected."
msgstr "クリップボード、ファイル、OTP が接続されています。"
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"ファイルと OTP は接続されています。このコンポジターは Tether にクリップボード"
+"へのアクセスを許可しないため、クリップボード同期はオフです。"
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/ko.po b/po/ko.po
index 1aa125b..bf4b58a 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Korean\n"
@@ -1057,6 +1057,14 @@ msgstr "폴더는 보낼 수 없습니다. 대신 파일을 놓으십시오."
msgid "Clipboard, files, and OTP are connected."
msgstr "클립보드, 파일, OTP가 연결되었습니다."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"파일과 OTP는 연결되어 있습니다. 이 컴포지터는 Tether에 클립보드 접근을 허용하"
+"지 않으므로 클립보드 동기화가 꺼져 있습니다."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/nl.po b/po/nl.po
index 8188e87..ce00812 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Dutch\n"
@@ -1090,6 +1090,14 @@ msgstr ""
msgid "Clipboard, files, and OTP are connected."
msgstr "Klembord, bestanden en OTP zijn verbonden."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"Bestanden en OTP zijn verbonden. Deze compositor geeft Tether geen toegang "
+"tot het klembord, dus klembordsynchronisatie staat uit."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/pl.po b/po/pl.po
index 47b063d..db87457 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Polish\n"
@@ -1091,6 +1091,14 @@ msgstr "Folderów nie można wysyłać — przeciągnij zamiast nich pliki."
msgid "Clipboard, files, and OTP are connected."
msgstr "Schowek, pliki i OTP są połączone."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"Pliki i OTP są połączone. Ten kompozytor nie daje Tetherowi dostępu do "
+"schowka, więc synchronizacja schowka jest wyłączona."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/pt_BR.po b/po/pt_BR.po
index ac23dd7..21896d3 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Brazilian Portuguese\n"
@@ -1089,6 +1089,15 @@ msgstr "Pastas não podem ser enviadas — solte arquivos em vez disso."
msgid "Clipboard, files, and OTP are connected."
msgstr "Área de transferência, arquivos e OTP estão conectados."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"Arquivos e OTP estão conectados. Este compositor não dá ao Tether acesso à "
+"área de transferência, então a sincronização da área de transferência está "
+"desligada."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/ru.po b/po/ru.po
index 777dd26..aee912b 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Russian\n"
@@ -1091,6 +1091,14 @@ msgstr "Папки отправить нельзя — перетащите вм
msgid "Clipboard, files, and OTP are connected."
msgstr "Буфер обмена, файлы и OTP подключены."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"Файлы и OTP подключены. Этот композитор не даёт Tether доступ к буферу "
+"обмена, поэтому синхронизация буфера обмена отключена."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/sv.po b/po/sv.po
index e717c05..aa5b7d9 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Swedish\n"
@@ -1076,6 +1076,14 @@ msgstr "Mappar kan inte skickas — släpp filer i stället."
msgid "Clipboard, files, and OTP are connected."
msgstr "Urklipp, filer och OTP är anslutna."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"Filer och OTP är anslutna. Den här kompositorn ger inte Tether åtkomst till "
+"urklipp, så urklippssynkronisering är av."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/tether.pot b/po/tether.pot
index 016898e..c4ed0f1 100644
--- a/po/tether.pot
+++ b/po/tether.pot
@@ -6,9 +6,9 @@
#, fuzzy
msgid ""
msgstr ""
-"Project-Id-Version: tether 0.2.19\n"
+"Project-Id-Version: tether 0.2.20\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
@@ -976,6 +976,12 @@ msgstr ""
msgid "Clipboard, files, and OTP are connected."
msgstr ""
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/tr.po b/po/tr.po
index 73ff63a..28c0f9a 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Turkish\n"
@@ -1073,6 +1073,14 @@ msgstr "Klasörler gönderilemez — bunun yerine dosya bırakın."
msgid "Clipboard, files, and OTP are connected."
msgstr "Pano, dosyalar ve OTP bağlı."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"Dosyalar ve OTP bağlı. Bu bileştirici Tether'a pano erişimi vermiyor, bu "
+"yüzden pano eşitlemesi kapalı."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/uk.po b/po/uk.po
index c7a4365..777ca45 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Ukrainian\n"
@@ -1087,6 +1087,14 @@ msgstr "Теки надіслати не можна — перетягніть
msgid "Clipboard, files, and OTP are connected."
msgstr "Буфер обміну, файли та OTP під'єднано."
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"Файли та OTP підключені. Цей композитор не надає Tether доступу до буфера "
+"обміну, тож синхронізація буфера обміну вимкнена."
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 617e319..35fede3 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-08-31 20:10-0700\n"
+"POT-Creation-Date: 2026-08-31 22:04-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Simplified Chinese\n"
@@ -1033,6 +1033,14 @@ msgstr "无法发送文件夹 —— 请改为拖放文件。"
msgid "Clipboard, files, and OTP are connected."
msgstr "剪贴板、文件和 OTP 已连接。"
+#: src/gtk/devices_view.cpp
+msgid ""
+"Files and OTP are connected. This compositor does not give Tether clipboard "
+"access, so clipboard sync is off."
+msgstr ""
+"文件和 OTP 已连接。此合成器不向 Tether 提供剪贴板访问权限,因此剪贴板同步已关"
+"闭。"
+
#: src/gtk/devices_view.cpp
msgid ""
"avahi-daemon isn't running, so the iPhone can't find this PC. Start it with: "
diff --git a/src/core/include/tether/bluetooth/obex_transfer.hpp b/src/core/include/tether/bluetooth/obex_transfer.hpp
index 15e63cf..b2f4e39 100644
--- a/src/core/include/tether/bluetooth/obex_transfer.hpp
+++ b/src/core/include/tether/bluetooth/obex_transfer.hpp
@@ -1,5 +1,6 @@
#pragma once
+#include <filesystem>
#include <gio/gio.h>
#include <string>
@@ -13,4 +14,7 @@ namespace tether::bluetooth {
// out with the transfer still in progress.
TransferState wait_for_transfer(GDBusConnection* bus, const std::string& path, int timeout_seconds);
+ // Where to stage a file obexd reads or writes.
+ std::filesystem::path obex_staging_path(const std::string& name);
+
} // namespace tether::bluetooth
diff --git a/src/core/include/tether/wayland.hpp b/src/core/include/tether/wayland.hpp
index 76ee892..ff5b98f 100644
--- a/src/core/include/tether/wayland.hpp
+++ b/src/core/include/tether/wayland.hpp
@@ -22,6 +22,8 @@ namespace tether {
~WaylandContext();
bool init();
+
+ bool clipboard_available() const { return clipboard_ != nullptr; }
void set_clipboard_callback(std::function<void(const std::string&)> cb);
void copy_to_clipboard(const std::string& text);
std::string get_clipboard();
diff --git a/src/core/src/bluetooth/map_session.cpp b/src/core/src/bluetooth/map_session.cpp
index c9b40e3..6f33677 100644
--- a/src/core/src/bluetooth/map_session.cpp
+++ b/src/core/src/bluetooth/map_session.cpp
@@ -165,13 +165,23 @@ namespace tether::bluetooth {
bool MapSession::fetch_bmessage(const std::string& message_path, BMessage& out, std::string& err) {
// Message1.Get writes the bMessage to a file and returns the transfer
// object plus its properties.
+ static std::atomic<uint64_t> serial{0};
+ const std::filesystem::path target =
+ obex_staging_path("tether-msg-" + std::to_string(getpid()) + "-" + std::to_string(serial++) + ".bmsg");
+ if (target.empty()) {
+ err = "XDG_RUNTIME_DIR is not set, and a message cannot be staged anywhere else.";
+ return false;
+ }
+ std::error_code target_ec;
+ std::filesystem::remove(target, target_ec);
+
GError* error = nullptr;
GVariant* reply = g_dbus_connection_call_sync(state_->bus,
OBEX_NAME,
message_path.c_str(),
IFACE_MESSAGE,
"Get",
- g_variant_new("(sb)", "", TRUE),
+ g_variant_new("(sb)", target.c_str(), TRUE),
G_VARIANT_TYPE("(oa{sv})"),
G_DBUS_CALL_FLAGS_NONE,
MAP_CALL_TIMEOUT_MS,
@@ -185,17 +195,15 @@ namespace tether::bluetooth {
g_variant_get(reply, "(&o@a{sv})", &transfer_path, &props);
const std::string transfer = transfer_path ? transfer_path : "";
GVariant* filename = props ? g_variant_lookup_value(props, "Filename", G_VARIANT_TYPE_STRING) : nullptr;
- const std::string path = filename ? g_variant_get_string(filename, nullptr) : "";
+ std::string path = filename ? g_variant_get_string(filename, nullptr) : "";
+ if (path.empty())
+ path = target.string();
if (filename)
g_variant_unref(filename);
if (props)
g_variant_unref(props);
g_variant_unref(reply);
- if (path.empty()) {
- err = "transfer returned no filename";
- return false;
- }
if (transfer.empty()) {
err = "obexd returned no transfer object";
return false;
@@ -262,13 +270,12 @@ namespace tether::bluetooth {
}
static std::atomic<uint64_t> serial{0};
- const char* runtime = getenv("XDG_RUNTIME_DIR");
- if (!runtime || !*runtime) {
+ std::filesystem::path source =
+ obex_staging_path("tether-send-" + std::to_string(getpid()) + "-" + std::to_string(serial++) + ".bmsg");
+ if (source.empty()) {
err = "XDG_RUNTIME_DIR is not set, and a message cannot be staged anywhere else.";
return false;
}
- std::filesystem::path source = std::filesystem::path(runtime) / ("tether-send-" + std::to_string(getpid()) +
- "-" + std::to_string(serial++) + ".bmsg");
std::error_code ec;
{
diff --git a/src/core/src/bluetooth/obex_transfer.cpp b/src/core/src/bluetooth/obex_transfer.cpp
index b7bf99c..631b1ff 100644
--- a/src/core/src/bluetooth/obex_transfer.cpp
+++ b/src/core/src/bluetooth/obex_transfer.cpp
@@ -1,4 +1,5 @@
#include "tether/bluetooth/obex_transfer.hpp"
+#include "tether/net.hpp"
#include <chrono>
#include <thread>
@@ -70,4 +71,12 @@ namespace tether::bluetooth {
return state;
}
+ std::filesystem::path obex_staging_path(const std::string& name) {
+ try {
+ return std::filesystem::path(get_runtime_dir()) / name;
+ } catch (const std::exception&) {
+ return {};
+ }
+ }
+
} // namespace tether::bluetooth
diff --git a/src/core/src/bluetooth/objects.cpp b/src/core/src/bluetooth/objects.cpp
index 8cddd31..1686d3b 100644
--- a/src/core/src/bluetooth/objects.cpp
+++ b/src/core/src/bluetooth/objects.cpp
@@ -274,31 +274,45 @@ namespace tether::bluetooth {
namespace {
- // Arch = /usr/lib, Debian and Fedora = /usr/libexec.
+ // Arch = /usr/lib, Debian and Fedora = /usr/libexec. Empty when neither is
+ // visible (sandbox): its /usr is the runtime's.
std::string bluetoothd_path() {
for (const char* candidate : {"/usr/lib/bluetooth/bluetoothd", "/usr/libexec/bluetooth/bluetoothd"}) {
std::error_code ec;
if (std::filesystem::exists(candidate, ec))
return candidate;
}
- return "/usr/lib/bluetooth/bluetoothd";
+ return {};
+ }
+
+ // Are we flatpak sandboxed?
+ bool sandboxed() {
+ std::error_code ec;
+ return std::filesystem::exists("/.flatpak-info", ec);
}
// The package ships the drop-in for the user to copy.
std::string enable_experimental_command() {
const std::string shipped = std::string(TETHER_DATADIR) + "/bluetooth-experimental.conf";
std::error_code ec;
- if (std::filesystem::exists(shipped, ec))
+ if (!sandboxed() && std::filesystem::exists(shipped, ec))
return "sudo mkdir -p /etc/systemd/system/bluetooth.service.d\n"
"sudo cp " +
shipped +
" /etc/systemd/system/bluetooth.service.d/\n"
"sudo systemctl daemon-reload && sudo systemctl restart bluetooth";
+ const std::string found = bluetoothd_path();
+ const std::string binary = found.empty()
+ ? "$(ls /usr/lib/bluetooth/bluetoothd /usr/libexec/bluetooth/bluetoothd "
+ "2>/dev/null | head -1)"
+ : found;
+
return "sudo mkdir -p /etc/systemd/system/bluetooth.service.d\n"
- "printf '[Service]\\nExecStart=\\nExecStart=" +
- bluetoothd_path() +
- " --experimental\\n' \\\n"
+ "printf '[Service]\\nExecStart=\\nExecStart=%s --experimental\\n' \\\n"
+ " \"" +
+ binary +
+ "\" \\\n"
" | sudo tee /etc/systemd/system/bluetooth.service.d/experimental.conf\n"
"sudo systemctl daemon-reload && sudo systemctl restart bluetooth";
}
diff --git a/src/core/src/bluetooth/pbap_session.cpp b/src/core/src/bluetooth/pbap_session.cpp
index d73f546..df15d10 100644
--- a/src/core/src/bluetooth/pbap_session.cpp
+++ b/src/core/src/bluetooth/pbap_session.cpp
@@ -28,10 +28,7 @@ namespace tether::bluetooth {
// directory. Falling back to a shared /tmp would leave it readable and its
// predictable name a symlink target; refuse instead.
std::filesystem::path staging_file() {
- const char* runtime = getenv("XDG_RUNTIME_DIR");
- if (!runtime || !*runtime)
- return {};
- return std::filesystem::path(runtime) / ("tether-pbap-" + std::to_string(getpid()) + ".vcf");
+ return obex_staging_path("tether-pbap-" + std::to_string(getpid()) + ".vcf");
}
std::string read_file(const std::filesystem::path& path) {
diff --git a/src/core/src/extension_host.cpp b/src/core/src/extension_host.cpp
index cdab2af..8eb7672 100644
--- a/src/core/src/extension_host.cpp
+++ b/src/core/src/extension_host.cpp
@@ -4,6 +4,7 @@
#include <cstdlib>
#include <fstream>
#include <nlohmann/json.hpp>
+#include <string_view>
namespace tether {
@@ -39,15 +40,38 @@ namespace tether {
true},
};
- // AppImage's binaries live on a mount that dies with the process, so the wrapper has to name the AppImage file
- // itself.
- std::string self_command() {
+ // In flatpak $HOME is the app's own private directory, but the
+ // browsers that have to read these manifests live outside it.
+ fs::path host_home(const fs::path& home) {
+ static constexpr std::string_view MARKER = "/.var/app/";
+ const std::string text = home.string();
+ const auto at = text.find(MARKER);
+ return at == std::string::npos ? home : fs::path(text.substr(0, at));
+ }
+
+ // The application id flatpak uses in the running sandbox.
+ std::string flatpak_app_id() {
+ std::ifstream in("/.flatpak-info");
+ if (!in.is_open())
+ return {};
+ for (std::string line; std::getline(in, line);) {
+ if (line.rfind("name=", 0) == 0)
+ return line.substr(5);
+ }
+ return {};
+ }
+
+ // The shell frag the wrapper execs, quoted.
+ std::string launch_command() {
if (const char* appimage = std::getenv("APPIMAGE"); appimage && *appimage)
- return appimage;
+ return "\"" + std::string(appimage) + "\"";
+
+ if (const std::string app_id = flatpak_app_id(); !app_id.empty())
+ return "flatpak run --command=tether " + app_id;
std::error_code ec;
const fs::path self = fs::read_symlink("/proc/self/exe", ec);
- return ec ? "tether" : self.string();
+ return "\"" + (ec ? std::string("tether") : self.string()) + "\"";
}
bool write_file(const fs::path& path, const std::string& content, std::string& err) {
@@ -58,6 +82,9 @@ namespace tether {
return false;
}
+ if (fs::is_symlink(path, ec))
+ fs::remove(path, ec);
+
std::ofstream out(path, std::ios::trunc);
if (!out.is_open()) {
err = path.string() + ": cannot open for writing";
@@ -87,15 +114,16 @@ namespace tether {
} // namespace
- ExtensionHostInstall install_extension_host(const fs::path& home) {
+ ExtensionHostInstall install_extension_host(const fs::path& requested_home) {
ExtensionHostInstall result;
+ const fs::path home = host_home(requested_home);
const fs::path wrapper = home / ".local/bin/tether-native-host";
result.wrapper = wrapper.string();
const std::string script = "#!/bin/sh\n"
- "exec \"" +
- self_command() + "\" --native-host 2>> /tmp/tether-native.log\n";
+ "exec " +
+ launch_command() + " --native-host 2>> /tmp/tether-native.log\n";
std::string err;
if (!write_file(wrapper, script, err)) {
diff --git a/src/core/src/net.cpp b/src/core/src/net.cpp
index 8929c15..3ab5b7f 100644
--- a/src/core/src/net.cpp
+++ b/src/core/src/net.cpp
@@ -585,6 +585,7 @@ namespace tether {
}
snapshot["mdns_available"] = g_mdns_available.load();
+ snapshot["clipboard_available"] = g_wayland && g_wayland->clipboard_available();
return snapshot;
}
diff --git a/src/gtk/devices_view.cpp b/src/gtk/devices_view.cpp
index e40dde9..d87bedc 100644
--- a/src/gtk/devices_view.cpp
+++ b/src/gtk/devices_view.cpp
@@ -25,6 +25,9 @@ namespace tether::ui {
// false when avahi-daemon is down
bool mdns_ok = true;
+ // false when the compositor withholds data-control (flatpak)
+ bool clipboard_ok = true;
+
// The Bluetooth route
std::vector<nlohmann::json> bt_devices;
nlohmann::json bt_status = nlohmann::json::object();
@@ -569,7 +572,12 @@ namespace tether::ui {
void update_wifi_indicator() {
const bool connected = !g_devices.connected_fps.empty();
if (connected) {
- set_route_status(Route::WiFi, true, _("Clipboard, files, and OTP are connected."));
+ set_route_status(Route::WiFi,
+ true,
+ g_devices.clipboard_ok
+ ? _("Clipboard, files, and OTP are connected.")
+ : _("Files and OTP are connected. This compositor does not give Tether "
+ "clipboard access, so clipboard sync is off."));
return;
}
@@ -586,6 +594,7 @@ namespace tether::ui {
void apply_state_snapshot(const nlohmann::json& j) {
g_devices.mdns_ok = j.value("mdns_available", true);
+ g_devices.clipboard_ok = j.value("clipboard_available", true);
g_devices.connected_fps.clear();
if (j.contains("connected_clients") && j["connected_clients"].is_array()) {
for (auto& c : j["connected_clients"]) {
diff --git a/test/test_extension_host.cpp b/test/test_extension_host.cpp
index 94c0df1..6d27311 100644
--- a/test/test_extension_host.cpp
+++ b/test/test_extension_host.cpp
@@ -48,3 +48,23 @@ TEST(ExtensionHost, WritesManifestsOnlyWhereTheBrowserIs) {
fs::remove_all(home);
}
+
+// Inside a Flatpak the manifests have to go in the real home, not the app's
+// private one, or no browser on the host ever reads them.
+TEST(ExtensionHost, WritesOutsideTheFlatpakPrivateHome) {
+ const fs::path real = fs::temp_directory_path() / "tether-extension-host-flatpak";
+ fs::remove_all(real);
+ fs::create_directories(real / ".mozilla");
+
+ const fs::path sandboxed = real / ".var/app/com.tether.desktop";
+ fs::create_directories(sandboxed);
+
+ const auto result = tether::install_extension_host(sandboxed);
+ ASSERT_TRUE(result.errors.empty()) << result.errors.front();
+
+ EXPECT_TRUE(fs::exists(real / ".mozilla/native-messaging-hosts/com.tether.extension.json"));
+ EXPECT_FALSE(fs::exists(sandboxed / ".mozilla"));
+ EXPECT_EQ(result.wrapper, (real / ".local/bin/tether-native-host").string());
+
+ fs::remove_all(real);
+}