Files
community-plugins/sharednd/plugin.toml
T
wioletowaandClaude Fable 5 5e9027da1a fix(sharednd): address review — stop/start race, onExit cleanup, no busy loop off niri
- Debounce stop transitions by 1 s (host update tick): a stop/start pair
  from switching casts collapses into no transition, so the async
  `dnd-set off` can no longer race the `dnd-status` query and drop
  ownership mid-share. Also stops DND flapping.
- Add onExit: if the plugin owns DND when disabled/reloaded, turn it off
  via a detached runAsync (survives VM teardown).
- Gate detection on NIRI_SOCKET + commandExists("niri") instead of an
  unconditional retry loop: on other compositors (or niri installed but
  not running) the service now spawns nothing. If NIRI_SOCKET is set but
  the binary is missing from PATH, warn once.
- Make the stream retry loop self-terminating (parent gone or niri
  socket removed): hard host exits skip process-group cleanup and were
  leaking orphaned loops that respawned `niri msg` every 3 s across
  sessions (observed 11 such orphans over 4 days).
- Bump version to 1.1.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-14 18:30:29 +03:00

42 lines
1.4 KiB
TOML

# ShareDND — automatic Do Not Disturb while the screen is being shared.
#
# A headless [[service]] follows `niri msg -j event-stream` and re-queries
# `niri msg -j casts` on every Cast* event. When the first screencast
# appears, notification DND is enabled through the host IPC
# (notification-dnd-set); when the last one disappears, DND is restored.
# If DND was already on before sharing started, the plugin does not take
# ownership and leaves it on afterwards (configurable). Detection only
# starts inside a niri session (NIRI_SOCKET + niri binary present); on
# other compositors the service is inert and spawns nothing.
#
# External requirements: niri (screencast events come from niri IPC).
id = "whyoolw/sharednd"
name = "ShareDND"
version = "1.1.0"
min_noctalia = "5.0.0"
author = "whyoolw"
license = "MIT"
dependencies = ["niri"]
tags = ["notifications", "privacy", "niri"]
icon = "screen-share"
description = "Enables notification Do Not Disturb while the screen is shared (niri screencast) and turns notifications back on when sharing stops. Requires niri."
[[setting]]
key = "only_active"
type = "bool"
label_key = "settings.only_active.label"
description_key = "settings.only_active.description"
default = false
[[setting]]
key = "always_off_after"
type = "bool"
label_key = "settings.always_off_after.label"
description_key = "settings.always_off_after.description"
default = false
[[service]]
id = "service"
entry = "service.luau"