You are not logged in.

#1 2024-07-09 10:44:12

coldreactive
Member
Registered: 2024-07-04
Posts: 34

[SOLVED] How do I use import to take a screenshot of the whole desktop

I'm trying to use import png:- | xclip -selection clipboard -t image/png, but when I execute the command, it will make the mouse into a crosshair, likely wanting me to select a region or window. I just want to take a screenshot of the whole desktop without extra user input.

I tried passing -window root with import -window root png:- | xclip -selection clipboard -t image/png but it ended up doing the same thing. I would use flameshot, but it has a slight delay, and I want to maybe try and change the data to image/jpeg instead of png, which flameshot doesn't support.

Last edited by coldreactive (2024-07-09 11:44:05)

Offline

#2 2024-07-09 10:56:23

skunktrader
Member
From: Brisbane, Australia
Registered: 2010-02-14
Posts: 1,667

Re: [SOLVED] How do I use import to take a screenshot of the whole desktop

-screen

?

Offline

#3 2024-07-09 11:01:54

coldreactive
Member
Registered: 2024-07-04
Posts: 34

Re: [SOLVED] How do I use import to take a screenshot of the whole desktop

skunktrader wrote:
-screen

?

import -screen png:- | xclip -selection clipboard -t image/png

Will also just change the mouse to a crosshair. Looks like the correct command is

import -silent -window root png:- | xclip -selection clipboard -t image/png

Thanks to a reddit response. Keep in mind, if you change the image format to jpeg, it will not be able to paste into programs like discord, but will paste into gimp. This command, however, will not work with a keyboard shortcut. Nothing will be sent to the clipboard. In order to send it to the clipboard via a keyboard shortcut, wrap it in an sh -c command:

sh -c 'import -silent -window root png:- | xclip -selection clipboard -t image/png'

Last edited by coldreactive (2024-07-09 12:07:20)

Offline

Board footer

Powered by FluxBB