naelstrof 38d4f6c1a1 Fixed tabbing, and uncommented the transparency 7 år sedan
modules fixed nvidia transparency issues 7 år sedan
src Fixed tabbing, and uncommented the transparency 7 år sedan
CMakeLists.txt Fixed tabbing, and uncommented the transparency 7 år sedan
COPYING Added copy of GPLv3, thanks to https://github.com/Simonft. 9 år sedan
README.md updated readme 7 år sedan
license.txt Added GPL notifications at the top of each file, and made it clear that contributors must agree with it too. 9 år sedan
slop.1 added noopengl flag 7 år sedan
slop.1.gz added noopengl flag 7 år sedan

README.md

slop

slop (Select Operation) is an application that queries for a selection from the user and prints the region to stdout.

Features

  • Hovering over a window will cause a selection rectangle to appear over it.
  • Clicking on a window makes slop return the dimensions of the window, and it's ID.
  • OpenGL accelerated graphics where possible.
  • Supports simple arguments:
    • Change selection rectangle border size.
    • Select X display.
    • Set padding size.
    • Force window, or pixel selections with the tolerance flag.
    • Set the color of the selection rectangles to match your theme! (Even supports transparency!)
    • Remove window decorations from selections.
  • Supports custom programmable shaders.

Practical Applications

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.

Lets see some action

Ok. Here's a comparison between 'scrot -s's selection and slop's:

scrotbad slopgood

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.

how to install

Install using your Package Manager (Preferred)

Install using CMake (Requires CMake)

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

Shaders

These are implemented, but not flushed out. I haven't gotten around to writing some tutorials on them. So check back later!