如何将SIMBL插件加载到SystemUIServer
我有开发两个SIMBL插件的经验。
目前这些在 Mac OS X 10.6.6 上运行正常。
我计划制作一个新的 SIMBL 插件 来修改菜单的行为额外的。
Menu Extra 属于 SystemUIServer。
SystemUIServer 存在于这个地方:
/System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer
SystemUIServer 的捆绑标识符是 com.apple.systemuiserver。
因此,我将一个关键 SIMBLTargetApplications 添加到 Info.plist,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:rfc1034Identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSPrincipalClass</key>
<string></string>
<key>SIMBLTargetApplications</key>
<array>
<dict>
<key>BundleIdentifier</key>
<string>com.apple.systemuiserver</string>
</dict>
</array>
</dict>
</plist>
- 构建 Foo.bundle。
- 复制到 $HOME/Library/Application Support/SIMBL/Plugins。
- 运行“killall SystemUIServer”。
- 使用 Console.app 仔细观察日志消息。
但重新启动时 Foo.bundle 不会加载到 SystemUIServer。
如果将 BundleIdentifier 更改为其他类型的通用应用程序名称,它可以正常工作。
这有什么问题吗?
--
moyashi
ttp://hitoriblog.com/
I have experience in developing two SIMBL plug-in.
Those are working properly on the Mac OS X 10.6.6 at this moment.
I'm planning to make a new SIMBL plug-in that modifies behavior of Menu Extra.
Menu Extra is belonging to the SystemUIServer.
SystemUIServer exists at this place:
/System/Library/CoreServices/SystemUIServer.app/Contents/MacOS/SystemUIServer
Bundle identifier of SystemUIServer is com.apple.systemuiserver.
So I add a key SIMBLTargetApplications to the Info.plist as follows:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.${PRODUCT_NAME:rfc1034Identifier}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSPrincipalClass</key>
<string></string>
<key>SIMBLTargetApplications</key>
<array>
<dict>
<key>BundleIdentifier</key>
<string>com.apple.systemuiserver</string>
</dict>
</array>
</dict>
</plist>
- Build a Foo.bundle.
- Copy to the $HOME/Library/Application Support/SIMBL/Plugins.
- Run a "killall SystemUIServer".
- Watch log messages carefully with Console.app.
But Foo.bundle won't load to the SystemUIServer when relaunching.
If change BundleIdentifier to the other kind of generic app name, It works properly.
What's wrong with that?
--
moyashi
ttp://hitoriblog.com/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
SIMBL 仅适用于可可应用程序。 SystemUIServer 不是可可应用程序。检查其符号链接以获取更多证据。
SIMBL works only with cocoa application. SystemUIServer is not cocoa application. Check its symbolic link for more evidences.