naelstrof 8a4f1c20f2 Don't attempt to grab keyboard if --nokeyboard. Thanks #63 | 7 anos atrás | |
---|---|---|
modules | 7 anos atrás | |
src | 7 anos atrás | |
CMakeLists.txt | 7 anos atrás | |
COPYING | 10 anos atrás | |
README.md | 7 anos atrás | |
license.txt | 10 anos atrás | |
slop.1 | 7 anos atrás | |
slop.1.gz | 7 anos atrás |
slop (Select Operation) is an application that queries for a selection from the user and prints the region to stdout.
slop can be used to create a video recording script in only two lines of code.
#!/bin/bash
read -r X Y W H G ID < <(slop -f "%x %y %w %h %g %i")
ffmpeg -f x11grab -s "$W"x"$H" -i :0.0+$X,$Y -f alsa -i pulse ~/myfile.webm
You can also take images using imagemagick like so:
#!/bin/bash
read -r G < <(slop -f "%g")
import -window root -crop $G ~/myimage.png
If you don't like ImageMagick's import: Check out maim for a better screenshot utility.
Ok. Here's a comparison between 'scrot -s's selection and slop's:
You can see scrot leaves garbage lines over the things you're trying to screenshot! While slop not only looks nicer, it's impossible for it to end up in screenshots or recordings because it waits for DestroyNotify events before completely shutting down. Only after the window is completely destroyed can anything take a screenshot.
Note: Dependencies should be installed first: libxext, OpenGL, and glm.
git clone https://github.com/naelstrof/slop.git
cd slop
cmake -DCMAKE_INSTALL_PREFIX="/usr" ./
make && sudo make install
These are implemented, but not flushed out. I haven't gotten around to writing some tutorials on them. So check back later!