Skip to content

Commit cf2241f

Browse files
committed
Finalize Mini EQ 0.7.3
1 parent 6b4d6bb commit cf2241f

7 files changed

Lines changed: 71 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
routing.
1010
- Avoid a headless startup hang when system-wide EQ fails synchronously before
1111
the GLib main loop starts.
12+
- Hide the GNOME Shell extension's mini analyzer while monitoring is turned
13+
off, keeping the panel item available without showing stale meter bars.
1214

1315
## 0.7.2 - 2026-05-10
1416

data/io.github.bhack.mini-eq.metainfo.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
<li>Require pipewire-gobject 0.3.6 and use its synchronous PipeWire registry, metadata, node, and device APIs for startup and routing state.</li>
5252
<li>Replace Mini EQ's PipeWire startup and routing sleep loops with bounded sync or registry-event waits for route params, virtual sink creation, and stream routing.</li>
5353
<li>Avoid a headless startup hang when system-wide EQ fails synchronously before the GLib main loop starts.</li>
54+
<li>Hide the GNOME Shell extension's mini analyzer while monitoring is turned off.</li>
5455
</ul>
5556
</description>
5657
</release>

extensions/gnome-shell/mini-eq@bhack.github.io/extension.js

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class MiniEqIndicator extends PanelMenu.Button {
6969
this._running = false;
7070
this._routed = false;
7171
this._eqEnabled = false;
72+
this._analyzerEnabled = false;
7273
this._capabilities = new Set();
7374
this.visible = false;
7475

@@ -83,7 +84,8 @@ class MiniEqIndicator extends PanelMenu.Button {
8384
y_align: Clutter.ActorAlign.CENTER,
8485
});
8586
box.add_child(this._icon);
86-
box.add_child(this._buildPanelAnalyzer());
87+
this._panelAnalyzer = this._buildPanelAnalyzer();
88+
box.add_child(this._panelAnalyzer);
8789
this.add_child(box);
8890

