diff options
Diffstat (limited to 'bin/wb-icon')
| -rwxr-xr-x | bin/wb-icon | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/bin/wb-icon b/bin/wb-icon index 9c29c60..b8f91cc 100755 --- a/bin/wb-icon +++ b/bin/wb-icon @@ -10,7 +10,6 @@ # # wb-icon volume # reads wpctl, prints the matching icon # wb-icon mic -# wb-icon idle <activated|deactivated> # wb-icon --selftest # every name this bar asks for must resolve # # Icons keep their own colours: this desktop's icon theme draws them with @@ -44,10 +43,6 @@ ICONS = { "muted": "microphone-sensitivity-muted", "on": "audio-input-microphone", }, - "idle": { - "activated": "x-office-presentation", - "deactivated": "preferences-desktop-screensaver", - }, } @@ -116,9 +111,18 @@ def selftest(): ] clock_icons = ["x-office-calendar", "clock"] + # Presentation mode is a custom module: statusctl emits the state as a + # class and modules.css picks the icon, so these names appear nowhere in + # this file. They are still the bar's icons, so they are checked here. + presentation_icons = [ + "preferences-desktop-screensaver", # off + "x-office-presentation", # on + "dialog-warning", # no state file + ] + names = sorted( {n for group in ICONS.values() for n in group.values()} - | set(workspace_icons) | set(clock_icons) + | set(workspace_icons) | set(clock_icons) | set(presentation_icons) ) missing = [n for n in names if not lookup(n)] for n in names: @@ -156,13 +160,6 @@ def main(argv): label = "muted" if state == "muted" else f"{pct}%" return emit(ICONS["mic"][state], f"Microphone: {label}") - if what == "idle": - state = argv[2] if len(argv) > 2 else "deactivated" - state = state if state in ICONS["idle"] else "deactivated" - on = state == "activated" - return emit(ICONS["idle"][state], - f"Presentation mode: {'on' if on else 'off'}") - print(f"wb-icon: unknown subject {what!r}", file=sys.stderr) return 2 |
