Comments (12)
I'm a bit confused reading the code it seems that 16x16 is hardcoded as icon size:
https://github.com/getlantern/systray/blob/master/systray_darwin.m#L162
Is that not true? Does the library support other icon sizes for OS X?
from systray.
@carsonefv or @Derekf5 you guys want to take a look at this?
from systray.
It is far easier than you think you have to create 2 png (imagemagick convert) files with 2x increment in size and then squash them together into a tiff (tiffutil) and then load as normal:
convert -background none img/darwin/$ICON.svg -resize 32x32 -sharpen 1 img/darwin/$ICON.png
convert -background none img/darwin/$ICON.svg -resize 64x64 -sharpen 1 img/darwin/[email protected]
tiffutil -cathidpicheck img/darwin/$ICON.png img/darwin/[email protected] -out img/darwin/$ICON.tiff
$GOPATH/bin/2goarray $ICON main < img/darwin/$ICON.tiff | grep -v package >> "$OUTPUT"
from systray.
@xor-gate Awesome! It woks like a charm.
from systray.
@xor-gate I meet another problem:
After I packaged my golang-app into a OSX application, say foo.app, the retina icon is gone.
It seems that OS X add some actions when launching foo.app, but have no idea what did it do.
from systray.
The icon is gone? You must make sure you load the tiff as byte array and not the png.
from systray.
I mean the retina icon is not shown, only the default one is shown.
I am pretty sure I load the tiff as byte array, because if I copy foo.app/Contents/MacOS/foo
to a normal directory, and launch foo with ./foo
, the retina icon is displayed as expected.
from systray.
Probably the application bundle loader is not properly configured to have support for multiimage. Could you paste your Plist.info
?
from systray.
Below is my info.plist
:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist
SYSTEM 'file://localhost/System/Library/DTDs/PropertyList.dtd'>
<plist version="0.9">
<dict>
<key>CFBundleExecutable</key>
<string>foo</string>
<key>CFBundleGetInfoString</key>
<string>hi</string>
<key>CFBundleIconFile</key>
<string>app.icns</string>
<key>CFBundleIdentifier</key>
<string>foo</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>foo</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>0.0.1</string>
<key>CFBundleSignature</key>
<string>WRUN</string>
<key>CFBundleVersion</key>
<string>0.0.3</string>
<!-- Set LSUIElement to indicate this is an agent app, meaning that it
does not get an icon in the dock. -->
<key>LSUIElement</key>
<string>1</string>
</dict>
</plist>
from systray.
Try adding:
<key>LSMinimumSystemVersion</key>
<string>10.10</string>
Probably it changes behaviour how the Foundation.framework is loaded and the image load process.
See my Info.plist
: https://github.com/xor-gate/syncthing-mac/blob/master/template/Contents/Info.plist
from systray.
I still can not make it work after adding LSMinimumSystemVersion
.
I find your Info.plist
have much more items than mine, I will check all these items tomorrow.
from systray.
@xor-gate With some luck, the problem is solved by adding:
<key>LSMinimumSystemVersion</key>
<string>10.10</string>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
Many thanks for your help.
from systray.
Related Issues (20)
- Can not println when I run the systray on windows HOT 1
- How do we make a dock icon do something interesting when clicked? HOT 3
- Monochrome icon in macOS menu bar HOT 2
- Native support for Apple Silicon (arm64) HOT 4
- Menu turn black after a few days HOT 1
- Failed to compile in Windows ARM64 environment
- Newbie Question: What GUI library is used? HOT 1
- MacOS set SUID permissions There will be problems HOT 2
- Remove dependency on github.com/getlantern/golog
- Add support for advanced menu items
- Fix notifyIconData struct HOT 1
- libayatana-appindicator , libappindicator is not available in RedHat HOT 1
- Dark mode support for windows 11 HOT 2
- Deprecation of 'go get' for installing executables
- 蓝灯邀请码,输入各得3个月:YX7T8M6
- Duplicate symbol error building on macOS HOT 3
- Can't compile on MacOS (duplicate symbol)
- [Bug] Debain 12
- won't compile with Go version 1.22 HOT 1
- Icons in menu items have a black background
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from systray.