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

Copying to clibboard on Arch Linux #8

Closed
xxxperimental opened this issue May 11, 2017 · 30 comments
Closed

Copying to clibboard on Arch Linux #8

xxxperimental opened this issue May 11, 2017 · 30 comments

Comments

@xxxperimental
Copy link

@xxxperimental xxxperimental commented May 11, 2017

Copying to clip board does not work on Arch Linux running i3.
The norification that the screenshot was saved to clipboard pops up, but the clipboard is empty.

@vstepchik

This comment has been minimized.

Copy link

@vstepchik vstepchik commented Jun 2, 2017

Same on Arch Linux + KDE

@francescarpi

This comment has been minimized.

Copy link

@francescarpi francescarpi commented Jun 6, 2017

Same on Arch Linux + Awesome WM

@RayneHwang

This comment has been minimized.

Copy link

@RayneHwang RayneHwang commented Jun 7, 2017

On previous version (4.0.0) this method works:
replace /usr/share/deepin-screenshot/src/gtk-clip with following

#!/bin/bash
command -v xclip >/dev/null 2>&1 || { echo "Need command xclip. Aborting." >&2; exit 1; }
[[ -f "$1" ]] || { echo "Error: Not a file." >&2; exit 1; }
TYPE=$(file -b --mime-type "$1")
xclip -selection clipboard -t "$TYPE" < "$1"

But since updated to 4.0.3, /usr/share/deepin-screenshot/src/gtk-clip doesnt exist anymore so anyone knows how to get the clipboard work???

@francescarpi

This comment has been minimized.

Copy link

@francescarpi francescarpi commented Jun 7, 2017

Hi!

I've the same problem. I don't know how copy to clipboard, too.

I've found this part of code, where copy to clipboard.

https://github.com/linuxdeepin/deepin-screenshot/blob/master/mainwindow.cpp#L1278

@RayneHwang

This comment has been minimized.

Copy link

@RayneHwang RayneHwang commented Jun 7, 2017

before that problem gets fixed, I've come up with an alternative:

scrot -s -e 'xclip -selection clipboard -t "image/png" < $f'

scrot is a command line tool for screentshot and -e option enables it to invoke xclip to send image file to clipboard.

@francescarpi

This comment has been minimized.

Copy link

@francescarpi francescarpi commented Jun 8, 2017

Hi,
I've found a workaround. Compile it from sources.

git clone https://github.com/linuxdeepin/deepin-screenshot.git
cd deepin-screenshot
mkdir build
cd build
qmake ..
make
sudo make install

I don't know why, but works perfectly for me. This version, copy to clipboard.

Best regards.

@felixonmars

This comment has been minimized.

Copy link
Member

@felixonmars felixonmars commented Jun 22, 2017

Actually it works fine here for me. Which app did you try to paste into? In my case, it was telegram-desktop.

@diegobernardes

This comment has been minimized.

Copy link

@diegobernardes diegobernardes commented Jun 22, 2017

@francescarpi got the same problem and building from source solved. But, when i updated the package from pacman, stopped working again.

@felixonmars on my case was at Google Inbox on Google Chrome, tried on Gimp too, but don't work either.

@H8to

This comment has been minimized.

Copy link

@H8to H8to commented Jun 23, 2017

For me neither the pacman version nor the build from source are able to copy to clipboard :(

I tried 4.0.3 from the repo and the latest git.
Trying to paste to anything does not work but when copyQ is enabled it also does not show up in the content of my clipboard.

Help much appreciated as I have to remove shutter to update my Arch :)

@francescarpi

This comment has been minimized.

Copy link

@francescarpi francescarpi commented Jun 26, 2017

I've discovered something, today.

I've a new archlinux installation, after install deepin-screenshot and run I saw the next error.

deeping_error1

After install deepin-daemon, deepin doesn't crash.

Another thing, I think that's we need a clipboard manager in our system. I've installed xfce4-clipman and run it and deepin save images in clipboard perfectly.

@felixonmars

This comment has been minimized.

Copy link
Member

@felixonmars felixonmars commented Jun 26, 2017

deepin-daemon added to depends array in 4.0.4-2.

@H8to

This comment has been minimized.

Copy link

@H8to H8to commented Jun 27, 2017

For me uninstalling shutter helped. Really strange!

@diegobernardes

This comment has been minimized.

Copy link

@diegobernardes diegobernardes commented Jun 27, 2017

With deepin-daemon its working! Just need to know now how to disable the annoying desktop notification that the screenshot has been copied to clipboard 😄

@felixonmars

This comment has been minimized.

Copy link
Member

@felixonmars felixonmars commented Jun 27, 2017

There's a command line switch:

-n, --no-notification   Don't send notifications.
@diegobernardes

This comment has been minimized.

Copy link

@diegobernardes diegobernardes commented Jul 5, 2017

thanks @felixonmars

@domsle

