Expose the shell's remaining UI-only toggles over IPC
Every toggle you could only reach by mouse or panel hotkey is now scriptable through omarchy-shell: - omarchy.bluetooth toggleBluetooth — the radio (was right-click / B) - omarchy.network toggleNetwork — Wi-Fi on/off (was W in the panel) - omarchy.tailscale toggleTailscale — the connection as one call, matching the widget's right-click, instead of separate up/down - omarchy.clock toggleWeekStart — calendar week start (was W) - shell toggleBarTransparency — the bar background (was manage UI only) Bluetooth and network follow the power/monitor pattern: manageIpc: false so the panel owns the target's single IpcHandler and can extend it past the inherited lifecycle methods. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Fable 5
parent
2cff67fa45
commit
f54edbeba8
@@ -12,6 +12,9 @@ Panel {
|
||||
id: root
|
||||
moduleName: "omarchy.bluetooth"
|
||||
ipcTarget: "omarchy.bluetooth"
|
||||
// manageIpc: false so this panel can own the single IpcHandler the target
|
||||
// permits — needed for the toggleBluetooth method below.
|
||||
manageIpc: false
|
||||
|
||||
// Address -> "connecting" | "disconnecting" | "forgetting".
|
||||
// The actual Bluetooth sequencing lives in bin/omarchy-bluetooth-device;
|
||||
@@ -515,6 +518,17 @@ Panel {
|
||||
adapter.enabled = !adapter.enabled
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "omarchy.bluetooth"
|
||||
|
||||
function open() { root.open() }
|
||||
function close() { root.close() }
|
||||
function show() { root.open() }
|
||||
function hide() { root.close() }
|
||||
function toggle() { root.toggle() }
|
||||
function toggleBluetooth() { root.toggleBluetooth() }
|
||||
}
|
||||
|
||||
BarIconButton {
|
||||
id: button
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -73,6 +73,10 @@ BarWidget {
|
||||
if (panelLoader.item) panelLoader.item.toggle()
|
||||
}
|
||||
|
||||
function toggleWeekStart() {
|
||||
if (panelLoader.item) panelLoader.item.toggleWeekStart()
|
||||
}
|
||||
|
||||
// The clock fills more slot than it paints a mark for, at both
|
||||
// orientations: horizontally it is a text label in a padded slot, so the
|
||||
// dot takes the label width; vertically it is a stack of icon-sized lines,
|
||||
@@ -127,6 +131,7 @@ BarWidget {
|
||||
|
||||
function refresh(): void { root.broadcast("refresh") }
|
||||
function cycleFormat(): void { root.cycleFormat() }
|
||||
function toggleWeekStart(): void { root.toggleWeekStart() }
|
||||
function open(): void { root.open() }
|
||||
function close(): void { root.close() }
|
||||
function show(): void { root.open() }
|
||||
|
||||
@@ -12,6 +12,9 @@ Panel {
|
||||
id: root
|
||||
moduleName: "omarchy.network"
|
||||
ipcTarget: "omarchy.network"
|
||||
// manageIpc: false so this panel can own the single IpcHandler the target
|
||||
// permits — needed for the toggleNetwork method below.
|
||||
manageIpc: false
|
||||
|
||||
// Centralized close so callers can't forget to drop the passphrase prompt.
|
||||
function close() {
|
||||
@@ -214,6 +217,17 @@ Panel {
|
||||
Qt.callLater(function() { root.refresh(true) })
|
||||
}
|
||||
|
||||
IpcHandler {
|
||||
target: "omarchy.network"
|
||||
|
||||
function open() { root.open() }
|
||||
function close() { root.close() }
|
||||
function show() { root.open() }
|
||||
function hide() { root.close() }
|
||||
function toggle() { root.toggle() }
|
||||
function toggleNetwork() { root.toggleNetwork() }
|
||||
}
|
||||
|
||||
function activateHeader() {
|
||||
if (headerIndex === qrHeaderIndex) showWifiQr()
|
||||
else if (headerIndex === toggleHeaderIndex) toggleNetwork()
|
||||
|
||||
@@ -373,6 +373,7 @@ Panel {
|
||||
function refresh(): string { tailscale.refresh(); return "ok" }
|
||||
function up(): string { tailscale.loginOrUp(); return "ok" }
|
||||
function down(): string { tailscale.down(); return "ok" }
|
||||
function toggleTailscale(): string { tailscale.toggleTailscale(); return "ok" }
|
||||
function status(): string { return tailscale.statusText }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user