Draw the lock screen video from the OWE lock feed

The shell drops its own player: BackgroundMedia is image-only, and the
lock loads Owe.LockFeedSurface through a Loader, so a system without the
module shows no lock video instead of losing the whole lock screen. The
feed pauses per output when the panel blanks or power saver turns on.

The lock view keeps its still effect path and darkens the feed for
legibility. QtMultimedia and the shell video pause policy are gone, and
the base package list requires owe and owe-lockfeed instead.
This commit is contained in:
Bjarne Oeverli committed 2026-09-18 22:49:47 +02:00
1 parent 2e3142a105
commit eff410f91e
8 files changed
+92 -248

No files matched your search

+44 -67
View File
@@ -9,15 +9,13 @@ const fs = require('fs')
const utilQml = fs.readFileSync(path.join(root, 'shell/Commons/Util.qml'), 'utf8')
const mediaQml = fs.readFileSync(path.join(root, 'shell/Ui/BackgroundMedia.qml'), 'utf8')
const videoQml = fs.readFileSync(path.join(root, 'shell/Ui/BackgroundVideo.qml'), 'utf8')
const backgroundQml = fs.readFileSync(path.join(root, 'shell/plugins/background/Background.qml'), 'utf8')
const lockQml = fs.readFileSync(path.join(root, 'shell/plugins/lock/LockView.qml'), 'utf8')
const lockFeedQml = fs.readFileSync(path.join(root, 'shell/plugins/lock/LockFeedSurface.qml'), 'utf8')
const themeSwitcher = fs.readFileSync(path.join(root, 'bin/omarchy-theme-switcher'), 'utf8')
const quattroUpgrade = fs.readFileSync(path.join(root, 'bin/omarchy-upgrade-to-quattro'), 'utf8')
const multimediaMigration = fs.readFileSync(path.join(root, 'migrations/1786609204.sh'), 'utf8')
const barTextColor = fs.readFileSync(path.join(root, 'bin/omarchy-bar-text-color'), 'utf8')
const menuImages = fs.readFileSync(path.join(root, 'bin/omarchy-menu-images'), 'utf8')
const lockView = fs.readFileSync(path.join(root, 'shell/plugins/lock/LockView.qml'), 'utf8')
const lockService = fs.readFileSync(path.join(root, 'shell/plugins/lock/Service.qml'), 'utf8')
const batteryService = fs.readFileSync(path.join(root, 'shell/plugins/services/battery/Service.qml'), 'utf8')
const themeSet = fs.readFileSync(path.join(root, 'bin/omarchy-theme-set'), 'utf8')
@@ -29,50 +27,45 @@ assert(
'shared media helper identifies video paths without truncating valid local names'
)
assert(
videoQml.includes('loops: MediaPlayer.Infinite') &&
videoQml.includes('autoPlay: root.playbackEnabled') &&
videoQml.includes('fillMode: VideoOutput.PreserveAspectCrop') &&
/imageUrl: path && !Util\.isVideoPath\(path\) \? Util\.fileUrl\(path\) \+ \(version \? "\?v=" \+ version : ""\) : ""/.test(mediaQml) &&
/videoUrl: path && Util\.isVideoPath\(path\) && videoEnabled \? Util\.fileUrl\(path\) : ""/.test(mediaQml),
'background media plays aspect-cropped videos on a loop, and hands each loader only its own kind of file'
!fs.existsSync(path.join(root, 'shell/Ui/BackgroundVideo.qml')),
'the shell keeps no video player of its own'
)
assert(
videoQml.includes('MediaPlayer.LoadedMedia') &&
videoQml.includes('primePauseTimer') &&
videoQml.includes('mediaGeneration') &&
videoQml.includes('videoSink') &&
videoQml.includes('onVideoFrameChanged') &&
videoQml.includes('MediaPlayer.BufferedMedia') &&
videoQml.includes('mediaStatus !== MediaPlayer.BufferedMedia') &&
videoQml.includes('interval: 1000') &&
videoQml.includes('interval: 50') &&
videoQml.includes('frameReceived') &&
videoQml.includes('output.clearOutput()') &&
!videoQml.includes('KeepLastFrame') &&
/onPlaybackEnabledChanged:[\s\S]*?if \(playbackEnabled\) player\.play\(\)[\s\S]*?else player\.pause\(\)/.test(videoQml) &&
videoQml.includes('primingGeneration') &&
videoQml.includes('player.play()') &&
videoQml.includes('player.pause()'),
'paused video sources are primed to display their first frame'
/imageUrl: path && !video \? Util\.fileUrl\(path\) \+ \(version \? "\?v=" \+ version : ""\) : ""/.test(mediaQml) &&
/active: root\.path !== "" && !root\.video/.test(mediaQml) &&
!mediaQml.includes('videoUrl') &&
!mediaQml.includes('videoLoader') &&
!mediaQml.includes('videoEnabled'),
'background media is image-only: it loads stills and leaves videos to OWE'
)
assert(
!/^\s*import QtMultimedia/m.test(mediaQml) &&
mediaQml.includes('source: "BackgroundVideo.qml"'),
'the still-image path never imports QtMultimedia, so image-only sessions do not map it'
!/^\s*import QtMultimedia/m.test(backgroundQml) &&
!/^\s*import QtMultimedia/m.test(lockQml) &&
!backgroundQml.includes('MediaPlayer') &&
!lockQml.includes('MediaPlayer'),
'no shell surface builds a Qt Multimedia pipeline'
)
assert(
!/^\s*Video\s*\{/m.test(videoQml) &&
!videoQml.includes('AudioOutput {') &&
!videoQml.includes('audioOutput:') &&
!mediaQml.includes('audioEnabled') &&
!backgroundQml.includes('audioEnabled') &&
!lockQml.includes('audioEnabled'),
'the shell builds no audio output: OWE plays the desktop video audio and the lock stays silent'
/^import Owe\.LockFeed$/m.test(lockFeedQml) &&
lockFeedQml.includes('LockFeed {') &&
lockFeedQml.includes('active: root.feedEnabled') &&
lockQml.includes('source: "LockFeedSurface.qml"') &&
lockQml.includes('active: root.video') &&
/feedActive: root\.video && root\.loadBackground && !root\.displaysBlank && !root\.powerSaverActive/.test(lockQml) &&
/property: "feedEnabled"[\s\S]*?value: root\.feedActive/.test(lockQml),
'the lock screen shows video through the OWE lock feed, loaded so a missing module costs only the video'
)
assert(
/property: "mediaSource"[\s\S]*?when: videoLoader\.item !== null && Util\.isVideoPath\(root\.path\)\s*\n\s*restoreMode: Binding\.RestoreNone/.test(mediaQml) &&
!videoQml.includes('Component.onDestruction'),
'a player on its way out keeps its source, so nothing is left loading for its destructor to cancel'
!/^import Owe\./m.test(lockQml),
'the lock view itself carries no foreign import, so the lock still loads without the feed module'
)
assert(
lockQml.includes('path: root.video ? "" : root.backgroundPath') &&
lockQml.includes('visible: !root.video') &&
lockQml.includes('visible: root.video') &&
!lockQml.includes('wallpaper.video'),
'the lock screen keeps its image effect for stills and shows the feed for videos'
)
assert(
!mediaQml.includes('mipmap'),
@@ -82,13 +75,12 @@ assert(
/instant \|\| !displayedBackground \|\| isVideo\(path\) \|\| isVideo\(displayedBackground\)[\s\S]*displayedBackground = finalPath/.test(backgroundQml),
'video switches bypass the image-only reveal stack and use the durable background path'
)
assert(backgroundQml.includes('BackgroundMedia {') && lockQml.includes('BackgroundMedia {'), 'desktop and lock screen share video-capable media rendering')
assert(backgroundQml.includes('BackgroundMedia {') && lockQml.includes('BackgroundMedia {'), 'desktop and lock screen share still rendering')
assert(
backgroundQml.includes('videoEnabled: false') &&
/property bool videoEnabled: true/.test(mediaQml) &&
/active: root\.path !== "" && root\.video && !root\.reloading && root\.videoEnabled/.test(mediaQml) &&
!lockQml.includes('videoEnabled'),
'the desktop hands video backgrounds to OWE, and the lock keeps its own playback'
!backgroundQml.includes('videoEnabled') &&
!backgroundQml.includes('displayedReloads') &&
!mediaQml.includes('displayedReloads'),
'the desktop hands video backgrounds to OWE with no player switch to carry'
)
assert(
!backgroundQml.includes('playbackEnabled') &&
@@ -99,19 +91,6 @@ assert(
!backgroundQml.includes('omarchy.battery'),
'the desktop no longer carries the shell video pause policy'
)
assert(
lockQml.includes('source: wallpaper.video ? null : wallpaper') &&
lockQml.includes('visible: !wallpaper.video') &&
lockQml.includes('visible: wallpaper.video'),
'lock screen bypasses its image effect for video output'
)
assert(
/if \(displayedBackground === finalPath\) displayedReloads \+= 1/.test(backgroundQml) &&
backgroundQml.includes('reloads: root.displayedReloads') &&
/active: root\.path !== "" && root\.video && !root\.reloading/.test(mediaQml) &&
/onReloadsChanged: \{[\s\S]*?reloading = true/.test(mediaQml),
'a theme switch that keeps the video path still reopens the replaced file'
)
assert(
barTextColor.includes('magick "$background_path[0]"'),
'bar colour sampling reads one frame instead of decoding a whole video'
@@ -161,13 +140,12 @@ assert(
'a locked video wallpaper follows what each panel actually did, not only what the lock asked for'
)
assert(
lockView.includes('playbackEnabled: root.loadBackground && !root.displaysBlank') &&
lockView.includes('&& !root.powerSaverActive') &&
/feedActive: root\.video && root\.loadBackground && !root\.displaysBlank && !root\.powerSaverActive/.test(lockQml) &&
/displaysBlank: root\.screenBlank\(/.test(lockService) &&
/powerSaverActive: root\.powerSaverActive/.test(lockService) &&
/function runBlank\(\) \{\s*\n\s*root\.displaysBlank = true/.test(lockService) &&
/function runWake\(\) \{\s*\n\s*root\.displaysBlank = false/.test(lockService),
'the lock screen stops playback once displays go dark or power-saver is active'
'the lock feed stops once displays go dark or power-saver is active'
)
assert(
batteryService.includes('property string activePowerProfile') &&
@@ -184,10 +162,6 @@ assert(
'theme switcher previews video-only themes, named preview files included'
)
assert(quattroUpgrade.includes("-iname '*.mp4'"), 'Quattro upgrade can seed a video-only theme background')
assert(
multimediaMigration.includes('omarchy-pkg-add qt6-multimedia qt6-multimedia-ffmpeg'),
'existing Quattro installations receive video playback dependencies'
)
JS
test_tmp=$(mktemp -d)
@@ -301,8 +275,11 @@ timeout_rows=$(PATH="$test_tmp/bin:$PATH" XDG_CACHE_HOME="$timeout_cache" \
timeout_marker=$(find "$timeout_cache/omarchy/image-selector" -maxdepth 1 -type f -name '*.failed' -print -quit)
[[ -z $timeout_marker ]] || fail "a timed out video is left to retry rather than remembered as failed"
grep -qx 'qt6-multimedia' "$ROOT/install/omarchy-base.packages" || fail "Qt Multimedia runtime is a base package"
grep -qx 'qt6-multimedia-ffmpeg' "$ROOT/install/omarchy-base.packages" || fail "Qt Multimedia FFmpeg backend is a base package"
grep -qx 'owe' "$ROOT/install/omarchy-base.packages" || fail "OWE is a base package"
grep -qx 'owe-lockfeed' "$ROOT/install/omarchy-base.packages" || fail "the OWE lock feed module is a base package"
if grep -qx 'qt6-multimedia' "$ROOT/install/omarchy-base.packages"; then
fail "Qt Multimedia is no longer needed by the shell"
fi
pass "menu image generator creates thumbnails consumed by the picker"
pass "direct picker generates and reuses still thumbnails"
@@ -310,7 +287,7 @@ pass "direct picker omits videos whose thumbnails cannot be generated"
pass "a rejected video is remembered so it costs nothing on the next open"
pass "a timed out video is left to retry"
pass "a locked video wallpaper follows the panels' real DPMS state"
pass "Qt Multimedia playback dependencies are declared"
pass "OWE and its lock feed module are declared"
source <(awk '
/^(is_video_path|snapshot_background_path|background_transition_uses_snapshots|choose_theme_background|choose_staged_theme_background|set_theme_background)\(\) \{/ { copying=1 }