Skip to content

Commit 166a4ed

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 166a4ed

File tree

4 files changed

+90
-0
lines changed

4 files changed

+90
-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: 28 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,14 @@ 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
120+
gir1.2-ayatanaappindicator3-0.1
117121
mate-applet-brisk-menu
118122
mate-applets
119123
mate-desktop-environment-core
@@ -126,6 +130,7 @@ case "$ENVIRONMENT" in
126130
WM_COMMAND="mate-session"
127131
PANEL_COMMAND="" # mate-session starts panel automatically
128132
NOTIF_COMMAND="/usr/libexec/mate-notification-daemon/mate-notification-daemon"
133+
INDICATOR_SERVICE="/usr/lib/x86_64-linux-gnu/ayatana-indicator-application/ayatana-indicator-application-service"
129134
;;
130135

131136
openbox)
@@ -138,18 +143,22 @@ case "$ENVIRONMENT" in
138143
WM_COMMAND="openbox"
139144
PANEL_COMMAND="tint2"
140145
NOTIF_COMMAND="dunst"
146+
INDICATOR_SERVICE=""
141147
;;
142148

143149
xfce)
144150
# XFCE - lightweight, full-featured, excellent tray support
145151
ENV_DEPS=(
152+
ayatana-indicator-application
153+
gir1.2-ayatanaappindicator3-0.1
146154
xfce4
147155
xfce4-notifyd
148156
xfce4-indicator-plugin
149157
)
150158
WM_COMMAND="xfce4-session"
151159
PANEL_COMMAND="" # xfce4-session starts panel automatically
152160
NOTIF_COMMAND="/usr/lib/x86_64-linux-gnu/xfce4/notifyd/xfce4-notifyd"
161+
INDICATOR_SERVICE="/usr/lib/x86_64-linux-gnu/ayatana-indicator-application/ayatana-indicator-application-service"
153162
;;
154163

155164
*)
@@ -279,6 +288,25 @@ if [[ -n "$NOTIF_COMMAND" ]]; then
279288
fi
280289
fi
281290

291+
# Start indicator application service (for AppIndicator support)
292+
if [[ -n "${INDICATOR_SERVICE:-}" ]]; then
293+
echo -e "${BLUE}Starting indicator application service...${RESET}"
294+
295+
if [[ -x "$INDICATOR_SERVICE" ]]; then
296+
$INDICATOR_SERVICE &
297+
INDICATOR_PID=$!
298+
sleep 2
299+
300+
if ps -p $INDICATOR_PID > /dev/null 2>&1; then
301+
echo -e "${GREEN}✓ Indicator service started (PID: ${INDICATOR_PID})${RESET}"
302+
else
303+
echo -e "${YELLOW}⚠ Indicator service may have daemonized or exited${RESET}"
304+
fi
305+
else
306+
echo -e "${YELLOW}⚠ Indicator service not found: ${INDICATOR_SERVICE}${RESET}"
307+
fi
308+
fi
309+
282310
# Verify X server is responding
283311
echo -e "${BLUE}Verifying X server...${RESET}"
284312
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)