8991
this._statusItem = new PopupMenu.PopupMenuItem(_('Mini EQ is not running'));
@@ -336,6 +338,9 @@ class MiniEqIndicator extends PanelMenu.Button {
336338
const running = Boolean(unpackValue(state.running));
337339
const eqEnabled = Boolean(unpackValue(state.eq_enabled));
338340
const routed = Boolean(unpackValue(state.routed));
341+
const analyzerEnabled = 'analyzer_enabled' in state
342+
? Boolean(unpackValue(state.analyzer_enabled))
343+
: true;
339344
const presetName = unpackValue(state.preset_name) || _('Current State');
340345
const outputPresetName = unpackValue(state.output_preset_name) || '';
341346
const capabilities = unpackValue(state.capabilities) || [];
@@ -345,8 +350,9 @@ class MiniEqIndicator extends PanelMenu.Button {
345350
this._running = running;
346351
this._routed = routed;
347352
this._eqEnabled = eqEnabled;
353+
this._analyzerEnabled = analyzerEnabled;
348354
this.visible = running;
349-
this._syncPanelStateStyle(running, routed, eqEnabled);
355+
this._syncPanelStateStyle(running, routed, eqEnabled, analyzerEnabled);
350356
this._updating = true;
351357
try {
352358
this._routingItem.setToggleState(routed);
@@ -355,7 +361,7 @@ class MiniEqIndicator extends PanelMenu.Button {
355361
this._updating = false;
356362
}
357363

358-
if (!running || !routed || !eqEnabled)
364+
if (!running || !routed || !eqEnabled || !analyzerEnabled)
359365
this._setAnalyzerLevels([]);
360366

361367
this._routingItem.setSensitive(running);
@@ -371,9 +377,10 @@ class MiniEqIndicator extends PanelMenu.Button {
371377
this._running = false;
372378
this._routed = false;
373379
this._eqEnabled = false;
380+
this._analyzerEnabled = false;
374381
this._capabilities = new Set();
375382
this.visible = false;
376-
this._syncPanelStateStyle(false, false, false);
383+
this._syncPanelStateStyle(false, false, false, false);
377384
this._updating = true;
378385
try {
379386
this._routingItem.setToggleState(false);
@@ -413,10 +420,12 @@ class MiniEqIndicator extends PanelMenu.Button {
413420
if (this._disposed)
414421
return;
415422

416-
this._setAnalyzerLevels(this._running && this._routed && this._eqEnabled ? levels : []);
423+
this._setAnalyzerLevels(this._running && this._routed && this._eqEnabled && this._analyzerEnabled ? levels : []);
417424
}
418425

419-
_syncPanelStateStyle(running, routed, eqEnabled) {
426+
_syncPanelStateStyle(running, routed, eqEnabled, analyzerEnabled) {
427+
this._panelAnalyzer.visible = running && analyzerEnabled;
428+
420429
if (!running) {
421430
this._icon.opacity = 0;
422431
this._panelAnalyzerDimColor = PANEL_ANALYZER_STANDBY_COLOR;

src/mini_eq/dbus_control.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def state(self) -> dict[str, GLib.Variant]:
170170
"b",
171171
bool(window and getattr(window, "output_preset_auto_applied", False)),
172172
),
173+
"analyzer_enabled": GLib.Variant("b", bool(window and getattr(window, "analyzer_enabled", False))),
173174
"background_mode": GLib.Variant("b", bool(getattr(self.app, "background_mode", False))),
174175
"start_at_login": GLib.Variant("b", bool(getattr(self.app, "start_at_login", False))),
175176
"start_active_at_login": GLib.Variant(

tests/test_mini_eq_dbus_control.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ def test_dbus_control_state_contains_shell_summary() -> None:
217217
"output_sink": "alsa_output.test",
218218
"output_preset_name": "Headphones",
219219
"output_preset_auto_applied": False,
220+
"analyzer_enabled": False,
220221
"background_mode": True,
221222
"start_at_login": False,
222223
"start_active_at_login": False,

tools/gnome-shell-extension/fake_mini_eq_control.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/usr/bin/env python3
22
from __future__ import annotations
33

4+
import argparse
45
import math
56
import signal
67
import warnings
@@ -93,12 +94,13 @@ def display_level(level: float) -> float:
9394

9495

9596
class FakeMiniEqControl:
96-
def __init__(self) -> None:
97+
def __init__(self, *, analyzer_enabled: bool = True) -> None:
9798
self.eq_enabled = True
9899
self.routed = True
99100
self.preset_name = "Studio Reference"
100101
self.output_preset_name = "Demo Output Link"
101102
self.presets = ["Studio Reference", "Flat", "Voice Focus"]
103+
self.analyzer_enabled = analyzer_enabled
102104
self.analyzer_levels = [0.0] * 10
103105
self.animation_step = 0
104106
self.loop = GLib.MainLoop()
@@ -120,6 +122,7 @@ def state(self) -> dict[str, GLib.Variant]:
120122
"output_sink": GLib.Variant("s", "Demo Output"),
121123
"output_preset_name": GLib.Variant("s", self.output_preset_name),
122124
"output_preset_auto_applied": GLib.Variant("b", True),
125+
"analyzer_enabled": GLib.Variant("b", self.analyzer_enabled),
123126
"background_mode": GLib.Variant("b", True),
124127
"start_at_login": GLib.Variant("b", False),
125128
"window_visible": GLib.Variant("b", False),
@@ -142,7 +145,9 @@ def emit_analyzer_levels_changed(self) -> None:
142145
return
143146

144147
levels = (
145-
[display_level(level) for level in self.analyzer_levels] if self.eq_enabled and self.routed else [0.0] * 10
148+
[display_level(level) for level in self.analyzer_levels]
149+
if self.eq_enabled and self.routed and self.analyzer_enabled
150+
else [0.0] * 10
146151
)
147152
self.connection.emit_signal(
148153
None,
@@ -238,5 +243,25 @@ def run(self) -> None:
238243
Gio.bus_unown_name(self.owner_id)
239244

240245

246+
def parse_args() -> argparse.Namespace:
247+
parser = argparse.ArgumentParser(description="Fake Mini EQ D-Bus service for GNOME Shell extension development.")
248+
monitor_group = parser.add_mutually_exclusive_group()
249+
monitor_group.add_argument(
250+
"--monitor-on",
251+
dest="analyzer_enabled",
252+
action="store_true",
253+
default=True,
254+
help="report analyzer monitoring as enabled; this is the default",
255+
)
256+
monitor_group.add_argument(
257+
"--monitor-off",
258+
dest="analyzer_enabled",
259+
action="store_false",
260+
help="report analyzer monitoring as disabled",
261+
)
262+
return parser.parse_args()
263+
264+
241265
if __name__ == "__main__":
242-
FakeMiniEqControl().run()
266+
args = parse_args()
267+
FakeMiniEqControl(analyzer_enabled=args.analyzer_enabled).run()

tools/run_gnome_extension_dev_shell.sh

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ mode="fake"
1515

1616
usage() {
1717
cat >&2 <<EOF
18-
Usage: $0 [--fake-control|--no-fake-control|--real-session-install]
18+
Usage: $0 [--fake-control|--fake-control-monitor-off|--no-fake-control|--real-session-install]
1919
20-
--fake-control Start isolated devkit Shell with fake Mini EQ D-Bus control service. Default.
21-
--no-fake-control Start isolated devkit Shell without a control service; tests disconnected UI.
22-
--real-session-install Install/reload the extension in the real GNOME session for real app integration.
20+
--fake-control Start isolated devkit Shell with fake Mini EQ D-Bus control service. Default.
21+
--fake-control-monitor-off Start fake control service with analyzer monitoring disabled.
22+
--no-fake-control Start isolated devkit Shell without a control service; tests disconnected UI.
23+
--real-session-install Install/reload the extension in the real GNOME session for real app integration.
2324
EOF
2425
}
2526

@@ -28,6 +29,9 @@ while (($# > 0)); do
2829
--fake-control)
2930
mode="fake"
3031
;;
32+
--fake-control-monitor-off)
33+
mode="fake-monitor-off"
34+
;;
3135
--no-fake-control)
3236
mode="no-fake"
3337
;;
@@ -56,7 +60,7 @@ if [[ ! -x "$pack_extension" ]]; then
5660
exit 1
5761
fi
5862

59-
if [[ "$mode" == "fake" && ! -x "$fake_control" ]]; then
63+
if [[ "$mode" != "no-fake" && "$mode" != "real-session" && ! -x "$fake_control" ]]; then
6064
echo "Fake control service not found or not executable: $fake_control" >&2
6165
exit 1
6266
fi
@@ -126,7 +130,9 @@ echo >&2
126130
echo "When the nested Shell starts, look for a virtual monitor/devkit surface." >&2
127131
echo "The top bar inside that nested Shell should show a 'Mini EQ' item." >&2
128132
if [[ "$mode" == "fake" ]]; then
129-
echo "A fake Mini EQ D-Bus service is started inside the nested session." >&2
133+
echo "A fake Mini EQ D-Bus service is started inside the nested session with monitoring enabled." >&2
134+
elif [[ "$mode" == "fake-monitor-off" ]]; then
135+
echo "A fake Mini EQ D-Bus service is started inside the nested session with monitoring disabled." >&2
130136
else
131137
echo "No Mini EQ D-Bus service is started; controls should show disconnected/disabled state." >&2
132138
fi
@@ -149,12 +155,20 @@ run_in_dev_bus() {
149155
}
150156
trap cleanup EXIT INT TERM
151157
152-
"$1" &
158+
fake_control="$1"
159+
fake_mode="$2"
160+
shift 2
161+
162+
fake_args=()
163+
if [[ "$fake_mode" == "fake-monitor-off" ]]; then
164+
fake_args+=(--monitor-off)
165+
fi
166+
167+
"$fake_control" "${fake_args[@]}" &
153168
fake_pid=$!
154169
sleep 0.5
155-
shift
156170
"$@"
157-
' bash "$fake_control" "${shell_command[@]}"
171+
' bash "$fake_control" "$mode" "${shell_command[@]}"
158172
}
159173

160174
if gnome-shell --help 2>&1 | grep -q -- '--devkit'; then

0 commit comments

Comments
 (0)