-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
macOS: Add a way to set a custom application icon for kitty #5464
Conversation
Why not just use this method at kitty startup to check for |
I have never seen another app use this approach and am concerned about potential unknown issues. The cache information needs to be attached to the app bundle, as each app bundle can have its own custom icon. I think the easiest way to do this is: Automatic updates: I will try the former approach and test it to reduce unnecessary code maintenance in the future (as compared to the second approach). |
On Fri, Sep 02, 2022 at 06:25:46AM -0700, page-down wrote:
I have never seen another app use this approach and am concerned about potential unknown issues.
This will be used by a small fraction of kitty users, and if there are
issues, we can always revert it.
The cache information needs to be attached to the app bundle, as each app bundle can have its own custom icon.
Also, if a `kitty.app` with a `dev` label on the custom icon is run, it will be overwritten by `kitty.app.icns`.
I think the easiest way to do this is:
Automatically apply the custom icon if it exists in the configuration folder and the current app bundle does not have a custom icon. (However this will add one more file IO at startup.)
Update the icons by running `rm "/Applications/kitty.app/Icon"$'\r'`, or delete the custom icons via Finder, or overwrite with an unmodified `kitty.app` and run kitty again.
Or just drag and drop your custom icon in Finder.
Automatic updates:
If there are no custom icon, kitty.app.icns in the configuration folder will be used automatically and the path to the icns file (and file size, mtime..) will be recorded via the extended attributes (xattr) on the app bundle folder.
Update the custom icon automatically based on the information in xattr.
I will try the former approach and test it to reduce unnecessary code maintenance in the future (as compared to the second approach).
OK.
|
a13ae2f
to
f876665
Compare
f876665
to
a102941
Compare
I have updated the PR, please review, thanks. Is it possible to run mypy tests in a virtual environment? python3 -m venv /path/to/venv
# activate venv
make
./test.py mypy
python3 test.py mypy
|
No idea, never tried as I dont use venvs. Presumably you will need to install mypy in the venv. |
Yes, mypy is installed. |
Link kitty against the python in the venv. |
Actually no, the linked interpreter is not used. See the function type_check() in main.py |
This should take care of it: 5ea0519 |
I have merged changing the implementation a bit, to allow the icon to be updated easily. |
On Fri, Sep 02, 2022 at 05:09:20AM -0700, page-down wrote:
I noticed the following commit, does that mean that using `doc` text roles without the `slash /` prefix is no longer supported?
295743a
No it works fine. It does not work in sphinx because there doc roles are
relative to the file, not the root of the tree. This has always been the case.
|
Changing the kitty icon manually as described in the FAQ is troublesome, so a new way to set custom icons via the CLI has been added.
Configure custom icon for the app bundle directly by calling the Cocoa framework's API.
Related discussion:
#5461
This PR does not fix the above issue because it does not yet add to the installer script the steps to: detect the presence of custom icon, backup, restore custom icon, etc, as this would add unnecessary complexity to the installation script.
Please review, thanks.
I noticed the following commit, does that mean that using
doc
text roles without theslash /
prefix is no longer supported?295743a