Created
December 9, 2025 11:09
-
-
Save bunkbail/84f7fc4f8b027d253d94d3792165a589 to your computer and use it in GitHub Desktop.
Fix mpv hanging on exit with lsfg-vk on linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local utils = require 'mp.utils' | |
| mp.register_event("shutdown", function() | |
| mp.msg.warn("Shutdown detected. Saving state and force killing...") | |
| -- 1. Manually force mpv to save the "watch later" position immediately. | |
| mp.command("write-watch-later-config") | |
| -- 2. Get the PID | |
| local pid = mp.get_property("pid") | |
| -- 3. Execute the kill command | |
| os.execute("kill -9 " .. pid) | |
| end) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Put the lua script inside your mpv/scripts folder