diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-03-16 15:54:39 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2026-03-16 15:54:39 +0900 |
| commit | d043f8be7e58ddf61e8f296eb369d3cef87d96df (patch) | |
| tree | 1b54964a70de381de087dbbfc01e49efb83abb8e /ar/.config | |
| parent | 280b499ba9c176bd09ce02cb3af2f52922e7e5db (diff) | |
modified bin/setbg, created scripts/keep-window-size.lua
Diffstat (limited to 'ar/.config')
| -rw-r--r-- | ar/.config/mpv/scripts/keep-window-size.lua | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ar/.config/mpv/scripts/keep-window-size.lua b/ar/.config/mpv/scripts/keep-window-size.lua new file mode 100644 index 0000000..a7ea077 --- /dev/null +++ b/ar/.config/mpv/scripts/keep-window-size.lua @@ -0,0 +1,23 @@ +-- keep-window-size.lua +-- Preserves window size when playlist advances to the next file. + +local saved_w = nil +local restoring = false + +mp.observe_property("osd-width", "number", function(_, w) + if w and w > 0 and not restoring then + saved_w = w + end +end) + +mp.register_event("video-reconfig", function() + if not saved_w then return end + local dw = mp.get_property_number("dwidth") + if dw and dw > 0 then + restoring = true + mp.set_property_number("window-scale", saved_w / dw) + mp.add_timeout(0.3, function() + restoring = false + end) + end +end) |
