diff options
Diffstat (limited to 'shared/Status.qml')
| -rw-r--r-- | shared/Status.qml | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/shared/Status.qml b/shared/Status.qml index 128256c..523ea7d 100644 --- a/shared/Status.qml +++ b/shared/Status.qml @@ -39,6 +39,10 @@ Singleton { // Stored as "auto-lock disabled", so the missing-file default of off is // the wanted default of locking on. The row inverts it for the label. readonly property bool nolock: nolockFile.value + // Mutes the Claude and opencode sounds; their popups are unaffected. The + // sound scripts read the file through statusctl, so this is only the + // drawer's view of it. + readonly property bool quiet: quietFile.value // Breaktimer, read only. The daemon publishes these three files and owns // them; the shell calls verbs and never writes them, because the daemon @@ -58,7 +62,7 @@ Singleton { readonly property bool btPaused: root.btState === "paused" readonly property int activeCount: (root.dnd ? 1 : 0) + (root.presentation ? 1 : 0) - + (root.nolock ? 1 : 0) + + (root.nolock ? 1 : 0) + (root.quiet ? 1 : 0) // Set once by shell.qml. IdleInhibitor does nothing with a null window, // and the singleton has no window of its own to offer. @@ -74,6 +78,7 @@ Singleton { // recorded prior values depend on which file loads first. property bool dndBeforePresentation: false property bool nolockBeforePresentation: false + property bool quietBeforePresentation: false // Deadline for a timed disable, owned by the singleton rather than the row // because the drawer page (and so the row) is destroyed on close while the @@ -91,6 +96,8 @@ Singleton { // Any write clears a pending deadline; the timed path sets it back. root.nolockUntil = 0; nolockFile.write(on); + } else if (name === "quiet") { + quietFile.write(on); } } @@ -106,6 +113,7 @@ Singleton { if (name === "dnd") root.setMode("dnd", !root.dnd); else if (name === "presentation") root.setMode("presentation", !root.presentation); else if (name === "nolock") root.setMode("nolock", !root.nolock); + else if (name === "quiet") root.setMode("quiet", !root.quiet); } // The detector calls this every poll; a write on an unchanged value would @@ -132,14 +140,17 @@ Singleton { if (root.presentation) { root.dndBeforePresentation = root.dnd; root.nolockBeforePresentation = root.nolock; + root.quietBeforePresentation = root.quiet; root.setMode("dnd", true); root.setMode("nolock", true); + root.setMode("quiet", true); // pause/resume write the state file whether or not a daemon // runs, so send the verb only when one exists. if (root.btRunning) root.runBreaktimer("pause"); } else { root.setMode("dnd", root.dndBeforePresentation); root.setMode("nolock", root.nolockBeforePresentation); + root.setMode("quiet", root.quietBeforePresentation); if (root.btRunning) root.runBreaktimer("resume"); } } @@ -303,6 +314,7 @@ Singleton { ModeFile { id: dndFile; path: root.dir + "/status.dnd" } ModeFile { id: presFile; path: root.dir + "/status.presentation" } ModeFile { id: nolockFile; path: root.dir + "/status.nolock" } + ModeFile { id: quietFile; path: root.dir + "/status.quiet" } // Written only by the game detector above, never by statusctl. ModeFile { id: gamingFile; path: root.dir + "/status.gaming" } |
