File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 1
1
use base64:: { engine:: general_purpose, Engine as _} ;
2
2
use copypasta_ext:: prelude:: * ;
3
+ #[ cfg( target_os = "linux" ) ]
3
4
use copypasta_ext:: wayland_bin:: WaylandBinClipboardContext ;
4
5
use copypasta_ext:: x11_bin:: ClipboardContext as BinClipboardContext ;
5
6
use copypasta_ext:: x11_fork:: ClipboardContext as ForkClipboardContext ;
@@ -34,14 +35,19 @@ fn ssh_clipboard(content: &str) -> bool {
34
35
)
35
36
. is_ok ( )
36
37
}
37
-
38
+ # [ cfg ( target_os = "linux" ) ]
38
39
fn wayland_clipboard ( content : & str ) -> bool {
39
40
env_var_set ( "WAYLAND_DISPLAY" )
40
41
&& WaylandBinClipboardContext :: new ( )
41
42
. and_then ( |mut ctx| ctx. set_contents ( content. to_owned ( ) ) )
42
43
. is_ok ( )
43
44
}
44
45
46
+ #[ cfg( not( target_os = "linux" ) ) ]
47
+ fn wayland_clipboard ( content : & str ) -> bool {
48
+ false
49
+ }
50
+
45
51
fn other_platform_clipboard ( content : & str ) -> bool {
46
52
BinClipboardContext :: new ( )
47
53
. and_then ( |mut ctx| ctx. set_contents ( content. to_owned ( ) ) )
You can’t perform that action at this time.
0 commit comments