Commit: a9911bb823ebea40d7e50a8694d72b3c7f173388
Parent: 50f98675e75536548fad030a1babe3132e5ef4a3
Author: Ren Tatsumoto
Date: Tue, 3 Nov 2020 02:40:23 +0300
change clipboard on GNU/Linux
Diffstat:
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/subs2srs.lua b/subs2srs.lua
@@ -513,15 +513,12 @@ end
local function init_platform_nix()
local self = {}
- local clipfile_path = os.tmpname()
- mp.register_event('shutdown', function() os.remove(clipfile_path) end)
self.copy_to_clipboard = function(_, text)
if not is_empty(text) then
- local handle = io.open(clipfile_path, "w")
+ local handle = io.popen('xclip -i -selection clipboard', 'w')
handle:write(text)
handle:close()
- mp.commandv("run", "xclip", "-selection", "clipboard", clipfile_path)
end
end