Skip to content

Commit 2a41cee

Browse files
committed
console.lua: use clipboard property for x11
1 parent a556900 commit 2a41cee

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

player/lua/console.lua

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,13 +1317,8 @@ end
13171317
-- Returns a string of UTF-8 text from the clipboard (or the primary selection)
13181318
local function get_clipboard(clip)
13191319
if platform == "x11" then
1320-
local res = utils.subprocess({
1321-
args = { "xclip", "-selection", clip and "clipboard" or "primary", "-out" },
1322-
playback_only = false,
1323-
})
1324-
if not res.error then
1325-
return res.stdout
1326-
end
1320+
local property = clip and "clipboard/text" or "clipboard/text-primary"
1321+
return mp.get_property(property, "")
13271322
elseif platform == "wayland" then
13281323
if mp.get_property("current-clipboard-backend") == "wayland" then
13291324
local property = clip and "clipboard/text" or "clipboard/text-primary"

0 commit comments

Comments
 (0)