Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/r00tman/corrupter
Simple image glitcher suitable for producing nice looking lockscreens
https://github.com/r00tman/corrupter
golang i3 i3lock image-processing linux sway
Last synced: 18 days ago
JSON representation
Simple image glitcher suitable for producing nice looking lockscreens
- Host: GitHub
- URL: https://github.com/r00tman/corrupter
- Owner: r00tman
- License: bsd-2-clause
- Created: 2019-03-23T13:47:33.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-11T09:46:29.000Z (almost 2 years ago)
- Last Synced: 2024-07-31T07:16:56.698Z (4 months ago)
- Topics: golang, i3, i3lock, image-processing, linux, sway
- Language: Go
- Size: 14.5 MB
- Stars: 352
- Watchers: 5
- Forks: 14
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# corrupter
Simple image glitcher suitable for producing nice looking i3lock backgrounds## Getting Started
```shell
$ git clone https://github.com/r00tman/corrupter
$ cd corrupter && go build
$ ./corrupter -h
$ ./corrupter shots/example.png out.png && xdg-open out.png
```Alternatively, you can use `go get -u github.com/r00tman/corrupter` to install. Then, the binary will be at `~/go/bin/corrupter` (`$GOPATH/bin/corrupter` if `$GOPATH` is set).
If you're using an Arch-based distro, you can use one of the two AUR packages!
- [corrupter-git](https://aur.archlinux.org/packages/corrupter-git/) maintained by [alrayyes](https://github.com/alrayyes), for an automated build, and
- [corrupter-bin](https://aur.archlinux.org/packages/corrupter-bin/) maintained by [marcospb19](https://github.com/marcospb19), for the pre-built binary.
- [swaylock-corrupter](https://aur.archlinux.org/packages/swaylock-corrupter) maintained by [slithery0](https://github.com/slithery0), for corrupter pre-build binary along with swaylock intregation.At the moment, you can only pass and output `.png` images. But that's enough to work well with `scrot` and `i3lock`.
### Using with i3lock+scrot / swaylock+grim
As `corrupter` only glitches the image for a cool background, you'd have to set up a lock script.Example screenshot lock script:
```bash
#!/usr/bin/env bash
tmpbg="/tmp/screen.png"
scrot "$tmpbg"; corrupter "$tmpbg" "$tmpbg"
i3lock -i "$tmpbg"; rm "$tmpbg"
```The script above takes a screenshot with `scrot`, distorts it with `corrupter`, and then locks the screen using `i3lock`.
If you're using `i3`, you can create the script at `~/.lock`, and then add a lock `bindsym`.
```
bindsym $mod+Control+l exec --no-startup-id bash ./.lock
```### Using pre-corrupted images
Alternatively, you can pre-corrupt an image and always use it (which is faster):
```shell
$ ./corrupter shots/example.png ~/.wallpaper.png
```and then, in your `~/.config/i3/config`:
```
bindsym $mod+Control+l exec --no-startup-id i3lock -i ./.wallpaper.png
```This method is slightly faster since the image processing has been done beforehand.
### Less distorted image
Default config is pretty heavy-handed. To get less disrupted images you may want to reduce blur and distortion:
```shell
$ ./corrupter -mag 1 -boffset 2 shots/example.png out.png && xdg-open out.png
```## Examples
Images using the default parameters:
![demo1](https://raw.githubusercontent.com/r00tman/corrupter/master/shots/example-after.png)
![demo2](https://raw.githubusercontent.com/r00tman/corrupter/master/shots/light-theme-example.png)
![demo3](https://raw.githubusercontent.com/r00tman/corrupter/master/shots/dark-theme-example.png)With custom parameters: \
Before:
![demo4](https://raw.githubusercontent.com/r00tman/corrupter/master/shots/ps2-example-before.png)After (custom parameters and ImageMagick dim):
![demo5](https://raw.githubusercontent.com/r00tman/corrupter/master/shots/ps2-example-after.png)