Skip to content

Commit cd13799

Browse files
Improve Linux CI setup and tray diagnostics
Added missing packages (xfce4-notifyd, indicator-application) to CI workflow for better tray support. Enhanced CI script to handle more watcher binaries, increased settle time, and improved diagnostics output. Minor code cleanup in tray_linux.c for header includes.
1 parent aabd2c0 commit cd13799

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ jobs:
7070
xfce4 \
7171
xfce4-panel \
7272
xfce4-indicator-plugin \
73+
xfce4-notifyd \
74+
indicator-application \
7375
xfconf \
7476
xkb-data \
7577
imagemagick \

.github/workflows/ci_linux_desktop.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ mkdir -p "${XDG_DATA_HOME}"
2323
chmod 700 "${XDG_DATA_HOME}"
2424

2525
cleanup() {
26-
# best effort cleanup
26+
# Best-effort cleanup.
2727
kill "${WATCHER_PID:-}" "${PANEL_PID:-}" "${WM_PID:-}" >/dev/null 2>&1 || true
2828
chmod -R u+w "${XDG_DATA_HOME}" >/dev/null 2>&1 || true
2929
}
@@ -59,28 +59,43 @@ xfce4-panel >/dev/null 2>&1 &
5959
PANEL_PID=$!
6060

6161
# Start an SNI/AppIndicator watcher so AppIndicators can appear.
62-
# Prefer Ayatana watcher if available.
62+
# Different distros provide different watcher/service binaries.
6363
if command -v ayatana-indicator-application-service >/dev/null 2>&1; then
6464
ayatana-indicator-application-service >/dev/null 2>&1 &
6565
WATCHER_PID=$!
6666
elif command -v indicator-application-service >/dev/null 2>&1; then
6767
indicator-application-service >/dev/null 2>&1 &
6868
WATCHER_PID=$!
69+
elif command -v indicator-application >/dev/null 2>&1; then
70+
# Some packages install only `indicator-application`.
71+
indicator-application >/dev/null 2>&1 &
72+
WATCHER_PID=$!
6973
else
7074
WATCHER_PID=
7175
fi
7276

7377
# Small settle time for panel + watcher.
74-
sleep 3
78+
sleep 5
7579

7680
echo "::group::Linux tray diagnostics"
7781
echo "DISPLAY=${DISPLAY:-}"
7882
echo "XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR}"
7983
echo "XDG_DATA_HOME=${XDG_DATA_HOME}"
84+
echo "Panel plugin ids:"
85+
xfconf-query -c xfce4-panel -p /panels/panel-1/plugin-ids || true
86+
echo "Plugin-1 type:"
87+
xfconf-query -c xfce4-panel -p /plugins/plugin-1 || true
8088
echo "Enabled XFCE panel plugins:"
8189
xfconf-query -c xfce4-panel -p /panels/panel-1/plugin-ids || true
8290
xfconf-query -c xfce4-panel -p /plugins/plugin-1 || true
8391
echo "Watcher process: ${WATCHER_PID:-none}"
92+
# If we found no watcher binary, show what's available.
93+
if [ -z "${WATCHER_PID:-}" ]; then
94+
echo "Available watcher binaries:"
95+
command -v ayatana-indicator-application-service || true
96+
command -v indicator-application-service || true
97+
command -v indicator-application || true
98+
fi
8499
dbus-send --session --dest=org.freedesktop.DBus --type=method_call --print-reply \
85100
/org/freedesktop/DBus org.freedesktop.DBus.ListNames \
86101
| sed -n 's/.*string "\(.*\)".*/\1/p' \

src/tray_linux.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
*/
55
// standard includes
66
#include <stdbool.h>
7+
#include <stdio.h>
78
#include <stddef.h>
89
#include <string.h>
10+
#include <unistd.h>
911

1012
// lib includes
1113
#ifdef TRAY_AYATANA_APPINDICATOR
@@ -18,9 +20,6 @@
1820
#endif
1921
#include <libnotify/notify.h>
2022

21-
#include <stdio.h>
22-
#include <unistd.h>
23-
2423
// Use a per-process AppIndicator id to avoid DBus collisions when tests create multiple
2524
// tray instances in the same desktop/session.
2625
static unsigned long tray_appindicator_seq = 0;

0 commit comments

Comments
 (0)