Module: Clipboard::LinuxWayland

Extended by:
LinuxWayland
Included in:
LinuxWayland
Defined in:
lib/clipboard/linux_wayland.rb

Constant Summary collapse

TEST_COMMAND =
"wl-copy"
WRITE_COMMAND =
"wl-copy --type text/plain"
READ_COMMAND =
"wl-paste --type text/plain --no-newline"

Instance Method Summary collapse

Instance Method Details

#clearObject



31
32
33
# File 'lib/clipboard/linux_wayland.rb', line 31

def clear
  `#{WRITE_COMMAND} --clear`
end

#copy(data) ⇒ Object



26
27
28
29
# File 'lib/clipboard/linux_wayland.rb', line 26

def copy(data)
  Utils.popen WRITE_COMMAND, data
  paste
end

#paste(might_select_primary_clipboard = nil) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/clipboard/linux_wayland.rb', line 18

def paste(might_select_primary_clipboard = nil)
  if might_select_primary_clipboard == "primary"
    `#{READ_COMMAND} --primary`
  else
    `#{READ_COMMAND}`
  end
end