mirror of
https://github.com/NotAShelf/nyxexprs.git
synced 2024-11-05 04:51:15 +00:00
13 lines
437 B
Lua
13 lines
437 B
Lua
|
local HISTFILE = (os.getenv('XDG_DATA_HOME') or os.getenv('HOME')) .. '/mpv/history.log';
|
||
|
|
||
|
mp.register_event('file-loaded', function()
|
||
|
local title, fp;
|
||
|
|
||
|
title = mp.get_property('media-title');
|
||
|
title = (title == mp.get_property('filename') and "" or (' (%s)'):format(title));
|
||
|
|
||
|
fp = io.open(HISTFILE, 'a+');
|
||
|
fp:write(('[%s] %s%s\n'):format(os.date('%Y-%m-%d %X'), mp.get_property('path'), title));
|
||
|
fp:close();
|
||
|
end)
|