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 | |
| parent | 280b499ba9c176bd09ce02cb3af2f52922e7e5db (diff) | |
modified bin/setbg, created scripts/keep-window-size.lua
Diffstat (limited to 'ar')
| -rw-r--r-- | ar/.config/mpv/scripts/keep-window-size.lua | 23 | ||||
| -rwxr-xr-x | ar/.local/bin/setbg | 2 |
2 files changed, 24 insertions, 1 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) diff --git a/ar/.local/bin/setbg b/ar/.local/bin/setbg index 66f6819..fc36b5a 100755 --- a/ar/.local/bin/setbg +++ b/ar/.local/bin/setbg @@ -68,4 +68,4 @@ fi xwallpaper --zoom "$bgloc" # If running, dwm hit the key to refresh the color scheme. -pidof dwm >/dev/null && xdotool key super+F5 +pidof dwm >/dev/null && xdotool key ctrl+F5 |
