Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[Software] CLI screenshot tool
-
- Posts: 5
- Joined: 2022-10-22 08:16
[Software] CLI screenshot tool
Hello,
I have just installed Debian 12, w/ Gnome 43.
I really need a cli tool to make screenshots. Specifically a rectangular area.
Moving from Mint, I used shutter, but I cant seem to find anything that works native and smooth on Wayland.
I tried
1. shutter, scrot - no wayland support
2. shutter-on-wayland - officially supports ubuntu 23.10, buggy (gtk-critical error that keeps showing way after command finished)
3. import - this error:
import-im6.q16: unable to read X window image `': Resource temporarily unavailable @ error/xwindow.c/XImportImage/4977.
import-im6.q16: missing an image filename `/home/gal/Pictures/Screenshots/tmp.png' @ error/import.c/ImportImageCommand/1276.
4. grim - this error:
compositor doesn't support wlr-screencopy-unstable-v1
Any suggestions?
Thanks, Gal
I have just installed Debian 12, w/ Gnome 43.
I really need a cli tool to make screenshots. Specifically a rectangular area.
Moving from Mint, I used shutter, but I cant seem to find anything that works native and smooth on Wayland.
I tried
1. shutter, scrot - no wayland support
2. shutter-on-wayland - officially supports ubuntu 23.10, buggy (gtk-critical error that keeps showing way after command finished)
3. import - this error:
import-im6.q16: unable to read X window image `': Resource temporarily unavailable @ error/xwindow.c/XImportImage/4977.
import-im6.q16: missing an image filename `/home/gal/Pictures/Screenshots/tmp.png' @ error/import.c/ImportImageCommand/1276.
4. grim - this error:
compositor doesn't support wlr-screencopy-unstable-v1
Any suggestions?
Thanks, Gal
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 7 times
- Been thanked: 16 times
Re: [Software] CLI screenshot tool
I use a default gnome installation and just press printscreen button (prtscn) which pops up a square which you can drag to the area to capture, files are saved (by default) in /home/<user>/Pictures/Screenshots/
HTH
HTH
- bbbhltz
- Posts: 166
- Joined: 2024-01-10 14:53
- Location: Normandy
- XMMP/Jabber: bbbhltz@mailbox.org
- Has thanked: 49 times
- Been thanked: 33 times
Re: [Software] CLI screenshot tool
Here are a few screenshot tools that should work under wayland. Some of them have CLI commands for taking screenshots:
https://flameshot.org/ / is in repo
https://github.com/emersion/slurp / is in repo
https://gitlab.com/WhyNotHugo/shotman / not in repo
https://github.com/jtheoof/swappy / not in repo
https://flameshot.org/ / is in repo
https://github.com/emersion/slurp / is in repo
https://gitlab.com/WhyNotHugo/shotman / not in repo
https://github.com/jtheoof/swappy / not in repo
bbbhltz
longtime desktop Linux user; eternal newbie
longtime desktop Linux user; eternal newbie
-
- Posts: 5
- Joined: 2022-10-22 08:16
Re: [Software] CLI screenshot tool
I sometimes need to make a screenshot of a specific area once a second for 10 minutes. I used to do it using a bash file, alternating from "sleep 1" to "shutter -s ..."
I really need a CLI tool...
I really need a CLI tool...
-
- Posts: 5
- Joined: 2022-10-22 08:16
Re: [Software] CLI screenshot tool
Solved
So what I didn't know is that in the login screen I can choose a "Gnome on Xorg" session. This means I can use every tool I'm used too, and when I'm finished just log out and login again to have all the cool wayland features like touchpad gestures. That is a compromise I'm comfortable with.
Although, It does seem weird that there is no easy tool native to wayland at that point. I did try some more suggestions:
5. flameshot - takes black screenshots
6. slurp - couldn't take full advantage without grim, didn't suit all my needs
7. shotman - depricated, didn't want to go that way
8. swappy - depended on grim
Thanks, Gal
So what I didn't know is that in the login screen I can choose a "Gnome on Xorg" session. This means I can use every tool I'm used too, and when I'm finished just log out and login again to have all the cool wayland features like touchpad gestures. That is a compromise I'm comfortable with.
Although, It does seem weird that there is no easy tool native to wayland at that point. I did try some more suggestions:
5. flameshot - takes black screenshots
6. slurp - couldn't take full advantage without grim, didn't suit all my needs
7. shotman - depricated, didn't want to go that way
8. swappy - depended on grim
Thanks, Gal
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 7 times
- Been thanked: 16 times
Re: [Software] CLI screenshot tool
I have a script that I call for screenshots using xwd (with Xfce) but I don't know if that will work with wayland, I will try it out when I get the chance (in the middle of backups at moment) and post back.
Re: [Software] CLI screenshot tool
Don't do that! Just use the plain vanilla gnome cli screenshot tool: gnome-screenshot (you need to install it). Works with wayland.galluzHalevi wrote: ↑2024-03-01 13:10 Solved
So what I didn't know is that in the login screen I can choose a "Gnome on Xorg" session.
Re: [Software] CLI screenshot tool
The following simple command will take screenshots from to-be-selected areas every second for 5 seconds:
Unfortunately, due to my low bash skill, I don't know how to continuously take screenshots of a pre-defined area for a set time interval. Thus, no help.
Code: Select all
for i in {1..5}; do gnome-screenshot -a -d 1 -f test$i; done
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 7 times
- Been thanked: 16 times
Re: [Software] CLI screenshot tool
@galluzHalevi
I revisited my original screen capture scripts and found they would not work with wayland (no surprise really) and did a little research and found that getting a user defined area of screen captured is not a viable option for wayland (at least not under Gnome) so I went back to my script to see about capturing a user defined area and modified my script to accept parameters so that it could be called by your own script to capture at a rate you would prefer.
This would need to be run under "Gnome on Xorg", which is what your solution states you are now doing anyway, but you could use this to capture the screen as you wanted by incorporating @pwzhangzz offered snippet
Here is the script which I have named as scrsh3
HTH
I revisited my original screen capture scripts and found they would not work with wayland (no surprise really) and did a little research and found that getting a user defined area of screen captured is not a viable option for wayland (at least not under Gnome) so I went back to my script to see about capturing a user defined area and modified my script to accept parameters so that it could be called by your own script to capture at a rate you would prefer.
This would need to be run under "Gnome on Xorg", which is what your solution states you are now doing anyway, but you could use this to capture the screen as you wanted by incorporating @pwzhangzz offered snippet
Here is the script which I have named as scrsh3
Code: Select all
#!/bin/bash
if [ $# -lt 4 ]
then
echo "Not enough arguments supplied"
echo "This script needs the following parameters"
echo "width height xposition yposition"
exit 1
fi
w=$1
h=$2
x=$3
y=$4
Pic_Path="/home/$USER/Pictures/"
Pic_Name="ScreenShot"
nowtime=$(date +"%Y-%m-%d_%H:%M:%S")
xwd -root | convert -crop "$w"x"$h"+"$x"+"$y" xwd:- ${Pic_Path}${nowtime}_${Pic_Name}.png
-
- Global Moderator
- Posts: 2979
- Joined: 2014-07-20 18:12
- Location: Europe
- Has thanked: 75 times
- Been thanked: 407 times
Re: [Software] CLI screenshot tool
Moderator edit: replacing "screemshot" with "screenshot" in the subject of posts
Re: [Software] CLI screenshot tool
The following command was supposed to take screenshots on a predefined rectangular area every second for three seconds:
However, I had to manually click the mouse before each screenshot was taken (but no need to redraw the rectangle). As a result, the timing is off and this cli is thus useless.
Code: Select all
for i in {1..3}; do gnome-screenshot -a -d 1 -f gtest$i; ydotool mousemove 100 100 mousedown 1 mousemove 300 300 mouseup 1; done
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 7 times
- Been thanked: 16 times
Re: [Software] CLI screenshot tool
I tried this with xdotool when researching but it didn't work either.
-
- Posts: 1101
- Joined: 2016-01-07 12:25
- Has thanked: 7 times
- Been thanked: 16 times
Re: [Software] CLI screenshot tool
This works for me creating images of 100x100 with starting (top left corner) point of x=300 y=300 with a 2 second delay between shots. Adjust the sleep value for preferred timing.
Obviously you would need to place the scrsh3 script in your $PATH and have imagemagick installed. And this needs to run in "Gnome on Xorg" session.
Stiil no joy finding a working Wayland solution...
Code: Select all
for i in {1..5}; do scrsh3 100 100 300 300;sleep 2; done
Stiil no joy finding a working Wayland solution...
Re: [Software] CLI screenshot tool
I too have migrated from Ubuntu to Debian 12 and have been a long time user of Shutter but have found that under Wayland, the tool just doesn't open
I've explored a few alternatives for my use case (require inserting pointers such as arrows) but all I have found available to do this is Libre Office Draw.
Looking at your need for scripting, would LO Scripting Libre Office Scripting
I've explored a few alternatives for my use case (require inserting pointers such as arrows) but all I have found available to do this is Libre Office Draw.
Looking at your need for scripting, would LO Scripting Libre Office Scripting