feat(waybar): combined power menu on the battery + profile icons
All checks were successful
Check / eval (push) Successful in 3m5s

Item 36(b). Adds `nomarchy-menu powermgmt` — one flat rofi menu of power
Profile rows (→ powerprofilesctl set) + Charge limit rows (→ the same
theme-sync writer batterylimit uses), each half self-gating on its
hardware. No backend duplication; Custom charge stays in the dedicated
batterylimit picker.

Opened two ways (Bernardo's call): the Waybar battery icon AND the
power-profile icon — the profile icon's click flips from cycle → menu.
Wired in waybar.nix and all four whole-swaps (parity). Named `powermgmt`
to avoid the whole-swaps' existing `custom/powermenu` shutdown button
(→ nomarchy-menu power), which is left untouched. The granular System ▸
Power profile / Battery limit rows stay ("keep both").
nomarchy-powerprofile-cycle kept as a standalone bin, now unbound by
default.

Verified: V0 green; V1 HM built (bash -n) — powermgmt case ships, the
generated waybar-config.json wires both icons (2 hits), all four jsoncs
re-wired and still parse, shutdown buttons intact. Click→menu→apply is
V3 (queued).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Bernardo Magri
2026-07-08 14:40:40 +01:00
parent 714fbd1daf
commit 1143e67f95
9 changed files with 101 additions and 33 deletions

View File

@@ -135,14 +135,14 @@
"",
""
],
"on-click": "nomarchy-menu power",
"on-click": "nomarchy-menu powermgmt",
"tooltip-format": "Battery status"
},
"custom/powerprofile": {
"return-type": "json",
"interval": 5,
"exec": "nomarchy-powerprofile-status",
"on-click": "nomarchy-powerprofile-cycle"
"on-click": "nomarchy-menu powermgmt"
},
"tray": {
"icon-size": 15,

View File

@@ -111,7 +111,7 @@
"return-type": "json",
"interval": 5,
"exec": "nomarchy-powerprofile-status",
"on-click": "nomarchy-powerprofile-cycle"
"on-click": "nomarchy-menu powermgmt"
},
"battery": {
"interval": 30,
@@ -129,7 +129,7 @@
"",
""
],
"on-click": "nomarchy-menu power",
"on-click": "nomarchy-menu powermgmt",
"tooltip-format": "Battery status"
},
"custom/vpn": {

View File

@@ -64,7 +64,7 @@
"format-plugged": "<span size='13pt'></span> {capacity}%",
"format-full": " 100%",
"format-icons": ["", "", "", "", ""],
"on-click": "nomarchy-menu power",
"on-click": "nomarchy-menu powermgmt",
"tooltip-format": "Battery status"
},
@@ -85,7 +85,7 @@
"return-type": "json",
"interval": 5,
"exec": "nomarchy-powerprofile-status",
"on-click": "nomarchy-powerprofile-cycle"
"on-click": "nomarchy-menu powermgmt"
},
"custom/recording": {

View File

@@ -63,7 +63,7 @@
"format-charging": "<span size='13pt'></span> {capacity}%",
"format-plugged": "<span size='13pt'></span> {capacity}%",
"format-icons": ["", "", "", "", ""],
"on-click": "nomarchy-menu power",
"on-click": "nomarchy-menu powermgmt",
"tooltip-format": "Battery status"
},
@@ -84,7 +84,7 @@
"return-type": "json",
"interval": 5,
"exec": "nomarchy-powerprofile-status",
"on-click": "nomarchy-powerprofile-cycle"
"on-click": "nomarchy-menu powermgmt"
},
"custom/recording": {