diff options
| author | Robert Günzler <r@gnzler.io> | 2022-11-18 17:27:06 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2022-11-18 18:38:19 +0100 |
| commit | d5c5b670232ba2bf29e76ef91716048a2fa5eea0 (patch) | |
| tree | 66fe1bdc9ee39a80ed4cb3d364fe3e7221536337 | |
| parent | 2399faea459b701d2cbab191bb1ff875462b6568 (diff) | |
mpv: add yanktime script
| -rw-r--r-- | .config/mpv/input.conf | 1 | ||||
| -rw-r--r-- | .config/mpv/scripts/yanktime.lua | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/.config/mpv/input.conf b/.config/mpv/input.conf index 9c74d0f..76b3e25 100644 --- a/.config/mpv/input.conf +++ b/.config/mpv/input.conf @@ -125,6 +125,7 @@ Alt+y script-binding autocrop/toggle_crop #! utils > autocrop Alt+m script-binding mouse_coords #! utils > mouse coords g script-message contact-sheet-close; script-message playlist-view-toggle #! utils > playlist view c script-message playlist-view-close; script-message contact-sheet-toggle #! utils > contact sheet +y-y script_binding yanktime/yanktime #! utils > yanktime # 1 ignore # 2 ignore diff --git a/.config/mpv/scripts/yanktime.lua b/.config/mpv/scripts/yanktime.lua new file mode 100644 index 0000000..77b856e --- /dev/null +++ b/.config/mpv/scripts/yanktime.lua @@ -0,0 +1,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) |