Crates.io | shadower |
lib.rs | shadower |
version | 0.1.4 |
source | src |
created_at | 2023-03-10 17:20:08.603886 |
updated_at | 2023-03-17 00:25:26.09582 |
description | A simple CLI utility to add rounded borders, padding, and shadows to images. |
homepage | |
repository | https://github.com/n3oney/shadower |
max_upload_size | |
id | 806588 |
size | 50,769 |
paru -S shadower-git
cargo build --release
cargo install shadower
shadower by default reads the image from stdin and outputs it to stdout, so here are some non-config examples:
wl-paste | shadower | wl-copy
shadower < image.png > image_shadow.png
grimblast save active - | shadower | wl-copy
However, you can also customize every aspect of the rounding, shadows, and padding of the images.
To do so, you can use math expressions, which let you dynamically calculate the values depending on the size of the input image.
For example, setting the --offset-y
to max / 6 / 4
, while running on a 800x600px image, will result in the shadow being offset down by 33.(3)px.
You can also use the clamp(min, val, max)
function to clamp a function to a given min and max, or if you only need a min
or max
, put _
in the unnecessary value. (clamp(_, 20, 10)
is min(20, 10)
)
To view all the flags, use --help
.
You can also configure shadower using a config file instead of the flags. The default config location is $XDG_CONFIG_HOME/shadower/config.toml
, but you can override it using the --config
flag.
The config file can change every option (except the --config
), and you just have to put the values in.
The keys have to use snake_case instead of kebab-case.
Example config:
radius="20"
padding_x="15 + max/2"
You can use environment variables, they will be expanded.
The default config values are always displayed in the --help
.
No need to ask me if you can implement something, if I think it's a good thing I'll merge it in.