diff --git a/kitty/rc/base.py b/kitty/rc/base.py index 8dd0f0dc6..6d8c483cd 100644 --- a/kitty/rc/base.py +++ b/kitty/rc/base.py @@ -82,6 +82,7 @@ PayloadGetType = PayloadGetter ArgsType = List[str] ImageCompletion = CompletionSpec.from_string('type:file group:"Images"') ImageCompletion.extensions = 'png', 'jpg', 'jpeg', 'webp', 'gif', 'bmp', 'tiff' +SUPPORTED_IMAGE_FORMATS = tuple(x.upper() for x in ImageCompletion.extensions if x != 'jpg') MATCH_WINDOW_OPTION = '''\ diff --git a/kitty/rc/set_background_image.py b/kitty/rc/set_background_image.py index 6d7691e90..2d89b0482 100644 --- a/kitty/rc/set_background_image.py +++ b/kitty/rc/set_background_image.py @@ -11,6 +11,7 @@ from kitty.utils import is_png from .base import ( MATCH_WINDOW_OPTION, + SUPPORTED_IMAGE_FORMATS, ArgsType, Boss, CmdGenerator, @@ -43,10 +44,10 @@ class SetBackgroundImage(RemoteCommand): short_desc = 'Set the background image' desc = ( - 'Set the background image for the specified OS windows. You must specify the path to a PNG image that' + 'Set the background image for the specified OS windows. You must specify the path to an image that' ' will be used as the background. If you specify the special value :code:`none` then any existing image will' - ' be removed.' - ) + ' be removed. Supported image formats are: ' + ) + ', '.join(SUPPORTED_IMAGE_FORMATS) options_spec = f'''\ --all -a type=bool-set diff --git a/kitty/rc/set_window_logo.py b/kitty/rc/set_window_logo.py index e68a9b355..20775cefa 100644 --- a/kitty/rc/set_window_logo.py +++ b/kitty/rc/set_window_logo.py @@ -11,6 +11,7 @@ from kitty.utils import is_png from .base import ( MATCH_WINDOW_OPTION, + SUPPORTED_IMAGE_FORMATS, ArgsType, Boss, CmdGenerator, @@ -39,10 +40,10 @@ class SetWindowLogo(RemoteCommand): short_desc = 'Set the window logo' desc = ( - 'Set the logo image for the specified windows. You must specify the path to a PNG image that' + 'Set the logo image for the specified windows. You must specify the path to an image that' ' will be used as the logo. If you specify the special value :code:`none` then any existing logo will' - ' be removed.' - ) + ' be removed. Supported image formats are: ' + ) + ', '.join(SUPPORTED_IMAGE_FORMATS) options_spec = MATCH_WINDOW_OPTION + '''\n --self