Skip to content

Commit e0f4b8b

Browse files
Add AppIndicator test and support for virtual desktops
Introduces a Python script to test AppIndicator/Ayatana integration in MATE and XFCE environments. Updates setup scripts to install required dependencies, start the indicator service where supported, and run the test script with screenshot capture. Adds a requirements.txt for Python dependencies.
1 parent e6c3afd commit e0f4b8b

File tree

4 files changed

+88
-0
lines changed

4 files changed

+88
-0
lines changed

actions/setup_virtual_desktop/action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ runs:
7676
sudo apt-get update -qq
7777
sudo apt-get install -y -qq \
7878
imagemagick \
79+
python3-gi \
7980
xterm \
8081
yad
8182
echo "::endgroup::"
@@ -128,6 +129,19 @@ runs:
128129
kill $YAD1 $YAD2 2>/dev/null || true
129130
echo "::endgroup::"
130131
132+
echo "::group::Test AppIndicator"
133+
# Test ayatana-appindicator (only on MATE/XFCE which have indicator support)
134+
ENVIRONMENT="${{ inputs.environment }}"
135+
if [[ "$ENVIRONMENT" == "mate" ]] || [[ "$ENVIRONMENT" == "xfce" ]]; then
136+
python3 "${GITHUB_ACTION_PATH}/test_appindicator.py" &
137+
APPIND_PID=$!
138+
${SCREENSHOT_PATH} --output-path=05-appindicator.png --delay=1000
139+
kill $APPIND_PID 2>/dev/null || true
140+
else
141+
echo "Skipping AppIndicator test (not supported on ${ENVIRONMENT})"
142+
fi
143+
echo "::endgroup::"
144+
131145
ls -lh
132146
133147
- name: Upload screenshots
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Python dependencies for test_appindicator.py
2+
# PyGObject provides Python bindings for GObject-based libraries like GTK and AppIndicator
3+
# Only install on Linux where AppIndicator/Ayatana is available
4+
pygobject==3.54.5; sys_platform == 'linux'

actions/setup_virtual_desktop/setup_desktop.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ case "$ENVIRONMENT" in
9595
WM_COMMAND="fluxbox"
9696
PANEL_COMMAND="stalonetray"
9797
NOTIF_COMMAND="dunst"
98+
INDICATOR_SERVICE=""
9899
;;
99100

100101
lxde)
@@ -109,11 +110,13 @@ case "$ENVIRONMENT" in
109110
WM_COMMAND="startlxde"
110111
PANEL_COMMAND="" # lxsession starts lxpanel automatically
111112
NOTIF_COMMAND="/usr/lib/notification-daemon/notification-daemon"
113+
INDICATOR_SERVICE=""
112114
;;
113115

114116
mate)
115117
# MATE - full-featured desktop, fork of GNOME 2, excellent tray support
116118
ENV_DEPS=(
119+
ayatana-indicator-application
117120
mate-applet-brisk-menu
118121
mate-applets
119122
mate-desktop-environment-core
@@ -126,6 +129,7 @@ case "$ENVIRONMENT" in
126129
WM_COMMAND="mate-session"
127130
PANEL_COMMAND="" # mate-session starts panel automatically
128131
NOTIF_COMMAND="/usr/libexec/mate-notification-daemon/mate-notification-daemon"
132+
INDICATOR_SERVICE="/usr/lib/x86_64-linux-gnu/ayatana-indicator-application/ayatana-indicator-application-service"
129133
;;
130134

131135
openbox)
@@ -138,18 +142,21 @@ case "$ENVIRONMENT" in
138142
WM_COMMAND="openbox"
139143
PANEL_COMMAND="tint2"
140144
NOTIF_COMMAND="dunst"
145+
INDICATOR_SERVICE=""
141146
;;
142147

143148
xfce)
144149
# XFCE - lightweight, full-featured, excellent tray support
145150
ENV_DEPS=(
151+
ayatana-indicator-application
146152
xfce4
147153
xfce4-notifyd
148154
xfce4-indicator-plugin
149155
)
150156
WM_COMMAND="xfce4-session"
151157
PANEL_COMMAND="" # xfce4-session starts panel automatically
152158
NOTIF_COMMAND="/usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd"
159+
INDICATOR_SERVICE="/usr/lib/x86_64-linux-gnu/ayatana-indicator-application/ayatana-indicator-application-service"
153160
;;
154161

155162
*)
@@ -279,6 +286,25 @@ if [[ -n "$NOTIF_COMMAND" ]]; then
279286
fi
280287
fi
281288

289+
# Start indicator application service (for AppIndicator support)
290+
if [[ -n "${INDICATOR_SERVICE:-}" ]]; then
291+
echo -e "${BLUE}Starting indicator application service...${RESET}"
292+
293+
if [[ -x "$INDICATOR_SERVICE" ]]; then
294+
$INDICATOR_SERVICE &
295+
INDICATOR_PID=$!
296+
sleep 2
297+
298+
if ps -p $INDICATOR_PID > /dev/null 2>&1; then
299+
echo -e "${GREEN}✓ Indicator service started (PID: ${INDICATOR_PID})${RESET}"
300+
else
301+
echo -e "${YELLOW}⚠ Indicator service may have daemonized or exited${RESET}"
302+
fi
303+
else
304+
echo -e "${YELLOW}⚠ Indicator service not found: ${INDICATOR_SERVICE}${RESET}"
305+
fi
306+
fi
307+
282308
# Verify X server is responding
283309
echo -e "${BLUE}Verifying X server...${RESET}"
284310
if xdpyinfo -display ":${DISPLAY_NUM}" > /dev/null 2>&1; then
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env python3
2+
"""Test script for AppIndicator/Ayatana support in virtual desktop environments."""
3+
import signal
4+
import sys
5+
6+
7+
def main():
8+
"""Create a test AppIndicator with a built-in icon."""
9+
# AppIndicator is only available on Linux
10+
if sys.platform != 'linux':
11+
print(f"Skipping AppIndicator test on {sys.platform} (only supported on Linux)")
12+
return
13+
14+
# Import gi modules only on Linux to avoid import errors on other platforms
15+
import gi
16+
gi.require_version('AyatanaAppIndicator3', '0.1')
17+
from gi.repository import AyatanaAppIndicator3 as AppIndicator
18+
from gi.repository import GLib
19+
from gi.repository import Gtk
20+
21+
indicator = AppIndicator.Indicator.new(
22+
"test-indicator",
23+
"mail-message-new",
24+
AppIndicator.IndicatorCategory.APPLICATION_STATUS
25+
)
26+
indicator.set_status(AppIndicator.IndicatorStatus.ACTIVE)
27+
indicator.set_title("Test AppIndicator")
28+
29+
# Create a simple menu
30+
menu = Gtk.Menu()
31+
item = Gtk.MenuItem(label="Test Item")
32+
menu.append(item)
33+
item.show()
34+
indicator.set_menu(menu)
35+
36+
# Exit after 3 seconds
37+
GLib.timeout_add_seconds(3, Gtk.main_quit)
38+
39+
Gtk.main()
40+
41+
42+
if __name__ == "__main__":
43+
signal.signal(signal.SIGINT, signal.SIG_DFL)
44+
main()

0 commit comments

Comments
 (0)