This comment has been minimized.

Copy link

@domsle domsle commented Feb 10, 2018

Hey,

I have built it from source, have installed deepin-daemon, but it still does not copy to clipboard.
I use Manjaro (Arch based) with KDE.

Can some one help me?

@tkkcc

This comment has been minimized.

Copy link

@tkkcc tkkcc commented Jun 26, 2018

with xfce4-clipman and without deepin-daemon it works find, i3wm

@soundwavefx

This comment has been minimized.

Copy link

@soundwavefx soundwavefx commented Jun 30, 2018

Okay... I installed the xfce4-clipman-plugin package. Do I just run deepin after that or is there something else I need to do?

@tkkcc

This comment has been minimized.

Copy link

@tkkcc tkkcc commented Jun 30, 2018

@soundwavefx first start xfce4-clipman, then run deepin-screenshot as normal

@dinglydo

This comment has been minimized.

Copy link

@dinglydo dinglydo commented Jul 22, 2019

I'd like to say that it works for me. I just had to make sure to uncheck the "ignore images" setting for the KDE clipboard. I believe it's checked by default. I am on Arch + KDE. Didn't have to install any extra packages.

@BLumia BLumia closed this Jul 22, 2019
@iceqing

This comment has been minimized.

Copy link

@iceqing iceqing commented Jul 23, 2019

Manjaro KDE, not woking for me, is there anyone solved it ?

@leonardopn

This comment has been minimized.

Copy link

@leonardopn leonardopn commented Aug 27, 2019

I think I figured out how to fix it: with the clipboard pinned to your panel, right-click and go to clipboard setting, and uncheck "Ignore images", this caused the images to be copied. I apologize if my English is terrible, I'm Brazilian :)

Note: this in KDE, I do not know in other interfaces

image

@iceqing

This comment has been minimized.

Copy link

@iceqing iceqing commented Sep 27, 2019

deepin-screenshot depend on the gnome-settings-daemon, you can try this:

sudo pacman -S gnome-settings-daemon
@springzfx

This comment has been minimized.

Copy link

@springzfx springzfx commented Oct 20, 2019

On X11 clipboard content is owned by the application, Data copied to clipboard remains in the clipboard only as long as the parent application is running and is discarded when the application quits.

Added "x-kde-force-image-copy" mime type to screenshots being copied to clipboard, which forces klipper clipboard manager to remember this clipboard entry even if user has set "ignore images" option to true in klipper. (link)

Another thing you need to notice, deepin-screenshot should not exit too fast, otherwise the clipboard content will destroy before clipper manager finish syncing. This is important, if you just unchecked "ignore images" option in kde clipper manager, it will only work randomly, and mostly won't work.

So here we are the solution, add a patch to src/mainwindow.cpp

