Advertisement
Guest User

subclip.lua

a guest
Sep 1st, 2020
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.33 KB | None | 0 0
  1. -- copy to ~/.config/mpv/scripts/subclip.lua
  2.  
  3. local function subtext(name, data)
  4.   if data == nil then
  5.     return
  6.   end
  7.  
  8.   local file = io.open("/tmp/subclip.txt", "w");
  9.   file:write(data);
  10.   file:close();
  11.   os.execute("xclip -selection clipboard /tmp/subclip.txt")
  12. end
  13.  
  14. mp.observe_property("sub-text", "string", subtext)
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement