From 04b657b58cf54ac611f73723ec44f51feba16b15 Mon Sep 17 00:00:00 2001 From: ozwaldorf Date: Wed, 3 Jan 2024 12:38:44 -0500 Subject: feat: blur tweaks (#258) --- sway/commands/blur_noise.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 sway/commands/blur_noise.c (limited to 'sway/commands/blur_noise.c') diff --git a/sway/commands/blur_noise.c b/sway/commands/blur_noise.c new file mode 100644 index 00000000..bd737911 --- /dev/null +++ b/sway/commands/blur_noise.c @@ -0,0 +1,28 @@ +#include "sway/commands.h" +#include "sway/config.h" +#include "sway/output.h" + +struct cmd_results *cmd_blur_noise(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "blur_noise", EXPECTED_EQUAL_TO, 1))) { + return error; + } + + char *inv; + float value = strtof(argv[0], &inv); + if (*inv != '\0' || value < 0 || value > 1) { + return cmd_results_new(CMD_FAILURE, "Invalid noise specified"); + } + + config->blur_params.noise = value; + + struct sway_output *output; + wl_list_for_each(output, &root->all_outputs, link) { + if (output->renderer) { + output->renderer->blur_buffer_dirty = true; + output_damage_whole(output); + } + } + + return cmd_results_new(CMD_SUCCESS, NULL); +} -- cgit v1.2.3