Shutdown controller for mpv that allows shutdown after a set number of media files.
This script was created to allow automatic shutdown of the system after a specific number of files played in mpv.
It supports both playlist-based playback and automatic folder loading (autoload), even when the playlist is not populated (like in uosc).
The shutdown can be triggered either:
- after a given number of files (
nfiles) - at the end of the playlist
- on mpv closing, depending on configuration
- set the number of files to trigger shutdown (
nfiles) - automatic folder scanning for detecting current position (with extensions filter)
- handles idle states like
--keep-openand--idlewith optional timer - support for scripts like
autoload.luaoruosc - optional shutdown at playlist end
- optional shutdown on mpv exit (closing)
- manual info on remaining items
- configurable extensions and behavior via
.conffile - keybinds to interactively set file count and check remaining
Place the OS_Shutdown.lua file into mpv’s scripts folder and the OS_Shutdown.conf file into the script-opts folder.
These can be customized via config.
Ctrl+ì - Set the number of files to shutdown after (or disable shutdown with any non-numeric entry)
Ctrl+^ - Show info on remaining files (dynamic display)