{"id":13418583,"url":"https://github.com/naelstrof/slop","last_synced_at":"2025-05-16T03:04:50.350Z","repository":{"id":10502488,"uuid":"12687134","full_name":"naelstrof/slop","owner":"naelstrof","description":"slop (Select Operation) is an application that queries for a selection from the user and prints the region to stdout.","archived":false,"fork":false,"pushed_at":"2025-04-17T18:48:24.000Z","size":1120,"stargazers_count":887,"open_issues_count":52,"forks_count":60,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-04-18T08:51:52.414Z","etag":null,"topics":["c","c-plus-plus","cli","imagemagick","opengl","screenshot","shaders","slop"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naelstrof.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2013-09-08T20:33:25.000Z","updated_at":"2025-04-17T18:48:28.000Z","dependencies_parsed_at":"2023-01-13T15:58:53.530Z","dependency_job_id":"a69fef39-08ee-4e7a-93a5-2d1617604562","html_url":"https://github.com/naelstrof/slop","commit_stats":{"total_commits":268,"total_committers":40,"mean_commits":6.7,"dds":0.2425373134328358,"last_synced_commit":"499db815ee968b21454d4aae69458549c50315bf"},"previous_names":[],"tags_count":68,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naelstrof%2Fslop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naelstrof%2Fslop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naelstrof%2Fslop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naelstrof%2Fslop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naelstrof","download_url":"https://codeload.github.com/naelstrof/slop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254459088,"owners_count":22074605,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c","c-plus-plus","cli","imagemagick","opengl","screenshot","shaders","slop"],"created_at":"2024-07-30T22:01:04.078Z","updated_at":"2025-05-16T03:04:45.171Z","avatar_url":"https://github.com/naelstrof.png","language":"C++","readme":"# slop\n\nslop (Select Operation) is an application that queries for a selection from the user and prints the region to stdout.\n\n## Features\n\n* Hovering over a window will cause a selection rectangle to appear over it.\n* Clicking on a window makes slop return the dimensions of the window, and it's ID.\n* OpenGL accelerated graphics where possible.\n* Supports simple arguments:\n  * Change selection rectangle border size.\n  * Select X display.\n  * Set padding size.\n  * Force window, or pixel selections with the tolerance flag.\n  * Set the color of the selection rectangles to match your theme! (Even supports transparency!)\n  * Remove window decorations from selections.\n* Supports custom programmable shaders.\n* Move started selection by holding down the space bar.\n\n## Practical Applications\n\nslop can be used to create a video recording script in only three lines of code.\n\n```bash\n#!/bin/bash\nslop=$(slop -f \"%x %y %w %h %g %i\") || exit 1\nread -r X Y W H G ID \u003c\u003c\u003c $slop\nffmpeg -f x11grab -s \"$W\"x\"$H\" -i :0.0+$X,$Y -f alsa -i pulse ~/myfile.webm\n```\n\nYou can also take images using imagemagick like so:\n\n```bash\n#!/bin/bash\nslop=$(slop -f \"%g\") || exit 1\nread -r G \u003c\u003c\u003c $slop\nimport -window root -crop $G ~/myimage.png\n```\n\nFurthermore, 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)\n\nYou need to have tesseract with support for the specific language, xclip and others are nice if you just want them in clipboard. \n\n```bash\n#!/bin/env bash\n\nimagefile=\"/tmp/sloppy.$RANDOM.png\"\ntext=\"/tmp/translation\"\necho \"$imagefile\"\nslop=$(slop -f \"%g\") || exit 1\nread -r G \u003c\u003c\u003c $slop\nimport -window root -crop $G $imagefile\ntesseract $imagefile $text 2\u003e/dev/null \ncat $text\".txt\" | xclip -selection c\n\n```\n\n![GIF Example of tesseract](https://media.giphy.com/media/fYP0sFWaB0XUEcYDoI/giphy.gif)\n\nIf you don't like ImageMagick's import: Check out [maim](https://github.com/naelstrof/maim) for a better screenshot utility.\n\n## Lets see some action\n\nOk. Here's a comparison between 'scrot -s's selection and slop's:\n\n![scrotbad](scrotbad.png)\n![slopgood](slopgood.png)\n\nYou can see scrot leaves garbage lines over the things you're trying to screenshot!\nWhile 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.\n\n## how to install\n\n### Install using your Package Manager (Preferred)\n\n* [Arch Linux: extra/slop](https://www.archlinux.org/packages/extra/x86_64/slop/)\n* [Void Linux: slop](https://github.com/void-linux/void-packages/blob/master/srcpkgs/slop/template)\n* [FreeBSD: x11/slop](http://www.freshports.org/x11/slop/)\n* [NetBSD: x11/slop](http://pkgsrc.se/x11/slop)\n* [OpenBSD: graphics/slop](https://openports.pl/path/graphics/slop)\n* [Gentoo: x11-misc/slop](https://packages.gentoo.org/packages/x11-misc/slop)\n* [NixOS: slop](https://github.com/NixOS/nixpkgs/blob/master/pkgs/tools/misc/slop/default.nix)\n* [GNU Guix: slop](https://www.gnu.org/software/guix/packages/#slop)\n* [Debian: slop](https://packages.debian.org/sid/slop)\n* [Ubuntu: slop](https://packages.ubuntu.com/slop)\n* [Fedora: slop](https://src.fedoraproject.org/rpms/slop)\n* [Red Hat Enterprise Linux (via EPEL): slop](https://src.fedoraproject.org/rpms/slop)\n* [CentOS Stream and similar (via EPEL): slop](https://src.fedoraproject.org/rpms/slop)\n* [Ravenports: slop](http://www.ravenports.com/catalog/bucket_CB/slop/standard/)\n* [Alpine Linux: community/slop](https://pkgs.alpinelinux.org/package/edge/community/x86_64/slop)\n* Please make a package for slop on your favorite system, and make a pull request to add it to this list.\n\n### Install using CMake (Requires CMake)\n\n*Note: Dependencies should be installed first: libxext, glew, and glm.*\n\n```bash\ngit clone https://github.com/naelstrof/slop.git\ncd slop\ncmake -DCMAKE_INSTALL_PREFIX=\"/usr\" ./\nmake \u0026\u0026 sudo make install\n```\n\n### Shaders\n\nSlop allows for chained post-processing shaders. Shaders are written in a language called GLSL, and have access to the following data from slop:\n\n| GLSL Name  | Data Type      | Bound to                                                                                        |\n| ---------- | -------------- | ----------------------------------------------------------------------------------------------- |\n| mouse      | vec2           | The mouse position on the screen.                                                               |\n| desktop    | sampler2D      | An upside-down snapshot of the desktop, this doesn't update as the screen changes.              |\n| texture    | sampler2D      | The current pixel values of slop's frame buffer. Usually just contains the selection rectangle. |\n| screenSize | vec2           | The dimensions of the screen, where the x value is the width.                                   |\n| position   | vec2 attribute | This contains the vertex data for the rectangle. Only contains (0,0), (1,0), (1,1), and (0,1).  |\n| uv         | vec2 attribute | Same as the position, this contians the UV information of each vertex.                          |\n\nThe desktop texture is upside-down because flipping it would cost valuable time.\n\nShaders 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.\n\nShaders 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.\n\nEnough chatting about it though, here's some example shaders you can copy from [shaderexamples](https://github.com/naelstrof/slop/tree/master/shaderexamples) to `~/.config/slop` to try out!\n\nThe files listed to the right of the `|` are the required files for the command to the left to work correctly.\n\n* `slop -r blur1,blur2 -b 100` | `~/.config/slop/{blur1,blur2}{.frag,.vert}`\n\n![slop blur](https://my.mixtape.moe/bvsrzr.png)\n\n* `slop -r wiggle -b 10` | `~/.config/slop/wiggle{.frag,.vert}`\n\n![slop animation](http://i.giphy.com/12vjSbFZ0CWDW8.gif)\n\nAnd all together now...\n\n* `slop -r blur1,blur2,wiggle -b 50 -c 1,1,1` | `~/.config/slop/{blur1,blur2,wiggle}{.frag,.vert}`\n\n![slop animation](http://i.giphy.com/kfBLafeJfLs2Y.gif)\n\nFinally here's an example of a magnifying glass.\n\n* `slop -r crosshair` | `~/.config/slop/crosshair{.frag,.vert}`\n\n![slop animation](http://i.giphy.com/2xy0fC2LOFQfm.gif)\n\nIt's fairly easy to adjust how the shaders work by editing them with your favourite text editor. Or even make your own!\n","funding_links":[],"categories":["TODO scan for Android support in followings","C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaelstrof%2Fslop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaelstrof%2Fslop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaelstrof%2Fslop/lists"}