aboutsummaryrefslogtreecommitdiff
path: root/copypasta/examples/hello_world.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2019-06-09 11:46:31 +0000
committerGitHub <noreply@github.com>2019-06-09 11:46:31 +0000
commitbc2c34eb7f9eea251822d94ea534a1d2de03c5a1 (patch)
tree8aebbcb1f31dac6f9439f71e784605ca1133ea35 /copypasta/examples/hello_world.rs
parent4cd55acd7820a7358f9175c106c91e0945fb15b2 (diff)
downloadalacritty-bc2c34eb7f9eea251822d94ea534a1d2de03c5a1.tar.gz
alacritty-bc2c34eb7f9eea251822d94ea534a1d2de03c5a1.zip
Add wayland primary selection clipboard support
Diffstat (limited to 'copypasta/examples/hello_world.rs')
-rw-r--r--copypasta/examples/hello_world.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/copypasta/examples/hello_world.rs b/copypasta/examples/hello_world.rs
new file mode 100644
index 00000000..7d637f82
--- /dev/null
+++ b/copypasta/examples/hello_world.rs
@@ -0,0 +1,12 @@
+extern crate copypasta;
+
+use copypasta::ClipboardContext;
+use copypasta::ClipboardProvider;
+
+fn main() {
+ let mut ctx = ClipboardContext::new().unwrap();
+
+ let the_string = "Hello, world!";
+
+ ctx.set_contents(the_string.to_owned()).unwrap();
+}