Unix & Linux Stack Exchange
Q&A for users of Linux, FreeBSD and other Unix-like operating systems
Latest Questions
15
votes
4
answers
13616
views
Copying image from scrot into clipboard after capture
I've grown affection to scrot as a simple screenshot utility, but it lacks one thing i would greatly appreciate--a way to copy your capture and have it in your clipboard automatically. I've added a line to .bash_aliases that automatically puts it in the folder i desire, and also have it always run i...
I've grown affection to scrot as a simple screenshot utility, but it lacks one thing i would greatly appreciate--a way to copy your capture and have it in your clipboard automatically.
I've added a line to .bash_aliases that automatically puts it in the folder i desire, and also have it always run in selection mode, but there seems to be no flag for copying the result after capturing. Is there any way to do this?
.bash_alias entry=
scrot='scrot -s ~/Pictures/%b%d::%H%M%S.png'
lcdhead
(151 rep)
Dec 8, 2020, 07:26 PM
• Last activity: Nov 6, 2024, 05:31 PM
0
votes
1
answers
32
views
How to grab a screenshot of a 4x4 screen composite display?
I'm supervising a number of headless displays, and in order for me to see, remotely, what a screen is currently displaying without actually going there and look at it, I'm using `scrot` to take a screenshot every once in a while. However, one of our displays is a 4x4 (that is, 16-monitor) huge displ...
I'm supervising a number of headless displays, and in order for me to see, remotely, what a screen is currently displaying without actually going there and look at it, I'm using
scrot
to take a screenshot every once in a while. However, one of our displays is a 4x4 (that is, 16-monitor) huge display, and if I use scrot
, all I get is the upper left 16th of the display - I would like to view all of it. Any ideas?
OZ1SEJ
(239 rep)
Aug 11, 2023, 10:39 AM
• Last activity: Aug 11, 2023, 11:01 AM
0
votes
1
answers
1803
views
Setting a keyboard shortcut to interactively select a screenshot (sxhkd/scrot)
I would like to add a keyboard shortcut using [sxhkd](https://github.com/baskerville/sxhkd) let me select a region of my desktop to screenshot using [scrot](https://en.wikipedia.org/wiki/Scrot). This should be accomplished by adding this section to my sxhkd file, ctrl + alt + x scrot --select but th...
I would like to add a keyboard shortcut using [sxhkd](https://github.com/baskerville/sxhkd) let me select a region of my desktop to screenshot using [scrot](https://en.wikipedia.org/wiki/Scrot) . This should be accomplished by adding this section to my sxhkd file,
ctrl + alt + x
scrot --select
but this doesn't work. The command
scrot --select
works fine when issued from a terminal, and this keyboard shortcut works fine if I change --select
to something non-interactive like --focused
, so I'm not sure why the above sxhkd entry is not working, but I suspect that it has to do with --select
being interactive. Why doesn't this work?
Mike Pierce
(952 rep)
Jan 20, 2021, 10:42 PM
• Last activity: Apr 12, 2021, 05:55 PM
0
votes
1
answers
431
views
Screencast script based on FFMPEG
I am trying to write my own screencast script based on FFmpeg. I want to be able to draw a rectangle on the screen and force FFmpeg to make a screencast of this area only, for that I would need the coordinates of x,y of the starting point, and the resolution of the selected area. I can draw a rectan...
I am trying to write my own screencast script based on FFmpeg. I want to be able to draw a rectangle on the screen and force FFmpeg to make a screencast of this area only, for that I would need the coordinates of x,y of the starting point, and the resolution of the selected area. I can draw a rectangular area with
scrot -s
and I can also get the coordinates with xdotool getmouselocation
but I don't know how I can save the location of the scrot
start location.
I am imagining my script will be something like this:
1. scrot -s
- draw a rectangular area on the screen
2. save start_x, start_y locations in a variable
3. ffmpeg -i scrot_screenshot
- to get resolution of the selected area
4. ffmpeg -video_size $area_resolution -f x11grab -i :0.0+start_x,start_y screen_capture.mp4
- to create the screencast
So I need a solution for 2 only, I can do the rest of the script on my own.
I can, of course, use a different than scrot
command for drawing the rectangular area of the screen, but so far, I didn't find a suitable replacement.
The final goal is to create such a script and I will for sure publish it on my Github account with the respective documentation on how to use it.
Georgi Stoyanov
(860 rep)
Apr 24, 2020, 10:50 AM
• Last activity: Apr 25, 2020, 10:29 AM
2
votes
1
answers
1751
views
Why are my Xvfb screenshots black with traces of color (Ubuntu 16.04 LTS)
I am running a headless Ubuntu 16.04 LTS in the Google Cloud. There is an application I need to run in the background that requires a GUI. I am trying to use Xvfb to allow the program to run, but as the program requires some GUI inputs, I also need to take screenshots of the screen to see what input...
I am running a headless Ubuntu 16.04 LTS in the Google Cloud. There is an application I need to run in the background that requires a GUI. I am trying to use Xvfb to allow the program to run, but as the program requires some GUI inputs, I also need to take screenshots of the screen to see what inputs are required.
However, I am having trouble taking screenshots. To test the process of taking a screenshot, I install and run firefox navigated to google. I take a screenshot two ways, using scrot and using imagemagick. Both ways results in a black image with hints of the google homepage in it (see attached picture). The colour and details prevents the use of the screenshot to interpret what is being shown. What is causing this lack of detail and how can I fix this?
The relevant commands are below:
sudo apt-get install xvfb xorg xserver-xorg scrot imagemagick
Xvfb :1 &
export DISPLAY=:1
DISPLAY=:1 firefox https://www.google.com &
DISPLAY=:1 scrot
DISPLAY=:1 import -window root tmp_screenshot.png

John Smith
(23 rep)
Mar 8, 2020, 03:38 PM
• Last activity: Mar 29, 2020, 05:01 PM
3
votes
1
answers
441
views
How to remove need for hacks to run scrot with a keyboard shortcut?
I'd like to take screenshots with a keyboard shortcut using `scrot --select`. I tried adding the following to [my rc.lua][1] to use the PrintScr key for this purpose: awful.key({}, "Print", function () awful.spawn("scrot --select") end, {description = "take screenshot of selection", group = "client"...
I'd like to take screenshots with a keyboard shortcut using
scrot --select
. I tried adding the following to my rc.lua to use the PrintScr key for this purpose:
awful.key({}, "Print", function () awful.spawn("scrot --select") end,
{description = "take screenshot of selection", group = "client"}),
Unfortunately this results in the following error message in the xsession systemd journal:
> giblib error: couldn't grab keyboard:Resource temporarily unavailable
It seems scrot
needs to grab the keyboard while I'm still holding down the Fn+PrintScr combination. One way to work around this complicates the function a fair bit:
awful.spawn.with_shell("sleep 0.5 && scrot --select")
The .with_shell
and sleep
bits are a hack to give me time to release the keys before scrot
runs. Which of course means that if I hold down the keys for too long the command still fails with the same error as above.
A more elegant workaround does not work reliably. I installed xdotool, set xdotool key XF86Ungrab && scrot --select
as the screenshot command, and added grab:break_actions
to services.xserver.xkbOptions
, but I still get the same error as above *most of the time.* Pressing Fn+PrintScr repeatedly will eventually work, for no discernible reason.
l0b0
(53368 rep)
Aug 29, 2019, 08:16 AM
• Last activity: Aug 29, 2019, 08:27 AM
Showing page 1 of 6 total questions