Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function escape(s)
- return (s:gsub('\'', '\'\\\'\''))
- end
- local function copy_subs()
- local subs = mp.get_property('sub-text')
- if type(subs) ~= 'string' then
- return
- end
- subs = subs:gsub('\n', '')
- local a = "export LANG=en_US.UTF-8; echo '" .. escape(subs) .. "' | xclip -selection c"
- os.execute(a)
- mp.osd_message('Subs copied.')
- end
- mp.add_key_binding('ctrl+c', 'ctrl+c', copy_subs)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement