GithubHelp home page GithubHelp logo

naelstrof / slop Goto Github PK

View Code? Open in Web Editor NEW
840.0 18.0 56.0 1.11 MB

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

License: Other

CMake 5.76% C++ 84.34% Roff 2.21% GLSL 7.70%
screenshot shaders cli opengl imagemagick c-plus-plus slop c

slop's Introduction

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.
  • Move started selection by holding down the space bar.

Practical Applications

slop can be used to create a video recording script in only three lines of code.

#!/bin/bash
slop=$(slop -f "%x %y %w %h %g %i") || exit 1
read -r X Y W H G ID <<< $slop
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
slop=$(slop -f "%g") || exit 1
read -r G <<< $slop
import -window root -crop $G ~/myimage.png

Furthermore, if you are adventurous, you can create a simple script to copy things from an image itself, unselectable pdf, or just VERY quick rectangular selection or for places where there is no columnar selection (very useful for dataoperators)

You need to have tesseract with support for the specific language, xclip and others are nice if you just want them in clipboard.

#!/bin/env bash

imagefile="/tmp/sloppy.$RANDOM.png"
text="/tmp/translation"
echo "$imagefile"
slop=$(slop -f "%g") || exit 1
read -r G <<< $slop
import -window root -crop $G $imagefile
tesseract $imagefile $text 2>/dev/null 
cat $text".txt" | xclip -selection c

GIF Example of tesseract

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, glew, and glm.

git clone https://github.com/naelstrof/slop.git
cd slop
cmake -DCMAKE_INSTALL_PREFIX="/usr" ./
make && sudo make install

Shaders

Slop allows for chained post-processing shaders. Shaders are written in a language called GLSL, and have access to the following data from slop:

GLSL Name Data Type Bound to
mouse vec2 The mouse position on the screen.
desktop sampler2D An upside-down snapshot of the desktop, this doesn't update as the screen changes.
texture sampler2D The current pixel values of slop's frame buffer. Usually just contains the selection rectangle.
screenSize vec2 The dimensions of the screen, where the x value is the width.
position vec2 attribute This contains the vertex data for the rectangle. Only contains (0,0), (1,0), (1,1), and (0,1).
uv vec2 attribute Same as the position, this contians the UV information of each vertex.

The desktop texture is upside-down because flipping it would cost valuable time.

Shaders must be placed in your ${XDG_CONFIG_HOME}/slop directory, where XDG_CONFIG_HOME is typically ~/.config/. This folder won't exist unless you make it yourself.

Shaders are loaded from the --shader flag in slop. They are delimited by commas, and rendered in order from left to right. This way you can combine multiple shaders for interesting effects! For example, slop -rblur1,wiggle would load ~/.config/slop/blur1{.frag,.vert} and ~/.config/slop/wiggle{.frag,.vert}. Then render the selection rectangle twice, each time accumulating the changes from the different shaders.

Enough chatting about it though, here's some example shaders you can copy from shaderexamples to ~/.config/slop to try out!

The files listed to the right of the | are the required files for the command to the left to work correctly.

  • slop -r blur1,blur2 -b 100 | ~/.config/slop/{blur1,blur2}{.frag,.vert}

slop blur

  • slop -r wiggle -b 10 | ~/.config/slop/wiggle{.frag,.vert}

slop animation

And all together now...

  • slop -r blur1,blur2,wiggle -b 50 -c 1,1,1 | ~/.config/slop/{blur1,blur2,wiggle}{.frag,.vert}

slop animation

Finally here's an example of a magnifying glass.

  • slop -r crosshair | ~/.config/slop/crosshair{.frag,.vert}

slop animation

It's fairly easy to adjust how the shaders work by editing them with your favourite text editor. Or even make your own!

slop's People

Contributors

