v7.72025-06-29
本次更新聚焦构建与渲染体验的三处改善。构建方面,修复了 CMake 下 GLEW 无法正确链接的问题,同时新增对 C++17 编译标准的支持,升级工具链后即可用新标准构建项目。渲染方面,矩形绘制改为与显示信号同步刷新,取代原先固定等待 10 毫秒的做法,画面输出更加及时,也不再有无谓的延迟。
v7.62018-04-23
Slop now respects _NET_FRAME_EXTENTS2017-07-30
slop 这次修了一个令人头疼的问题:在 Mutter(GNOME 窗口管理器)环境下,截图选框不再会把窗口周围的阴影选进去。之前在 GNOME 下拖选窗口时,选区边缘总有一段莫名其妙的留白,导致截图结果比实际窗口大出一圈。现在选框能真正贴合窗口边界,截图内容干净利落。
GLEW is back, Nvidia preload segfault is eliminated.2017-07-20
本次更新修复了 slop 启动加载时偶发崩溃(段错误)的问题——根因在于未链接 pthreads,现在已在构建中补上这一链接。依赖项方面重新引入了 GLEW:此前为减少体积改用自定义 OpenGL 加载器,实际反而占用更多空间,若项目本身就要用 GLEW,直接依赖它更划算。两处改动都不影响接口,升级后建议重新编译验证加载流程。
Switched to a POSIX compliant argument parser.2017-05-24
本次更新对命令行参数解析做了不兼容调整:带值选项不再支持 -b100 这种连写简写,必须在选项与数值之间加空格,写成 -b 100。如果你的脚本或别名里用了连写形式,升级后会直接报错或被解析成其他含义,建议提前全局检查一遍调用方式。
Shader Support2017-02-28
In this release, users can now supply their own shaders to create neat effects.
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 ${XDGCONFIGHOME}/slop directory, where XDGCONFIGHOME 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 -rblur1,blur2 -b100 | ~/.config/slop/{blur1,blur2}{.frag,.vert}
slop blur
- slop -rwiggle -b10 | ~/.config/slop/wiggle{.frag,.vert}
slop animation
And all together now...
- slop -rblur1,blur2,wiggle -b50 -c1,1,1 | ~/.config/slop/{blur1,blur2,wiggle}{.frag,.vert}
slop animation
Finally here's an example of a magnifying glass.
- slop -rcrosshair | ~/.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!
Librarification, OpenGL requirement, wayland support, manpages.2017-02-24
Slop was remade to be cleaner, faster, and easier to use.
It's options parser was re-written so many flags/options now function differently, don't exist, or were renamed.
Now slop requires basic OpenGL stuff to compile, but will easily function without it. If it fails to launch an OpenGL context, it'll use the XShape extension instead.
OpenGL support! Shaders! Magnification! Texture themes!2015-07-12
OpenGL Support
After a lot of hard work, slop has been upgraded with OpenGL support. This means hardware accelerated rectangles that support shaders, magnifying glasses, and themes!
Shaders
Demo Shaders
Click for video
You can create, use, and edit shaders from simple configuration folders. They're pretty basic right now, but you can create some really neat effects. Slop ships with serveral defaults:
- wiggle
- refract
- invert
- cross
- ripple
- simple
- hippie
Magnifying Glass
Demo MagGlass
Click for video
You can spawn a magnifying glass that gives you pixel perfect selections! Probably needs an option to disable keyboard and mouse grabbing so you can just spawn it whenever and keep it around.
Themes
Demo Themes
No video, sorry
Slop now can load and display textures, ships with a lame default "gothic". You can easily create more in your configuration folder at ~/.config/slop. See the README.md for more information.
Some new features.2014-10-04
- Added opacity capabilities. --color now checks for an alpha value, but it's optional.
- Added new option --highlight. Which instead of drawing a border around the selection, it draws over the selection. Best used with --color with an alpha set below 1.
- Added option --minimumsize and --maximumsize, setting them both to the same value disables drag selections.
- Slop windows now let all events fall through.
- Incredibly improved rendering quality and speed, no longer do I re-size or move windows around. For some reason that's really expensive in X11...
- Slop now outputs the ID of a selected window if any.
- Minor bugfixes and adjustments.
ATTENTION PACKAGE MAINTAINERS: Please use the CMAKEINSTALLPREFIX to set the install location. The binary is now installed to CMAKEINSTALLPREFIX/bin/slop instead of the original CMAKEINSTALLPREFIX/slop.
Feature complete, should be stable on most configurations.2014-09-26
- Windows are now properly selected via EnterNotify events instead of using XQueryPointer. This is mainly notable for the --nodecorations option I added.
- Improved response time on rectangle drawing. Slop no longer creates a new rectangle every time the window selection changes, and it waits 0.01 seconds between moving/resizing rectangles for xorg to catch up and display the changes. This is a huge deal because now dragging a selection is super smooth.
- Added a --nodecorations option that lets you select subwindows (Thanks to EnterNotify events). Thus usually removing decorations from screenshots, but its effectiveness varies between different applications and window managers.
- --nokeyboard should be useless now. There's proper error handling, I've used a more formal way to "grab" the keyboard (So it should error less), and even if it fails to grab the keyboard you should still be able to cancel selections with keyboard presses albeit at the cost of having the key events fall through to other applications.
- Slop now blocks until all windows are cleaned up by xorg properly. There's actually events and functions for this that I overlooked (DestroyNotify, XIfEvent, CWEventMask, StructureNotifyMask). Before I'd destroy the window then just sleep for x amount of time hoping xorg would decide to clean up the window in time, but that doesn't work at all due to xorg relying on a responsive program to actually remove the window for whatever reason. So now I really won't be lying when I say that slop's rectangles won't show up in screenshots or video recordings now! (I hope)
- Slop prints two new variables on success now: "G" and "Cancel". G is set to the geometry of the selection (eg 1920x1080+0+0 ), Cancel is set to true or false depending on if the selection was canceled or failed in some way. These variables can make some scripts that use slop a whole lot cleaner and more reliable.
- Several bugfixes like the selection being 1 pixel off, the cursor being the wrong image when there was no drag selection, and slop forgetting which window you selected before you started dragging has been fixed.
- Thanks to Darkwater I added a --version option.