Skip to content

Linux + iPhone Continuity / iMessage / SMS

feat(gtk): airpods tray tooltip

Zack Bartel705f118023c8
diff --git a/po/cs.po b/po/cs.po
index ec557db..557c7bb 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Czech\n"
@@ -441,6 +441,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "Nepodařilo se načíst baterii AirPods z démona.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "Nejsou připojena žádná AirPods.\n"
@@ -2062,6 +2063,7 @@ msgstr "připojeno"
msgid "not connected"
msgstr "nepřipojeno"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/de.po b/po/de.po
index 3bb05dc..9310f2d 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: German\n"
@@ -439,6 +439,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "Der Akkustand der AirPods konnte nicht vom Daemon gelesen werden.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "Keine AirPods verbunden.\n"
@@ -2108,6 +2109,7 @@ msgstr "verbunden"
msgid "not connected"
msgstr "nicht verbunden"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/es.po b/po/es.po
index ef983bb..9ca03e6 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: Spanish\n"
@@ -441,6 +441,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "No se pudo leer la batería de los AirPods desde el demonio.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "No hay AirPods conectados.\n"
@@ -2095,6 +2096,7 @@ msgstr "conectado"
msgid "not connected"
msgstr "no conectado"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/fr.po b/po/fr.po
index 951b7fa..91d1d48 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-22\n"
"Last-Translator: Tether project\n"
"Language-Team: French\n"
@@ -445,6 +445,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "Impossible de lire la batterie des AirPods depuis le démon.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "Aucun AirPods connecté.\n"
@@ -2105,6 +2106,7 @@ msgstr "connecté"
msgid "not connected"
msgstr "non connecté"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/it.po b/po/it.po
index 3ee9c69..c695b73 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Italian\n"
@@ -441,6 +441,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "Impossibile leggere la batteria degli AirPods dal demone.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "Nessun AirPods connesso.\n"
@@ -2096,6 +2097,7 @@ msgstr "connesso"
msgid "not connected"
msgstr "non connesso"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/ja.po b/po/ja.po
index b64c185..bc2ef8b 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Japanese\n"
@@ -431,6 +431,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "デーモンから AirPods のバッテリーを読み取れませんでした。\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "AirPods は接続されていません。\n"
@@ -2060,6 +2061,7 @@ msgstr "接続済み"
msgid "not connected"
msgstr "未接続"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/ko.po b/po/ko.po
index 6010c39..699fba1 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Korean\n"
@@ -429,6 +429,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "데몬에서 AirPods 배터리를 읽을 수 없습니다.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "연결된 AirPods가 없습니다.\n"
@@ -2033,6 +2034,7 @@ msgstr "연결됨"
msgid "not connected"
msgstr "연결 안 됨"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/nl.po b/po/nl.po
index 35bed36..9450cd9 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Dutch\n"
@@ -439,6 +439,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "Kon de accu van de AirPods niet uitlezen via de daemon.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "Geen AirPods verbonden.\n"
@@ -2080,6 +2081,7 @@ msgstr "verbonden"
msgid "not connected"
msgstr "niet verbonden"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/pl.po b/po/pl.po
index 87a3644..b0d98b3 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Polish\n"
@@ -444,6 +444,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "Nie można odczytać poziomu baterii AirPods z demona.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "Nie podłączono żadnych AirPods.\n"
@@ -2083,6 +2084,7 @@ msgstr "połączono"
msgid "not connected"
msgstr "nie połączono"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/pt_BR.po b/po/pt_BR.po
index bb736b1..7172e1e 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Brazilian Portuguese\n"
@@ -439,6 +439,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "Não foi possível ler a bateria dos AirPods do daemon.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "Nenhum AirPods conectado.\n"
@@ -2083,6 +2084,7 @@ msgstr "conectado"
msgid "not connected"
msgstr "não conectado"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/ru.po b/po/ru.po
index e969868..fca0770 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Russian\n"
@@ -444,6 +444,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "Не удалось получить заряд AirPods от службы.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "AirPods не подключены.\n"
@@ -2084,6 +2085,7 @@ msgstr "подключено"
msgid "not connected"
msgstr "не подключено"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/sv.po b/po/sv.po
index 3b46a08..369c185 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Swedish\n"
@@ -437,6 +437,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "Kunde inte läsa AirPods batterinivå från demonen.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "Inga AirPods anslutna.\n"
@@ -2063,6 +2064,7 @@ msgstr "ansluten"
msgid "not connected"
msgstr "inte ansluten"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/tether.pot b/po/tether.pot
index 840ed4f..ebde9d7 100644
--- a/po/tether.pot
+++ b/po/tether.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: tether 0.2.27\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"POT-Creation-Date: 2026-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-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"
@@ -1890,6 +1890,7 @@ msgstr ""
msgid "not connected"
msgstr ""
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/tr.po b/po/tr.po
index 6b8660b..345999b 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Turkish\n"
@@ -438,6 +438,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "AirPods pil durumu arka plan hizmetinden okunamadı.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "Bağlı AirPods yok.\n"
@@ -2061,6 +2062,7 @@ msgstr "bağlı"
msgid "not connected"
msgstr "bağlı değil"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/uk.po b/po/uk.po
index b1f616e..11e3d37 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Ukrainian\n"
@@ -444,6 +444,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "Не вдалося отримати заряд AirPods від служби.\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "AirPods не під'єднано.\n"
@@ -2081,6 +2082,7 @@ msgstr "під'єднано"
msgid "not connected"
msgstr "не під'єднано"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 54a74c9..55e951d 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-09-08 15:00-0700\n"
+"POT-Creation-Date: 2026-09-08 16:08-0700\n"
"PO-Revision-Date: 2026-08-23\n"
"Last-Translator: Tether project\n"
"Language-Team: Simplified Chinese\n"
@@ -421,6 +421,7 @@ msgid "Could not read the AirPods battery from the daemon.\n"
msgstr "无法从守护进程读取 AirPods 电量。\n"
#: src/cli/main.cpp
+#, c-format
msgid "No AirPods connected.\n"
msgstr "未连接 AirPods。\n"
@@ -1988,6 +1989,7 @@ msgstr "已连接"
msgid "not connected"
msgstr "未连接"
+#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
#. TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
#: src/gtk/tray.cpp src/gtk/ui_util.cpp
#, c++-format
diff --git a/src/gtk/devices_view.cpp b/src/gtk/devices_view.cpp
index c27a4a8..41f347e 100644
--- a/src/gtk/devices_view.cpp
+++ b/src/gtk/devices_view.cpp
@@ -1,5 +1,6 @@
#include "devices_view.hpp"
#include "daemon_client.hpp"
+#include "tray.hpp"
#include "ui_util.hpp"
#include <tether/i18n.hpp>
@@ -121,9 +122,10 @@ namespace tether::ui {
return nullptr;
}
- // "L 82% R 79% Case 45%", omitting whatever is not reporting. An empty
- // result means nothing is known yet.
- std::string airpods_battery_text(const nlohmann::json& airpods) {
+ // "L 82% R 79% Case 45%", omitting whatever is not reporting, or the reason
+ // there are no levels at all. Empty while the channel is still opening, which
+ // is the one state not worth reporting anywhere.
+ std::string airpods_status_text(const nlohmann::json& airpods) {
std::string text;
const auto append = [&](const char* label, int level) {
if (level < 0)
@@ -144,7 +146,13 @@ namespace tether::ui {
const std::string status = airpods.value("status", "");
if (status == "busy" || status == "failed")
return airpods.value("reason", "");
- return _("Reading battery\u2026");
+ return "";
+ }
+
+ // The device row has room to say why it is empty; the tray tooltip does not.
+ std::string airpods_row_text(const nlohmann::json& airpods) {
+ const std::string text = airpods_status_text(airpods);
+ return text.empty() ? _("Reading battery\u2026") : text;
}
// The daemon supervises one iPhone at a time, so the live profile status
@@ -819,7 +827,7 @@ namespace tether::ui {
gtk_label_set_xalign(GTK_LABEL(battery), 0.0);
gtk_style_context_add_class(gtk_widget_get_style_context(battery), "muted");
if (g_devices.bt_airpods.value("address", "") == address)
- gtk_label_set_text(GTK_LABEL(battery), airpods_battery_text(g_devices.bt_airpods).c_str());
+ gtk_label_set_text(GTK_LABEL(battery), airpods_row_text(g_devices.bt_airpods).c_str());
g_object_set_data(G_OBJECT(row), "bt_battery", battery);
gtk_box_pack_start(GTK_BOX(labels), battery, FALSE, FALSE, 0);
}
@@ -1148,7 +1156,8 @@ namespace tether::ui {
g_devices.bt_airpods = event;
// Battery arrives whenever the buds feel like sending it
const std::string address = event.value("address", "");
- const std::string text = address.empty() ? "" : airpods_battery_text(event);
+ const std::string text = address.empty() ? "" : airpods_row_text(event);
+ tray_set_airpods(event.value("name", ""), address.empty() ? "" : airpods_status_text(event));
GList* rows = gtk_container_get_children(GTK_CONTAINER(g_devices.list_devices));
for (GList* item = rows; item; item = item->next) {
auto* row = GTK_WIDGET(item->data);
diff --git a/src/gtk/tray.cpp b/src/gtk/tray.cpp
index 87d01df..05ac911 100644
--- a/src/gtk/tray.cpp
+++ b/src/gtk/tray.cpp
@@ -70,6 +70,8 @@ namespace tether::ui {
std::string g_icon = "tether-offline";
int g_unread = 0;
std::string g_tooltip;
+ std::string g_airpods_name;
+ std::string g_airpods_battery;
bool g_close_to_tray = false;
std::string g_icon_style = "symbolic";
std::string g_icon_suffix;
@@ -244,9 +246,11 @@ namespace tether::ui {
for (Route route : {Route::WiFi, Route::Bluetooth}) {
const RouteState& r = state(route);
const std::string status = r.ok ? _("connected") : r.detail.empty() ? _("not connected") : r.detail;
- // TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth".
+ // TRANSLATORS: {} is a transport name, "Wi-Fi" or "Bluetooth", or a device name.
tooltip += tether::tr_format(_("{}: {}"), route_name(route), status) + "\n";
}
+ if (!g_airpods_battery.empty())
+ tooltip += tether::tr_format(_("{}: {}"), g_airpods_name, g_airpods_battery) + "\n";
if (!daemon_connected())
tooltip += std::string(_("Daemon: not running")) + "\n";
if (g_unread > 0)
@@ -268,6 +272,14 @@ namespace tether::ui {
}
}
+ void tray_set_airpods(const std::string& name, const std::string& battery) {
+ if (name == g_airpods_name && battery == g_airpods_battery)
+ return;
+ g_airpods_name = name;
+ g_airpods_battery = battery;
+ tray_refresh();
+ }
+
void tray_set_unread(int count) {
if (count == g_unread)
return;
diff --git a/src/gtk/tray.hpp b/src/gtk/tray.hpp
index d534a1c..19174a0 100644
--- a/src/gtk/tray.hpp
+++ b/src/gtk/tray.hpp
@@ -15,6 +15,10 @@ namespace tether::ui {
// Total unread across threads. Drives the badged icon and a tooltip line.
void tray_set_unread(int count);
+ // AirPods battery for the tooltip, already formatted. Empty removes the line:
+ // nothing connected, or the channel has reported nothing yet.
+ void tray_set_airpods(const std::string& name, const std::string& battery);
+
// Repaints from cached state, for when the daemon returns before any route event.
void tray_refresh();