Skip to content

X11: Add support for custom window icon - #6475

Merged
kovidgoyal merged 1 commit into
kovidgoyal:masterfrom
benblank:x11-custom-window-icon
Jul 17, 2023
Merged

kovidgoyal merged 1 commit into
kovidgoyal:masterfrom
benblank:x11-custom-window-icon

Conversation

@benblank

Copy link
Copy Markdown
Contributor

I'm just getting into kitty and, while reading the FAQ, I fell in love with DinkDonk's "dark kitty" icon. Imagine my dismay when, after successfully setting it as the launch and taskbar icon, I discovered that a custom window icon is supported in macOS, but not X11!

kitty window without custom icon 😞

This PR changes that. It uses the same logic (and filename) to locate a custom icon to use for X11. Specifically:

  • For OS windows under X11, if a file named <config_dir>/kitty.app.png or <config_dir>/kitty.app-128.png exists (preferring the 128px image, per the note in the source1), it will be set as the window icon. Otherwise, the 128px version of logo_png_file (<base_dir>/logo/kitty-128.png) is used.
  • For notifications under X11, when icon=True, if a file named <config_dir>/kitty.app.png exists, it will be set as the notification icon. Otherwise, logo_png_file (<base_dir>/logo/kitty.png) is used.
  • If no files named <config_dir>/kitty.app.png or <config_dir>/kitty.app-128.png exist, kitty's behavior under X11 remains unchanged.
  • Under macOS, nothing should change (though some refactoring occurred), but I don't currently have access to a Mac to test this.
  • Under Wayland, nothing should change, but I don't currently have access to a Wayland host, either.

kitty window with custom icon 😻

Footnotes

  1. For what it's worth, I'm running 64-bit X11 and had no issues setting the window icon to a 1024px image, but I've retained the preference for 128px images on the theory that it may still be an issue for some others.

@kovidgoyal
kovidgoyal merged commit 0a09a93 into kovidgoyal:master Jul 17, 2023
@benblank
benblank deleted the x11-custom-window-icon branch July 20, 2023 19:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants