summary refs log tree commit diff
path: root/.config/mpv/scripts/yanktime.lua
blob: 77b856ea3d26cec4c2afc281182300ed3e816845 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
local mp = require('mp')

function yanktime()
    local s = mp.get_property_native('playback-time')
    local ts = string.format("%.2d:%.2d:%.2d.%.3d", s/(60*60), s/60%60, s%60, (s%1)*1000)
    mp.commandv('run', 'wl-copy', ts)
    mp.msg.info('playback-time yanked: ' .. ts)
    mp.osd_message('playback-time yanked: ' .. ts)
end

mp.add_key_binding("y-y", mp.get_script_name(), yanktime)