9ary avatar aeres-u99 avatar alezost avatar aloismahdal avatar anarcat avatar brainwo avatar cicku avatar conradludgate avatar darkwater avatar drunkard avatar faxm0dem avatar goberghen avatar jbeich avatar jfly avatar leo60228 avatar lilyinstarlight avatar naelstrof avatar nicop06 avatar nylen avatar pitasi avatar rafi avatar riri avatar samuel-hunter avatar shadowkyogre avatar soapgentoo avatar stevenhoneyman avatar stuartlangridge avatar titouant avatar vaygr avatar winny- avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

slop's Issues

Force selection ratio

Would it be possible to add the ability to force the aspect ratio of a selection, along the lines of GIMP's "fixed aspect ratio" option for selections?

RFE: resizable rectangle

It'd be nice to be able to resize the selection rectangle. KSnapshot lets you do the following:

The darkened background is also nice feature. I haven't explored all the features of slop yet so I'm not sure if it's already possible.

It'd be nice to have this feature in slop because KSnapshot is unscriptable.

Seems to run from terminal, but not from XFCE's keyboard daemon

Using slop from xfce's keybinding menu has no effect.

Sample:
20170225-18-00-26

This has no effect, and does not prompt with any selection menu.

However, running from a terminal is fine.
20170225-18-01-48

Slop does run, however, if I execute 'termite -e slop' from XFCE bindings.

I am using Arch Linux's latest package version (5.3.28).

Segfault in libXext/libX11

Slop seems to segfault in libXext/libX11 on ubuntu 14.10. I have libXext6 2:1.3.2-1 installed. Here is a valgrind trace:

