-
Notifications
You must be signed in to change notification settings - Fork 20
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
Failed to set the custom-icon flag in the 'com.apple.FinderInfo' extended attribute #42
Comments
Interesting. It does work with a version of iTerm that was directly installed. Do you know what makes the Homebrew installation special? Does it perhaps only place a symlink in |
The cask code does not show anything out of order, it's a regular directory. Either the recent update to macOS 13.1 or a recent update of fileicon must have broken this. It worked up until very recently.
I tried deleting this odd 0-byte file but it doesn't really change anything. Will try to downgrade fileicon next. |
What changed in v0.3.2 was the introduction of more fine-grained error reporting (alongside support for volumes). It's odd it would create an _empty: I see that What does |
After re-launching iTerm, I can see the icon replacement actually works in both versions, it's just that v0.3.2 needlessly prints this error message, so it's more like a cosmetic bug. |
As an side: It looks like the native macOS utilities are being shadowed by Homebrew-installed GNU implementations, as also evidenced by your Good to know that the issue is mostly cosmetic, but the question is: With a custom icon successfully assigned, what does Also, do you know the significance of the |
Yes, in fact I have installed GNU utilities with original names, that's intentional. Will check more later. |
With 0.3.2, I started getting the same message on plain In 0.3.1, this check passed as expected:
The root cause is that 0.3.2 started using --- fileicon 2022-12-29 18:23:52.000000000 +0000
+++ fileicon-xattrfix 2023-03-02 23:02:08.054684076 +0000
@@ -116,7 +116,7 @@
# IMPORTANT: Hex. digits > 9 use UPPPERCASE characters.
# getAttribByteString <file> <attrib_name>
getAttribByteString() {
- xattr -px "$2" "$1" | tr -d ' \n'
+ /usr/bin/xattr -px "$2" "$1" | tr -d ' \n'
return ${PIPESTATUS[0]}
}
@@ -173,7 +173,7 @@
# hasAttrib <fileOrFolder> <attrib_name>
hasAttrib() {
- xattr "$1" | /usr/bin/grep -Fqx "$2"
+ /usr/bin/xattr "$1" | /usr/bin/grep -Fqx "$2"
}
# hasIconData <file>
@@ -354,9 +354,9 @@
if hasAttrib "$fileOrFolder" com.apple.FinderInfo; then
byteStr=$(getAttribByteString "$fileOrFolder" com.apple.FinderInfo | patchByteInByteString $kFI_BYTEOFFSET_CUSTOMICON '~'$kFI_VAL_CUSTOMICON) || return
if [[ $byteStr == "$kFI_BYTES_BLANK" ]]; then # All bytes cleared? Remove the entire attribute.
- xattr -d com.apple.FinderInfo "$fileOrFolder"
+ /usr/bin/xattr -d com.apple.FinderInfo "$fileOrFolder"
else # Update the attribute.
- xattr -wx com.apple.FinderInfo "$byteStr" "$fileOrFolder" || return
+ /usr/bin/xattr -wx com.apple.FinderInfo "$byteStr" "$fileOrFolder" || return
fi
fi
@@ -365,7 +365,7 @@
rm -f "$(getFileWithIconData "$fileOrFolder")"
else # file -> remove the resource fork
if hasIconData "$fileOrFolder"; then
- xattr -d com.apple.ResourceFork "$fileOrFolder"
+ /usr/bin/xattr -d com.apple.ResourceFork "$fileOrFolder"
fi
fi |
Excellent sleuthing, @vszakats - I hadn't put 2 and 2 together in the |
* [fix] Fix for [#42](#42), courtesy of [vszakats](https://github.com/vszakats).
v03.3, which includes your fix:
|
@mklement0 No worries, thank you for your quick merge! ..and release! |
Indeed that was the issue. I have no idea where this rogue |
* [fix] Fix for [#42](#42), courtesy of [vszakats](https://github.com/vszakats).
On macOS 13.1 with fileicon v0.3.2, I'm getting these failures trying to set a icon for app ins
/Applications
. iTerm was installed via Homebrew. This comment seems related but to my knowledge,/Applications
is not a volume.The text was updated successfully, but these errors were encountered: