Let OWE own video backgrounds while it runs
The background plugin now watches for the OWE daemon socket. While OWE is running, the desktop yields video playback to it and the shell keeps stills. The lock screen keeps its own playback. This lets Omarchy cooperate with OWE without OWE editing shell.json, so the engine can ship as a package. Add a package-list note that owe-wallpaper-engine must be added once it is packaged.
This commit is contained in:
5 files changed
+41
-3
No files matched your search
@@ -8,6 +8,10 @@ Item {
|
||||
property int version: 0
|
||||
property bool playbackEnabled: true
|
||||
property bool audioEnabled: false
|
||||
// The desktop yields video playback to OWE while it runs, so two engines
|
||||
// never decode the same file. The lock screen leaves this off and keeps its
|
||||
// own playback.
|
||||
property bool deferVideo: false
|
||||
// Bumped when the file behind an unchanged path may have been replaced.
|
||||
// Images cache-bust through version; a video is rebuilt, since FFmpeg
|
||||
// would read a query as part of the filename.
|
||||
@@ -37,7 +41,7 @@ Item {
|
||||
Loader {
|
||||
id: videoLoader
|
||||
anchors.fill: parent
|
||||
active: root.path !== "" && root.video && !root.reloading
|
||||
active: root.path !== "" && root.video && !root.reloading && !root.deferVideo
|
||||
source: "BackgroundVideo.qml"
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,25 @@ Item {
|
||||
// services so playback can stop whenever nothing can see the wallpaper.
|
||||
property var shell: null
|
||||
|
||||
// When the OWE wallpaper engine is running, it owns video backgrounds. This
|
||||
// plugin keeps stills, which OWE hands back to it, and the lock screen keeps
|
||||
// its own playback.
|
||||
property bool oweActive: false
|
||||
|
||||
Process {
|
||||
id: oweStatusProc
|
||||
command: ["bash", "-c", "test -S \"${XDG_RUNTIME_DIR:-/run/user/$(id -u)}/owe/owed.sock\""]
|
||||
onExited: root.oweActive = (exitCode === 0)
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: oweStatusTimer
|
||||
interval: 5000
|
||||
repeat: true
|
||||
running: true
|
||||
onTriggered: if (!oweStatusProc.running) oweStatusProc.running = true
|
||||
}
|
||||
|
||||
// Stop a video wallpaper's decoding whenever it is covered. Qt's FFmpeg
|
||||
// engine drives its own clock, so an unseen player keeps decoding until it
|
||||
// is told not to — a locked laptop would otherwise decode until it died.
|
||||
@@ -204,7 +223,10 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: refreshBackground()
|
||||
Component.onCompleted: {
|
||||
oweStatusProc.running = true
|
||||
refreshBackground()
|
||||
}
|
||||
|
||||
Variants {
|
||||
model: Quickshell.screens
|
||||
@@ -264,6 +286,7 @@ Item {
|
||||
anchors.fill: parent
|
||||
path: root.displayedBackground
|
||||
reloads: root.displayedReloads
|
||||
deferVideo: root.oweActive
|
||||
playbackEnabled: !root.sessionObscured && !root.powerSaverActive && !panel.fullscreenHere
|
||||
audioEnabled: panel.firstScreen
|
||||
onReadyChanged: {
|
||||
|
||||
Reference in new issue
Block a user