diff options
Diffstat (limited to 'shared/Status.qml')
| -rw-r--r-- | shared/Status.qml | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/shared/Status.qml b/shared/Status.qml index f32cd35..727f32b 100644 --- a/shared/Status.qml +++ b/shared/Status.qml @@ -33,9 +33,10 @@ Singleton { readonly property bool dnd: dndFile.value // Set by the game detector below, on its own file so it never fights the // manual toggle: presentation is the OR, and a game ending clears only its - // half. A manual "on" therefore survives a game session. - readonly property bool gaming: gamingFile.value - readonly property bool presentation: presFile.value || gamingFile.value + // half. A manual "on" therefore survives a game session. status.xbox is + // the same for a game on the Xbox, written by deck-it's xbox module. + readonly property bool gaming: gamingFile.value || xboxFile.value + readonly property bool presentation: presFile.value || gaming // 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 @@ -43,9 +44,13 @@ Singleton { // sound scripts read the file through statusctl, so this is only the // drawer's view of it. readonly property bool quiet: quietFile.value + // Keeps agent-lamp's bulb dark; agent-lamp reads the file itself, so + // this is only the drawer's view of it. + readonly property bool nolamp: nolampFile.value readonly property int activeCount: (root.dnd ? 1 : 0) + (root.presentation ? 1 : 0) + (root.nolock ? 1 : 0) + (root.quiet ? 1 : 0) + + (root.nolamp ? 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. @@ -81,6 +86,8 @@ Singleton { nolockFile.write(on); } else if (name === "quiet") { quietFile.write(on); + } else if (name === "nolamp") { + nolampFile.write(on); } } @@ -97,12 +104,13 @@ Singleton { 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); + else if (name === "nolamp") root.setMode("nolamp", !root.nolamp); } // The detector calls this every poll; a write on an unchanged value would // still land as an atomic write and re-fire the FileView watch for nothing. function setGaming(on) { - if (on !== root.gaming) gamingFile.write(on); + if (on !== gamingFile.value) gamingFile.write(on); } // The timed disable re-enables itself. Runs only while a deadline is @@ -224,6 +232,9 @@ Singleton { ModeFile { id: presFile; path: root.dir + "/status.presentation" } ModeFile { id: nolockFile; path: root.dir + "/status.nolock" } ModeFile { id: quietFile; path: root.dir + "/status.quiet" } + ModeFile { id: nolampFile; path: root.dir + "/status.nolamp" } // Written only by the game detector above, never by statusctl. ModeFile { id: gamingFile; path: root.dir + "/status.gaming" } + // Written only by deck-it while the Xbox runs a game. + ModeFile { id: xboxFile; path: root.dir + "/status.xbox" } } |
