diff --git a/sway/commands/output/color_profile.c b/sway/commands/output/color_profile.c index 98481329b..b145d449b 100644 --- a/sway/commands/output/color_profile.c +++ b/sway/commands/output/color_profile.c @@ -59,11 +59,19 @@ struct cmd_results *output_cmd_color_profile(int argc, char **argv) { return cmd_results_new(CMD_INVALID, "Missing color_profile first argument."); } - if (strcmp(*argv, "srgb") == 0) { + if (strcmp(*argv, "gamma22") == 0) { wlr_color_transform_unref(config->handler_context.output_config->color_transform); config->handler_context.output_config->color_transform = NULL; config->handler_context.output_config->set_color_transform = true; + config->handler_context.leftovers.argc = argc - 1; + config->handler_context.leftovers.argv = argv + 1; + } else if (strcmp(*argv, "srgb") == 0) { + wlr_color_transform_unref(config->handler_context.output_config->color_transform); + config->handler_context.output_config->color_transform = + wlr_color_transform_init_linear_to_inverse_eotf(WLR_COLOR_TRANSFER_FUNCTION_SRGB); + config->handler_context.output_config->set_color_transform = true; + config->handler_context.leftovers.argc = argc - 1; config->handler_context.leftovers.argv = argv + 1; } else if (strcmp(*argv, "icc") == 0) { @@ -106,7 +114,8 @@ struct cmd_results *output_cmd_color_profile(int argc, char **argv) { config->handler_context.leftovers.argv = argv + 2; } else { return cmd_results_new(CMD_INVALID, - "Invalid color profile specification: first argument should be icc|srgb"); + "Invalid color profile specification: " + "first argument should be gamma22|icc|srgb"); } return NULL; diff --git a/sway/sway-output.5.scd b/sway/sway-output.5.scd index cc48589c3..afe213643 100644 --- a/sway/sway-output.5.scd +++ b/sway/sway-output.5.scd @@ -178,8 +178,8 @@ must be separated by one space. For example: updated to work with different bit depths. This command is experimental, and may be removed or changed in the future. -*output* color_profile srgb|[icc ] - Sets the color profile for an output. The default is _srgb_. should be a +*output* color_profile gamma22|srgb|[icc ] + Sets the color profile for an output. The default is _gamma22_. should be a path to a display ICC profile. Not all renderers support this feature; currently it only works with the