Plutoberth / SonyHeadphonesClient

A {Windows, macOS, Linux} client recreating the functionality of the Sony Headphones app
MIT License
1.09k stars 85 forks source link

Hide macOS dock icon #44

Open lkutsenok opened 3 years ago

lkutsenok commented 3 years ago

Hi! I've managed to hide the dock icon, while keeping the menu bar. For me, the dock icon doesn't make much sense, cause the best thing about the macOS app is the quick toggle between noise cancelling and ambient mode. I have little experience with native Objective-C, but managed to hide the dock icon using following modifications:

Maybe we can manage the settings via menu bar?

Plutoberth commented 3 years ago

@semvis123 is the expert here

vincent-le-normand commented 3 years ago

Hi,

I created a similar software for the Parrot Zik headphone, and now I own a Sony headset. If you need to, I can help on this project: https://github.com/vincent-le-normand/Parrot-Status

I tends to believe that it would be better to only offer one option: either show the dock icon for everybody, or for nobody. I'd vote for no dock icon, and the UI embedded in the menu, something similar to Big Sur control center.

If you want to change this setting programatically, it appears you should perform this way: https://stackoverflow.com/questions/5382932/how-to-create-a-helper-application-lsuielement-that-also-has-a-removable-doc

semvis123 commented 3 years ago

Hi, hiding the dock icon might be preferable for most users, but maybe other people want that fine control of the current gui interface. We could create some user preferences that could store things like,

https://developer.apple.com/documentation/foundation/nsuserdefaults?language=objc

Those are just some ideas, and I currently do not have enough time to fulfill this all. But I would love to hear your opinion about something like this.

vincent-le-normand commented 3 years ago

This could be an option. However, some settings are not compatible (it's not a good idea to disable both dock icon and menu icon). Regarding the menu bar full gui version, maybe it's possible to have the quick toggle and just nearby another icon that offer the full setting view. Some Apple Menu Items (such as date time) also offer quick toggles if you press options while clicking, but it's not really discoverable… Also, we could offer a quick toggle using a global hot key.

Also, I hope someday we would have a way to display battery level in the menu.

The other options (start at login, auto reconnect, …) would be really great!

I am quite busy right now, be maybe I can help someday…

semvis123 commented 3 years ago

This could be an option. However, some settings are not compatible (it's not a good idea to disable both dock icon and menu icon).

Yeah I know, but we should just disable the other button, so that you won't end up with a broken program or we could use a NSSwitch, but that is only available in the more recent macOS versions.

Don't know about both icons, there is already enough clutter in my menu bar :) Long pressing the menu button might also be an option, but I don't know if this is possible, and it isn't intuitive for the user.

Global hot key would indeed be great, battery level could be added when receiving the settings/information from the headphones is implemented.

lkutsenok commented 3 years ago

Global hot key would indeed be great

I have some ideas on how to implement it with Automator, I'll try them later and post the results

CodeBrauer commented 2 years ago

If there would be an CLI option for any control, it would be probably the best.

Then you can use it however you want, suiting your workflow: