bluesnooze icon indicating copy to clipboard operation
bluesnooze copied to clipboard

Hide icon via `defaults` not working?

Open jimgraham opened this issue 1 year ago • 5 comments

steps

  1. In the terminal defaults write com.oliverpeate.Bluesnooze hideIcon -bool true && killall Bluesnooze
    1. Bluesnooze killed, removed from menu bar
  2. Launch Bluesnooze from cmd+space type "bluesnooze"
  3. Icon reappears

https://github.com/odlp/bluesnooze/assets/430293/f1d3ab1a-feca-478f-8d48-c65c91548d8c

Expected

Bluesnooze app icon does not reappear

setup

  • 2023 14" MacBook M1 Pro
  • Sonoma 14.2.1
  • Bluesnooze installed via brew install bluesnooze

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>BuildMachineOSBuild</key>
        <string>22E261</string>
        <key>CFBundleDevelopmentRegion</key>
        <string>en</string>
        <key>CFBundleExecutable</key>
        <string>Bluesnooze</string>
        <key>CFBundleIconFile</key>
        <string>AppIcon</string>
        <key>CFBundleIconName</key>
        <string>AppIcon</string>
        <key>CFBundleIdentifier</key>
        <string>com.oliverpeate.Bluesnooze</string>
        <key>CFBundleInfoDictionaryVersion</key>
        <string>6.0</string>
        <key>CFBundleName</key>
        <string>Bluesnooze</string>
        <key>CFBundlePackageType</key>
        <string>APPL</string>
        <key>CFBundleShortVersionString</key>
        <string>1.2</string>
        <key>CFBundleSupportedPlatforms</key>
        <array>
                <string>MacOSX</string>
        </array>
        <key>CFBundleVersion</key>
        <string>1</string>
        <key>DTCompiler</key>
        <string>com.apple.compilers.llvm.clang.1_0</string>
        <key>DTPlatformBuild</key>
        <string></string>
        <key>DTPlatformName</key>
        <string>macosx</string>
        <key>DTPlatformVersion</key>
        <string>13.3</string>
        <key>DTSDKBuild</key>
        <string>22E245</string>
        <key>DTSDKName</key>
        <string>macosx13.3</string>
        <key>DTXcode</key>
        <string>1431</string>
        <key>DTXcodeBuild</key>
        <string>14E300c</string>
        <key>LSApplicationCategoryType</key>
        <string>public.app-category.utilities</string>
        <key>LSMinimumSystemVersion</key>
        <string>12.0</string>
        <key>LSUIElement</key>
        <true/>
        <key>NSHumanReadableCopyright</key>
        <string>Copyright © 2020 Oliver Peate. All rights reserved.</string>
        <key>NSMainNibFile</key>
        <string>MainMenu</string>
        <key>NSPrincipalClass</key>
        <string>NSApplication</string>
        <key>NSSupportsAutomaticTermination</key>
        <true/>
        <key>NSSupportsSuddenTermination</key>
        <true/>
</dict>
</plist>

jimgraham avatar Jan 12 '24 21:01 jimgraham

Not a MacOS dev, but here's a "workaround": ln -s ~/Library/Preferences/com.oliverpeate.Bluesnooze.plist ~/Library/Containers/com.oliverpeate.Bluesnooze/Data/Library/Preferences/com.oliverpeate.Bluesnooze.plist

Not sure what is the right way to have Bluesnooze's making the request for its container to have the config mounted

ColinHebert avatar Feb 01 '24 04:02 ColinHebert

Same here, icon is visible even after running the defaults write command. The value is being set, just ignored by the app:

defaults read com.oliverpeate.Bluesnooze hideIcon 1

@ColinHebert's suggestion didn't work for me

tambourine-man avatar Mar 01 '24 01:03 tambourine-man

I got it working, but had to update the app.

Not sure exactly which change did the trick, but my hunch is removing the app "sandbox" from the xcode project.

The downside is that I couldn't get the LaunchAtLogin dep to work, but, you can still install it and set it up manually to get it to launch at startup.

Here's my recipe:

  • Open my fork https://github.com/cdaringe/bluesnooze in xcode
  • Product > Schems > BluesnoozeRelease
  • Product > Build
  • In the product navigator tab > Products > Bluesnooze (Right Click!) > Show In Finder
    • Drag to Applications folder
  • Mac system settings > Login Items > Add item > Select Bluesnooze!

Not a macos dev, just managed to hack this together. Surely some saintly mac person will find this atrocious, but it works!

cdaringe avatar May 31 '24 03:05 cdaringe

For me the solution was:

Pre-condition:

  • Bluesnooze running
  • Bluesnooze icon displayed
  • defaults read com.oliverpeate.Bluesnooze hideIcon does not return 1

Steps:

  1. Run defaults write com.oliverpeate.Bluesnooze hideIcon -bool true
  2. Quit app from Bluesnooze icon
  3. Reopen app with CMD + Space

Note: If I quit the app with killall Bluesnooze doesn't seem to do the trick, don't ask why (not mac dev here)

My environment:

  • Chip M3
  • Sonoma 14.2
  • Bluesnooze v1.2 via homebrew

Baraujo25 avatar Jun 12 '24 18:06 Baraujo25

I solved it by installing the version I installed with Brew and re-install with the zip file.

Running on: M3 Mac OS 14.4

shlomiLan avatar Aug 10 '24 17:08 shlomiLan