lemonmash

i call my homies comrade

  • he

hmu if your tasty like burger

posts from @lemonmash tagged #mpv

also:

pfn_macro.lua:

local delimiter = package.config:sub(1,1)
template_property = mp.get_property('screenshot-template')

function replace_screenshot_path(event)
	local path = mp.get_property('working-directory') .. delimiter .. mp.get_property('path')
	local stripped_path = path:gsub("%." .. delimiter, ""):match("^(.+)" .. delimiter)
	local parent_folder_name = stripped_path:gsub("^(.+)" .. delimiter, "")
	mp.set_property('screenshot-template', template_property:gsub("%%pfn", parent_folder_name))
end
mp.register_event("file-loaded", replace_screenshot_path)

Usage:
Drop the script in your scripts folder.
screenshot-template can now be used with the additional macro %pfn that denotes the parent folder name (I use this to save my screenshots into folders based on title).
eg. screenshot-template="%pfn\%F%03n"
Works cross-platform.