You are not logged in.

#1 2016-04-13 10:05:42

HisDudeness
Member
From: Melzo, Milan (Italy)
Registered: 2014-09-29
Posts: 107

[SOLVED] maim - Paste contents to clipboard

Sorry in advance for the question, I know it's stupid, but neither the wiki nor the forum could help me, and not even googling I could get a grasp of this issue.

I use maim to take screenshots of my desktop. I've set the Shift-Print keybind in openbox to simply invoking the program, saving X content to a file

<keybind key="S-Print">
      <action name="Execute">
        <startupnotify>
          <enabled>true</enabled>
          <name>Screenshot</name>
        </startupnotify>
        <command>maim</command>
      </action>
    </keybind>

However, I want to set Print key alone to copy my desktop to the clipboard, so that I can later paste it and edit it in any program like GIMP. I've come across this post, which uses copyq. However, I can't seem to understand if I need one of this applications and how (for example, I wanted to use parcellite but I can't figure out the equivalent of that copyq invocation) - and also, which one of those programs suits better to my needs - or if I can manage to copy my active workspace to the clipboard using maim alone.

Last edited by HisDudeness (2016-04-14 20:12:45)


The Dude minds.

Offline

#2 2016-04-13 10:11:16

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] maim - Paste contents to clipboard

Everything is explained in the reddit link you posted.

Install copyq from the AUR. Use the bash script posted on that thread, and bind it to a key.

Edit: Also, use "copyq copy" instead of "copyq write".

Last edited by x33a (2016-04-13 10:12:19)

Offline

#3 2016-04-13 10:36:21

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: [SOLVED] maim - Paste contents to clipboard

HisDudeness wrote:

However, I can't seem to understand if I need one of this applications and how (for example, I wanted to use parcellite but I can't figure out the equivalent of that copyq invocation) - and also, which one of those programs suits better to my needs - or if I can manage to copy my active workspace to the clipboard using maim alone.

Very few clipboard managers support images, and parcellite is not one of them.

Offline

#4 2016-04-14 10:56:43

HisDudeness
Member
From: Melzo, Milan (Italy)
Registered: 2014-09-29
Posts: 107

Re: [SOLVED] maim - Paste contents to clipboard

Thanks for the explanation! How can I tell which ones do? Is there one in the official repositories? I'm trying to install how few packages from the AUR as possible. Is copyq worth it?


The Dude minds.

Offline

#5 2016-04-14 18:13:55

Docbroke
Member
From: India
Registered: 2015-06-13
Posts: 1,433

Re: [SOLVED] maim - Paste contents to clipboard

As far as I know, only clipman from official repos supports images (xfce4-clipman-plugin), you can try both whichever suits you. Personally I don't need any screenshooter or clipboard manager for this job, I use this..

to take snapshot of selection

#!/bin/bash
import /tmp/image.jpg
notify-send -u normal "image copied to /tmp/image.jpg"

to take whole screen

#!/bin/bash

sleep 5 &&
import -window root /tmp/image-full.jpg
notify-send -u normal "image copied to /tmp/image-full.jpg"

image is copied to RAM (tmpfs), from there I use it where-ever I want.

Last edited by Docbroke (2016-04-14 18:50:15)

Offline

#6 2016-04-14 20:12:31

HisDudeness
Member
From: Melzo, Milan (Italy)
Registered: 2014-09-29
Posts: 107

Re: [SOLVED] maim - Paste contents to clipboard

Got it! Thanks!

Anyway, ince just xfce's clipboard manager supports images in the official repos, I think I'll go with copyq and stick with the example.

Using the RAM like you do, it doesn't work like clipboard does, right? You can't paste the image, you have it saved in a temporary directory where you can manually fetch it when and if you want?

Last edited by HisDudeness (2016-04-15 09:24:43)


The Dude minds.

Offline

#7 2017-01-19 10:21:18

HisDudeness
Member
From: Melzo, Milan (Italy)
Registered: 2014-09-29
Posts: 107

Re: [SOLVED] maim - Paste contents to clipboard

I hate to bump a relatively old thread (if too much time has passed, reprimand me and close it), but the error concerns the very same script I used to perform this action

maim -s --format png /dev/stdout | copyq copy image/png -

It now doesn't write anything into the clipboard. If I run the same action in the terminal I get the following message:

CopyQ ERROR [2017-01-19 11:19:34.623]: Cannot connect to server! Start CopyQ server first.

I googled around but couldn't get a grasp at what copyq wants me to do. I'm not aware of any systemd service to start, and issuing copyq alone, invoking the command while the program is opened, serves nothing. Plus, I remember issuing the script without having to start the program whatsoever. Any help?


The Dude minds.

Offline

#8 2017-01-19 17:31:34

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,739

Re: [SOLVED] maim - Paste contents to clipboard

HisDudeness wrote:

I hate to bump a relatively old thread

It's your thread.  Generally we discourage bumping old threads as the original poster (OP) has either solved it, given up, or moved on.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#9 2017-07-04 17:54:42

HisDudeness
Member
From: Melzo, Milan (Italy)
Registered: 2014-09-29
Posts: 107

Re: [SOLVED] maim - Paste contents to clipboard

Bumping again my very own thread, but it is to mark the thread as solved. I've just noticed the help on maim shows a way which involves only packages from the official repos.

maim --help

EXAMPLES
       Screenshot the active window and save it to the clipboard for quick pasting.

       maim -i $(xdotool getactivewindow) | xclip -selection clipboard -t image/png

Installing xdotool and xclip, the above command works like a charm.

The topic can now be closed.


The Dude minds.

Offline

Board footer

Powered by FluxBB