1403a1404,1409
>         // On X11 clipboard content is owned by the application,
>         // Data copied to clipboard remains in the clipboard only
>         // as long as the parent application is running and is discarded when the application quits.
>         // Added "x-kde-force-image-copy" mime type to screenshots being copied to clipboard,
>         // which forces klipper clipboard manager to remember this clipboard entry
>         // even if user has set "ignore images" option to true in klipper.
1405c1411,1414
<         cb->setPixmap(screenShotPix, QClipboard::Clipboard);
---
>         QMimeData *data = new QMimeData();
>         data->setImageData(screenShotPix.toImage());
>         data->setData(QStringLiteral("x-kde-force-image-copy"), QByteArray());
>         cb->setMimeData(data, QClipboard::Clipboard);
1464c1473,1474
<     QTimer::singleShot(2, [=]{
---
>     // set time longer, so klipper manager have enough time to sync
>     QTimer::singleShot(500, [=]{
@springzfx

This comment has been minimized.

Copy link

@springzfx springzfx commented Oct 20, 2019

deepin-screenshot PKGBUILD also included for easy build. see
https://gist.github.com/springzfx/f881dff2d1c89efbfe59cfc288e09462

@exapsy

This comment has been minimized.

Copy link

@exapsy exapsy commented Oct 28, 2019

This is still an issue by the way. Work arrounds don't work either. The issue came with the new update (I believe it was the Major one). It worked smooth like butter before though :D

Environment

  • Linux kernel 4.19.80-1-MANJARO
  • Manjaro (Arch) 18.1.2
  • Gnome 3.34.1

Expected result

To copy the screenshot into clipboard

Actual result

Doesn't copy the screenshot to clipboard

Running deepin-screenshot on terminal

$ deepin-screenshot
qt5ct: using qt5ct plugin
"dtkwidget" can not find qm files
"deepin-screenshot" can not find qm files
2019-10-28, 15:30:36.295 [Debug  ] [0] m_keyboardGrabbed: false
2019-10-28, 15:30:36.296 [Debug  ] [0] m_keyboardGrabbed: false
2019-10-28, 15:30:36.296 [Debug  ] [0] m_keyboardGrabbed: false
2019-10-28, 15:30:36.296 [Debug  ] [0] m_keyboardGrabbed: false
2019-10-28, 15:30:36.313 [Debug  ] [0] m_keyboardGrabbed: false
2019-10-28, 15:30:36.313 [Debug  ] [0] m_keyboardGrabbed: false
2019-10-28, 15:30:36.313 [Debug  ] [0] m_keyboardGrabbed: false
2019-10-28, 15:30:36.314 [Debug  ] [0] m_keyboardGrabbed: false
2019-10-28, 15:30:36.316 [Debug  ] [0] m_keyboardGrabbed: true
2019-10-28, 15:30:36.366 [Debug  ] [0] ConfigSettings: "effect" "is_blur" QVariant(bool, false)
2019-10-28, 15:30:36.378 [Debug  ] [0] ConfigSettings: "effect" "is_mosaic" QVariant(bool, false)
2019-10-28, 15:30:36.378 [Debug  ] [0] Setting file: "/home/exapsy/.config/deepin/deepin-screenshot.conf"
2019-10-28, 15:30:36.378 [Debug  ] [0] ~~~~~~ QSize(276, 28)
2019-10-28, 15:30:36.406 [Debug  ] [0] ConfigSettings: "save" "save_quality" QVariant(int, 100)
2019-10-28, 15:30:36.407 [Warning] [0] QStackedWidget::setCurrentWidget: widget 0x0 not contained in stack
2019-10-28, 15:30:38.529 [Debug  ] [0] MainWindow mouseReleaseEvent
2019-10-28, 15:30:39.192 [Debug  ] [0] release event !!!
2019-10-28, 15:30:39.192 [Debug  ] [0] keyboardGrabbed: true
2019-10-28, 15:30:39.293 [Debug  ] [0] shotCurrentImg shotFullScreen
2019-10-28, 15:30:39.314 [Debug  ] [0] release event !!!
2019-10-28, 15:30:39.315 [Debug  ] [0] keyboardGrabbed: true
2019-10-28, 15:30:39.328 [Debug  ] [0] ConfigSettings: "common" "default_savepath" QVariant(QString, "clipboard")
2019-10-28, 15:30:39.329 [Debug  ] [0] saveFilePath: ""

My custom workaround

Run xfce4-xclipman everytime I want to make a screenshot. Although, even xfce4-xclipman stops working after 30secs, but it does the work.
xfce4-xclipman log

$ xfce4-clipman

** (xfce4-clipman:30381): WARNING **: 15:20:54.375: Unable to register GApplication: An object is already exported for the interface org.gtk.Application at /org/xfce/clipman

(xfce4-clipman:30381): GLib-GIO-CRITICAL **: 15:20:54.375: g_application_get_is_remote: assertion 'application->priv->is_registered' failed

(xfce4-clipman:30381): GLib-WARNING **: 15:20:54.375: g_set_application_name() called multiple times
        
(xfce4-clipman:30381): Gtk-CRITICAL **: 15:21:39.096: gtk_clipboard_set_with_data: assertion 'targets != NULL' failed

** (xfce4-clipman:30381): WARNING **: 15:21:54.966: Status Icon is not embedded

(xfce4-clipman:30381): Gtk-CRITICAL **: 15:21:55.013: gtk_widget_destroy: assertion 'GTK_IS_WIDGET (widget)' failed
@msenol86

This comment has been minimized.

Copy link

@msenol86 msenol86 commented Oct 30, 2019

I have still that issue. Why this issue marked as closed?

@BLumia

This comment has been minimized.

Copy link
Member

@BLumia BLumia commented Nov 11, 2019

For anyone who still have this issue, please check the clipboard manager app of your desktop environment, things like x-kde-force-image-copyis more likely DE specific issue, I don't think this is what should be done from the screenshot app side. Let us know if you have any good suggestion about solutions of DE specific issue.

@exapsy

This comment has been minimized.

Copy link

@exapsy exapsy commented Nov 11, 2019

is more likely DE specific issue

@BLumia From what I've encountered the issue doesn't happen on a specific DE or Distro. This issue doesn't persist with other screenshot tools as well, but they may just not use a system library like deepin may do or I dont know.

@springzfx Mentioned a patch by the way, I haven't found the time to try it but it is a suggestion if I may say #8 (comment)

Although, I'm unfamiliar with the codebase of deepin, but I may investigate this later in case I find a way to patch this fix, since I find Deepin-screenshot quite a handy and modern tool. :)

@msenol86

This comment has been minimized.

Copy link

@msenol86 msenol86 commented Nov 18, 2019

I fixed this issue by using xclip. Since X11 clipboard items deleted after app closed I couldn't find any other solution.

https://gist.github.com/msenol86/c0c7daad3de32a7922486e5d669f24c6
Zip file
Download gist then make and install package:
makepkg -si

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.