==24739== Memcheck, a memory error detector
==24739== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==24739== Using Valgrind-3.10.0 and LibVEX; rerun with -h for copyright info
==24739== Command: slop
==24739== 
==24739== Invalid read of size 8
==24739==    at 0x4E69A7D: XQueryExtension (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==24739==    by 0x4E5DD51: XInitExtension (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==24739==    by 0x517C8FE: XextAddDisplay (in /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0)
==24739==    by 0x5177160: XShapeQueryExtension (in /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0)
==24739==    by 0x4087D6: slop::isRectangleSupported() (in /usr/bin/slop)
==24739==    by 0x40D6CB: app(int, char**) (in /usr/bin/slop)
==24739==    by 0x40E924: main (in /usr/bin/slop)
==24739==  Address 0x968 is not stack'd, malloc'd or (recently) free'd
==24739== 
==24739== 
==24739== Process terminating with default action of signal 11 (SIGSEGV)
==24739==  Access not within mapped region at address 0x968
==24739==    at 0x4E69A7D: XQueryExtension (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==24739==    by 0x4E5DD51: XInitExtension (in /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0)
==24739==    by 0x517C8FE: XextAddDisplay (in /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0)
==24739==    by 0x5177160: XShapeQueryExtension (in /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0)
==24739==    by 0x4087D6: slop::isRectangleSupported() (in /usr/bin/slop)
==24739==    by 0x40D6CB: app(int, char**) (in /usr/bin/slop)
==24739==    by 0x40E924: main (in /usr/bin/slop)
==24739==  If you believe this happened as a result of a stack
==24739==  overflow in your program's main thread (unlikely but
==24739==  possible), you can try to increase the size of the
==24739==  main thread stack using the --main-stacksize= flag.
==24739==  The main thread stack size used in this run was 8388608.
==24739== 
==24739== HEAP SUMMARY:
==24739==     in use at exit: 220 bytes in 5 blocks
==24739==   total heap usage: 8 allocs, 3 frees, 280 bytes allocated
==24739== 
==24739== LEAK SUMMARY:
==24739==    definitely lost: 0 bytes in 0 blocks
==24739==    indirectly lost: 0 bytes in 0 blocks
==24739==      possibly lost: 0 bytes in 0 blocks
==24739==    still reachable: 220 bytes in 5 blocks
==24739==         suppressed: 0 bytes in 0 blocks
==24739== Rerun with --leak-check=full to see details of leaked memory
==24739== 
==24739== For counts of detected and suppressed errors, rerun with: -v
==24739== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)
[1]    24739 segmentation fault (core dumped)  valgrind slop

Slop magnifier windows moves out of sight

So I haven't looked at the code yet, thought I post it here first.

I use slop (one of the ways at least) as my magnifier to see tiny text and such, but the window it shows zoomed stuff in is moving around all the time following my cursor, which I assume is normal, the problem is sometimes in its travelings the window gets out of my screen area, which happens when my cursor is at corners or sides of the area.

Setup:
i3wm (no patches),
2 monitors: total resolution is 4480 x 1440, 1080p is to the left of 1440p and their bottoms are lined up, so 1440p is 360 pixels above 1080p, their geometries (from xrandr): 1080p - 1920x1080+0+360, 1440p - 2560x1440+1920+0,
command I use:
slop --nokeyboard --opengl -c 0,0,0,0 --min=1 --max=1 --magnify --magstrength=4 --magpixels=128,
where [4] and [128] can be anything, issue occurs at multiple inputs and does not consistently occur for the same input.

Show dimensions on-the-fly when drawing rectangle

Can you please add an option to display the dimensions inside the rectangle on-the-fly while it's being drawn? Just like Spectacle does.

This would allow the user to select a precise dimension while drawing, for example a precise region of 1280x720. This is useful to avoid selecting unwanted resolutions (like 1283x721) that won't fit for a particular need.

slop can't access a private resource

As the title says, slop can't access some private resource.

~ > slop
X Error of failed request:  BadAccess (attempt to access private resource denied)
  Major opcode of failed request:  33 (X_GrabKey)
  Serial number of failed request:  15
  Current serial number in output stream:  16

This might be also useful

~ > X -version                                                                                     ⏎

X.Org X Server 1.15.0
Release Date: 2013-12-27
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.12.5-1-ARCH x86_64 
Current Operating System: Linux madness 3.14.0-5-ARCH #1 SMP PREEMPT Fri Apr 11 21:02:33 CEST 2014 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-linux root=UUID=1c1beaf2-1bd3-46dd-a933-c5cc06a9ad1a ro quiet
Build Date: 09 January 2014  08:47:24AM

Current version of pixman: 0.32.4
    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.

Multi-head support

It would be nice if slop can dynamically change between following "modes" (I'm thinking of some keyboard binding, single for cycling or more specific ones):

  • selecting of windows (basically as it is now, following pointer)
  • selecting of xinerama/randr heads (active, following pointer)
  • select whole root window
  • custom region

Unused #include <execinfo.h> in main.cpp

It seems that no functions defined in execinfo.h are used in src/main.cpp.

Since e.g. musl libc does not have execinfo.h and no backtrace() etc. functions, it would be nice if the include and any (future) use of functions defined in execinfo.h could be guarded by an #if defined(__GLIBC__).

For the 4.2.17 release the following would be sufficient in src/main.cpp:

#if defined(__GLIBC__)
#include <execinfo.h>
#endif

selection is 1px too small

selection should be 1 pixel wider and taller. all my full-screen screenshots are 1919x1079. my screenshots of window don't catch my right and bottom 1px window border.

Flag to output geometry directly

I often use slop with other X utilities, and I generally end up doing slop -f '%g' so frequently that I feel the default behavior (no flags) or slop -g should have been to "output geometry" directly.

Maybe it's too late now to change default behavior, but having -G, for instance, would still be useful in my opinion.

`undefined reference to` errors

I do have glm, libxext, etc. installed. also I'm using a source distro so the header files are there...
This is with the newest version btw.

libslopy.so: undefined reference to `XShapeCombineRectangles'
libslopy.so: undefined reference to `XScreenNumberOfScreen'
libslopy.so: undefined reference to `XGetWindowProperty'
libslopy.so: undefined reference to `XGrabPointer'
libslopy.so: undefined reference to `XQueryTree'
libslopy.so: undefined reference to `XCreateFontCursor'
libslopy.so: undefined reference to `XSetClassHint'
libslopy.so: undefined reference to `XKeysymToKeycode'
libslopy.so: undefined reference to `XCreateColormap'
libslopy.so: undefined reference to `glXDestroyContext'
libslopy.so: undefined reference to `XInternAtom'
libslopy.so: undefined reference to `XAllocWMHints'
libslopy.so: undefined reference to `glXMakeCurrent'
libslopy.so: undefined reference to `XAllocColor'
libslopy.so: undefined reference to `XChangeProperty'
libslopy.so: undefined reference to `XUngrabPointer'
libslopy.so: undefined reference to `glXGetProcAddressARB'
libslopy.so: undefined reference to `XFreeCursor'
libslopy.so: undefined reference to `XMapWindow'
libslopy.so: undefined reference to `XQueryPointer'
libslopy.so: undefined reference to `XQueryKeymap'
libslopy.so: undefined reference to `glXCreateContext'
libslopy.so: undefined reference to `XGrabKeyboard'
libslopy.so: undefined reference to `XFree'
libslopy.so: undefined reference to `XUngrabKeyboard'
libslopy.so: undefined reference to `XMatchVisualInfo'
libslopy.so: undefined reference to `glXWaitGL'
libslopy.so: undefined reference to `XOpenDisplay'
libslopy.so: undefined reference to `XSetWMProperties'
libslopy.so: undefined reference to `XFlush'
libslopy.so: undefined reference to `XCreateWindow'
libslopy.so: undefined reference to `XDestroyWindow'
libslopy.so: undefined reference to `XTranslateCoordinates'
libslopy.so: undefined reference to `XChangeActivePointerGrab'
libslopy.so: undefined reference to `XCheckTypedEvent'
libslopy.so: undefined reference to `XGetWindowAttributes'
libslopy.so: undefined reference to `glXSwapBuffers'
libslopy.so: undefined reference to `XGetSelectionOwner'
libslopy.so: undefined reference to `XCloseDisplay'

Unable to capture any moving images

Is there any way of freezing the screen and then being able to select from that?
Having to pause a video in order to select a portion of it is getting somewhat of a hassle.

Add a way to adjust screen selection before printing it?

Is there a way you could modify it so the user can drag the border handles for the screen selection? Slop's a pretty interesting project and it'd be nice to have this functionality without resorting to other toolkits. The only ones that do this, but aren't as minimal that I know include deepin screenshot, shutter, and ksnapshot (In approximately that order of increasing libs dep from top of head).

Compton applies transparency effects on the entire screen during selection

Hey, I figured what was causing the blurring issue I mentioned in issue #67; it wasn't slop's effect but in fact my compositor's effect that is applied on transparent GUI elements, such as drop-down menus, the Xfce4 launcher and transparent terminal windows. If you think this is Compton's issue rather than slop's, feel free to close the issue.

https://gist.github.com/jclc/eda606982b8083899c1987eb4ad3a252
I'll post my compton.conf file here in case it'll be useful. The effect itself is blur-kern = "3x3box".

Select region is a bit off?

I think this one might be a small inconsistency in behavior.

Below image is a composition of 4 screenshots from left to right in sequence:

  • I place cursor near the 1px vert. line on the left side
  • now I move mouse to the right/down, creating a region and the border is right next to the vert. line (OK)
  • now I try from the opposite side, placing cursor near the vert. line on the right side
  • moving mouse to the left/down I would expect basically symmetric result (ignore dimensions), though the border is actually set 1px further than expected (BUG?)

1474819892

Wait for the window to be destroyed before returning

maim -s -l often ends up having the highlight overlaid in the screenshot, I'm pretty sure this didn't happen before the recent refactor. It would be a good idea to wait for the slop window to be fully destroyed before handing control back.

Add back old shaders

There were some old shaders like refract, invert and hippie which I quite liked. They've stopped working now. I would attempt to rewrite them but it doesn't seem to be working.

The best I've managed is the following for hippie.frag (where hippie.vert is the same as the provided blur1.vert in shaderexamples)

#version 120

uniform sampler2D texture;
uniform sampler2D desktop;
uniform vec2 screenSize;
uniform float time;

varying vec2 uvCoord;

const float pi = 3.14159265f;

vec3 color(float x) {
    return max(min(sin(vec3(x,x+pi*2.0/3.0,x+pi*4.0/3.0))+0.5,1.0),0.0);
}

void main() {
    vec2 pos = (( gl_FragCoord.xy / screenSize.xy )-0.5)*screenSize.xy/screenSize.x*4.0;
    pos+=normalize(pos);
    pos.xy+=sin(pos.yx*10.0)*0.1;
    float r=(2.0/(dot(pos,pos)*10.0+1.0));
    vec2 rr=vec2(cos(r),sin(r));
    pos=pos.xy*rr.xx+pos.yx*rr.yy*vec2(-1.0,1.0);
    float f=(length(pos)*10.0)+time;
    f+=sin(atan(pos.y,pos.x)*7.0)*5.0;
    float alpha = texture2D(texture,uvCoord).a;
    vec4 c = vec4(color(f), alpha);
    gl_FragColor = vec4(color(f), alpha);
}

(which is the same as the previous version except resolution is replaced with screenSize, and all the desktop* variables removed)

However, this doesn't give the same effect as before. Notably, the colours aren't as visible, and the selection rectangle is also coloured (where before it wasn't).

I attempted setting alpha to 1.0 to fix the colour visibility issue, but I am getting OpenGL threw an error: INVALID_VALUE. This is actually the same error I get when I attempt a simple shader like so:

#version 120

void main {
    gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
}

Failed to grab keyboard

After recently updating slop, I can no longer trigger it using sxhkd.
I get the following error:

Slop encountered an error:
Failed to grab keyboard.

This also happens when using the --nokeyboard argument.

slop v5.3.28, sxhkd 0.5.7, bspwm 0.9.2, Arch Linux

Selection is off

The selection is one pixel off in some cases, most noticeable when selecting against the right/bottom corners of the screen. For example, trying to select an entire 1920x1080 screen will result in a 1919x1079 selection, the rightmost column and bottommost row being cut off.

It is also possible to select a 0px wide or high area. See following screencast: http://novaember.com/s/455173253.webm

Error compiling on Ubuntu Minimal 16.04

This is cmake's output:

Warning: Command gengetopt or sed not found! Won't regenerate command line code. (If you're just compiling this doesn't matter.)
FindIMLIB2.cmake: imlib2-config not found. Please set it manually. IMLIB2_CONFIG=IMLIB2_CONFIG-NOTFOUND
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find OpenGL (missing: OPENGL_gl_LIBRARY OPENGL_INCLUDE_DIR)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindOpenGL.cmake:172 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:109 (find_package)


-- Configuring incomplete, errors occurred!

ID returned is incorrect (or useless)

I want to use slop to select window that I further want to close using wmctrl, but the ID returned by slop seems to be incorrect; I tried to use it with wmctrl but it closes wrong windows or nothing (seemingly).

Other tools like wmctrl (wmctrl -l) or xwininfo return another number (don't want to use them as their interactive mode is none or inferior to slop); slop seems to be the odd one here. Or maybe I just don't understand it correctly, in which case it would be nice to document it somewhere.

Disable blur effect without disabling OpenGL acceleration

I noticed that there's been added a blur effect for the duration of the selection, rather problematic since it even shows up in screenshots taken with maim. Disabling OpenGL acceleration does disable it, but it also creates that selection box artifact that plagues scrot. I didn't find an option to disable it in the man page, did I miss something?

Dependencies for Ubuntu 16.04

I had to install the following packages before I can configure and compile:

sudo apt-get install cmake libglew-dev glew-utils gengetopt libimlib2-dev libglm-dev

It would help other users if this is put in the readme.

debian packaging

This package is now in NEW, which means it is in the proces of entering the Debian archive. This can take some time, depending on the size of the package. Once the NEW process is completed, it takes about 10 days for the package to trickle down into "testing", which will become the next Debian release.

This means your package will end up being part of Debian "stable" soon. If you want to add features or fix bugs for the current packaged version (4.3.21), it would be important to make a release shortly otherwise an old version may be stuck in debian stable for a while (2-3 years). A typical Debian release, according to those historical statistics:

  • endures a freeze cycle of 7 +/- 1 months before getting released.
  • is released about 2 years after the previous one (the often cited example of Debian Sarge being quite an exceptional event in Debian history).
  • leaves users about 1 year to upgrade to the next one once this latter itself gets released.
  • has (from release to the end of security updates) a total lifetime of about 3 years.

The next freeze is scheduled in february 2017 which gives an expected release date for the next stable around Q4 2017, which would mean main support until 2020 and extended LTS until 2022.

The source code of the debian package is in the debian branch in collab-maint. You can merge it here directly and take over maintainership, in which case you will need a sponsor to upload new versions into Debian, which I am happy to do. Otherwise I will continue maintaining it separately and watch for new releases here and you have nothing special to do.

This is a purely informative ticket and you may close it as you see fit. You may also follow progress on the Debian packaging effort in the ITP #842974.

Selection cancels immediately when called by i3 keybinding

I just found out about maim, however I'm facing a problem with slop itself. I know this much :
-Any nested call to slop faces the same issue, be it a direct call, maim -s or even a script.
-Only i3 keybindings are affected, so if I add something like exec_always slop to my config then restart i3, I do get the slop window. It also works with dmenu or when called from a terminal.
-Running it with something like urxvt -e maim -s in my script does work but it spawns a new terminal which is disturbing.

I get the following output :

X=0
Y=0
W=0
H=0
G=0x0+0+0
ID=0
Cancel=true

I can retrieve any other info you might need. I run Arch Linux and the problem happens with both the latest version from the -git AUR package and the version in official repos (3.1.15).

Confirmable mode

I know there are requests for resizable boxes (#33), and if it seems like that would supercede this, I totally understand: could slop have a --confirm flag, which wouldn't commit the click or click+release, until the user hits enter? Alternatively, hitting esc would cancel the operation. Until the user hits enter, we could draw more boxes or click other windows.

Thanks! Slop and maim are great!

Version 3.1.12 regresses maim's screenshotting ability?

These two pictures are taken with slop 3.1.12 and maim 2.3.31
test, taken with highlight
test, taken with highlight
test2, taken with outline
test2, taken with outline


And these two with slop 3.1.10 and maim 2.3.31
test3, taken with highlight
test3, taken with highlight
test4, taken with outline
test4, taken with outline


And these two with slop 3.1.12 and maim 2.3.34
test5, taken with highlight
test5, taken with highlight
test6, taken with outline
test6, taken with outline


And these two with slop 3.1.10 and maim 2.3.34
test7, taken with highlight
test7, taken with highlight
test8, taken with outline
test8, taken with outline


I'm not sure if anyone else noticed this (I'm running Compiz 0.8.x here, is this noticeable with other window managers?), but it looks like that slop isn't tearing down its window properly.

Also of note is the fact that slop's highlight rectangle mode still shows up in these screenshots (as indicated by the dim color).

Magnify mode

I was really enjoying the experimental OpenGL magnifying mode, which seems to have been removed recently. Any plans of bringing it back?

I can't compile it, problem with GLEW

The output:

cmake -DCMAKE_OPENGL_SUPPORT=true ./
-- Regenerating cmdline.in
CMake Error at CMakeLists.txt:109 (find_package):
By not providing "FindGLEW.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "GLEW", but
CMake did not find one.

Could not find a package configuration file provided by "GLEW" with any of
the following names:

GLEWConfig.cmake
glew-config.cmake

Add the installation prefix of "GLEW" to CMAKE_PREFIX_PATH or set
"GLEW_DIR" to a directory containing one of the above files. If "GLEW"
provides a separate development package or SDK, be sure it has been
installed.

-- Configuring incomplete, errors occurred!

Segfault with -k

slop segfaults when I start dragging the cursor, first bad commit is ccb020c (bisected).

I'm going to take a quick look.

"Failed to grab X cursor" from VNC session

Running slop within a VNC session, I get:

$ slop
Error: Failed to grab X cursor.
       This can be caused by launching slop weirdly.

Any more info/debugging I can provide?

Ability to adjust selection

Hey, I'm missing this feature:

https://gfycat.com/DisloyalFalseHamadryas

This is my own personal tool, unfortunately it doesn't work on linux.

How it works:

  1. First you select the region you want to target, just like slop.
  2. The window will show the target region, you can move the target area around by left mouse button and dragging.
  3. You can resize the target area by dragging with left mouse button on any of the corners/sides.
  4. Finally you select/submit the target area with right clicking anywhere in the target area.

Optionally: Escape will cancel the selection, up to you how you want to handle this...

This allows you to get it right in 1 try, instead of trying to capture what you needed multiple times... Currently i run maim -s check it in my image viewer feh image, and if it passes ill just upload it, otherwise I'll have to retry the whole process again. it would be better if I could just adjust it in that 1 go while I'm still working with it.

Today I frequently cut out parts that I want inside the screenshot, this feature would help a lot.

Detected size of GTK windows with headerbar is larger than what it should be

You can try for example GEdit or Pitivi. The detected size has +25 pixels on the left, +25 pixels on the right, +22 pixels at the top, +28 pixels at the bottom. Same result with -n or without.

If you use Alt+PrintScreen in Gnome Shell you get a screenshot of the focused window without these margins, so it should be possible.

Pragma messages about deprecation of GLM degrees

I get a bunch of messages like this when compiling slop:

[ 86%] Building CXX object CMakeFiles/slopy.dir/src/glrectangle.cpp.o
In file included from /usr/include/glm/gtc/quaternion.hpp:402:0,
                 from /usr/include/glm/gtc/type_ptr.hpp:63,
                 from /home/james/code/slop/src/shader.hpp:31,
                 from /home/james/code/slop/src/glrectangle.hpp:30,
                 from /home/james/code/slop/src/glrectangle.cpp:1:
/usr/include/glm/gtc/quaternion.inl: In function ‘glm::detail::tquat<T, P> glm::rotate(const glm::de
tail::tquat<T, P>&, const T&, const glm::detail::tvec3<T, P>&)’:
/usr/include/glm/gtc/quaternion.inl:621:165: note: #pragma message: GLM: rotate function taking degr
ees as a parameter is deprecated. #define GLM_FORCE_RADIANS before including GLM headers to remove t
his message.
 #  pragma message("GLM: rotate function taking degrees as a parameter is deprecated. #define GLM_FO
RCE_RADIANS before including GLM headers to remove this message.")

(about other GLM functions too, for example roll, pitch, yaw, angle, angleAxis)

segmentation fault

a recent archlinux update broke maim/slop:

Core was generated by `slop -v'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x00007f0ec748c652 in ?? () from /usr/lib/libdl.so.2
#2  0x00007f0ec748c0ba in dlsym () from /usr/lib/libdl.so.2
#3  0x00007f0ec7b6e69e in ?? () from /usr/lib/nvidia/libGL.so.1
#4  0x00007f0ec7b52556 in ?? () from /usr/lib/nvidia/libGL.so.1
#5  0x00007f0ec91ea15a in call_init.part () from /lib64/ld-linux-x86-64.so.2
#6  0x00007f0ec91ea2a6 in _dl_init () from /lib64/ld-linux-x86-64.so.2
#7  0x00007f0ec91dbdba in _dl_start_user () from /lib64/ld-linux-x86-64.so.2
#8  0x0000000000000002 in ?? ()
#9  0x00007fff90996195 in ?? ()
#10 0x00007fff9099619a in ?? ()
#11 0x0000000000000000 in ?? ()
(gdb) 

urxvt under i3 not reported properly

I'm using slop inside a script on Fedora 23 under i3 to select window that I further close using wmctrl. I've been doing this for few days now. With most windows it works fine.

Unfortunately not with urxvt.

When I try to select urxvt, it seems as if an invisible window lays over actual urxvt window, taking up almost all space, except thin (few pixels) strip near bottom border. When I manage to avoid the invisible window (which is kinda cumbersome), it works fine and urxvt gers closed, otherwise nothing happens (wmctrl just ignores the attempt).

Further observations:

  • In hexadecimal, the overlay window always has ID like 0x??0000a while the correct window
    has 0x??0000f, i.e. the last digit seem to be always 'a' and 'f'.
  • Other tools (wmctrl -l, xwininfo, xdpyinfo and xdotool selectwindow) always show just the
    correct window and never the overlay.
  • xprop -id shows nothing for the overlay, normal output for the correct window.
  • the size of the overlay is always multiple of line height, so the strip may be zero.
  • One application that seems to have similar problem is Opera ... the legacy proprietary
    opera-12.16 (The hex IDs are 3c00005 for correct window, 0x3c00011 for overlay; and
    xprop shows only XdndAware(ATOM) = BITMAP for overlay).

error: GLSL 1.30 is not supported

Somewhere after version 4.3.21, slop gives the following error when executed on my Intel powered laptop, compared to my Nvidia powered desktop which does not have this issue. Slop worked fine in 4.3.21, but then the archlinux package updated to 5.3.37, and now slop fails with the following message.

Slop encountered an error:
Failed to compile shader `#version 130
attribute vec2 position;
attribute vec2 uv;
varying vec2 uvCoord;
void main()
{
uvCoord = uv;
gl_Position = vec4(position,0,1);
}
`:
0:1(10): error: GLSL 1.30 is not supported. Supported versions are: 1.10, 1.20, and 1.00 ES

Is the fix to simply disable OpenGL with the -o option, since GLSL 1.30 is not supported (on the laptop, I assume)?

"undefined reference to `clock_gettime'" when trying to compile slop on Ubuntu 12.04

Hey,

first of all thanks a lot for this project. Scrot has been giving me headaches with its selection artifacts and I am very glad to have stumbled on slop.

Unfortunately I've been struggling with compiling your project on my system. make consistently fails with an undefined reference toclock_gettime'error. For what it's worth, this is the output I get forcmakeandmake`:

$ cmake ./
-- The C compiler identification is GNU 4.6.3
-- The CXX compiler identification is GNU 4.6.3
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++
-- Check for working CXX compiler: /usr/bin/g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Command gengetopt or sed not found! Won't regenerate command line code.
Replacing version in readme...
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/glutanimate/slop

$ make
Scanning dependencies of target slop
[ 25%] Building C object CMakeFiles/slop.dir/src/cmdline.c.o
[ 50%] Building CXX object CMakeFiles/slop.dir/src/rectangle.cpp.o
[ 75%] Building CXX object CMakeFiles/slop.dir/src/x.cpp.o
[100%] Building CXX object CMakeFiles/slop.dir/src/main.cpp.o
Linking CXX executable slop
CMakeFiles/slop.dir/src/main.cpp.o: In function `app(int, char**)':
main.cpp:(.text+0xe3d): undefined reference to `clock_gettime'
main.cpp:(.text+0xe56): undefined reference to `clock_gettime'
collect2: ld returned 1 exit status
make[2]: *** [slop] Error 1
make[1]: *** [CMakeFiles/slop.dir/all] Error 2
make: *** [all] Error 2

I am not very experienced with compiling stuff, so I am not quite sure if I've forgotten to install a dependency or made some other mistake. I'd really appreciate any help in getting slop to compile.

Thanks a lot in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.