X11: Add support for custom window icon - #6475
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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!
This PR changes that. It uses the same logic (and filename) to locate a custom icon to use for X11. Specifically:
<config_dir>/kitty.app.pngor<config_dir>/kitty.app-128.pngexists (preferring the 128px image, per the note in the source1), it will be set as the window icon. Otherwise, the 128px version oflogo_png_file(<base_dir>/logo/kitty-128.png) is used.icon=True, if a file named<config_dir>/kitty.app.pngexists, it will be set as the notification icon. Otherwise,logo_png_file(<base_dir>/logo/kitty.png) is used.<config_dir>/kitty.app.pngor<config_dir>/kitty.app-128.pngexist, kitty's behavior under X11 remains unchanged.Footnotes
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. ↩