Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set_contents doesnt work for me #86

Open
alexzanderr opened this issue Apr 3, 2022 · 3 comments
Open

set_contents doesnt work for me #86

alexzanderr opened this issue Apr 3, 2022 · 3 comments

Comments

@alexzanderr
Copy link

hello.

i have a minimal example.

    use clipboard::ClipboardProvider;
    use clipboard::ClipboardContext;

    let mut ctx: ClipboardContext = ClipboardProvider::new().unwrap();
    ctx.set_contents(String::from("hello")).unwrap();

this should copy to clipboard the string hello and then it should be pasteable with control-v everywhere.

actuall result: doesnt do anything (doesnt copy to clipboard), the clipboard is empty.

here is some neofetch:

                 `ooo/                   OS: Manjaro Linux x86_64
                `+oooo:                  Host: GL553VD 1.0
               `+oooooo:                 Kernel: 5.10.105-1-MANJARO
               -+oooooo+:                Uptime: 51 mins
             `/:-:++oooo+:               Packages: 1955 (pacman)
            `/++++/+++++++:              Shell: zsh 5.8.1
           `/++++++++++++++:             Resolution: 1920x1080
          `/+++ooooooooooooo/`           DE: Xfce 4.16
         ./ooosssso++osssssso+`          WM: Xfwm4
        .oossssso-````/ossssss+`         WM Theme: borderless-windows
       -osssssso.      :ssssssso.        Theme: Matcha-dark-aliz [GTK2], Adwaita [GTK3
      :osssssss/        osssso+++.       Icons: Papirus-Dark [GTK2], Adwaita [GTK3]
     /ossssssss/        +ssssooo/-       Terminal: tmux
   `/ossssso+/:-        -:/+osssso+-     CPU: Intel i7-7700HQ (8) @ 3.800GHz
  `+sso+:-`                 `.-/+oso:    GPU: Intel HD Graphics 630
 `++:.                           `-/+/   GPU: NVIDIA GeForce GTX 1050 Mobile
 .`                                 `/   Memory: 10703MiB / 15890MiB
                                         GPU Driver: ASUSTeK Computer Inc. Device [104

specs:

  • arch linux -> manjaro 22/23 Pahvo or later
  • kernel 5.10
  • xfce Desktop Environment

what am i missing guys? why it doesnt work?

my DE is using X11 and i saw this merge here that it was implemented for x11

@kyoheiu
Copy link

kyoheiu commented Dec 15, 2022

Hi, maybe too late, but this issue will help (or not help) your problem.
alacritty/copypasta#49

@alexzanderr
Copy link
Author

thanks for response, i will check it out.

@PabloGmz96
Copy link

Hey, I just had the same issue but I discovered that set_contents method does not work without the get_contents method, it seems like they are interdependent, weird but true. I let you a full working example below...

use clipboard::ClipboardProvider;
use clipboard::ClipboardContext;

fn main() {
    let mut ctx: ClipboardContext = ClipboardProvider::new().unwrap();
    ctx.set_contents("My name is Pablo".to_owned()).unwrap();
    ctx.get_contents();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants