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
Feature/dynamic menubar icon #43
Feature/dynamic menubar icon #43
Conversation
…mals in the menubar
…r 'git submdules update'
Thank you for taking a stab at this @asvela ! I'll review the PR and leave some feedback. In its current state with the TODO's I wouldn't want to merge this in. Would you be ok with me taking this feature over? |
@@ -658,15 +658,15 @@ | |||
CODE_SIGN_STYLE = Automatic; | |||
COMBINE_HIDPI_IMAGES = YES; | |||
CURRENT_PROJECT_VERSION = 1; | |||
DEVELOPMENT_TEAM = E5BK5K7RRN; | |||
DEVELOPMENT_TEAM = HT8VTXFQ39; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to look into a way to disambiguate this so its not always changing 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I just should just not have committed the xcodeproj? As I did not do any other changes there than the version (I think)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That’d work, but I don’t want to have to try to enforce that on every PR.
ENABLE_HARDENED_RUNTIME = YES; | ||
INFOPLIST_FILE = fanny/Info.plist; | ||
LD_RUNPATH_SEARCH_PATHS = ( | ||
"$(inherited)", | ||
"@executable_path/../Frameworks", | ||
); | ||
MACOSX_DEPLOYMENT_TARGET = 10.13; | ||
MARKETING_VERSION = 2.1.0; | ||
MARKETING_VERSION = 2.1.1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'd want to version the project separately from a PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I was not sure about the conventions here, if you bounce it upon completing a new version or when you start adding things
Fanny/fanny/Menu/FNYStatusBar.swift
Outdated
@@ -19,15 +19,20 @@ class FNYStatusBar: NSStatusBar { | |||
override init() { | |||
super.init() | |||
statusItem = NSStatusBar.system.statusItem(withLength: NSStatusItem.variableLength) | |||
applyStatusItemIcon() | |||
statusItem?.button?.title = "Loading.." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is necessary. Can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure either, hehe! It does take those first x seconds of the refresh interval before the first number appears, but maybe the icon should rather be displayed during this time? At the same time this might be confusing; if you have a long refresh interval (60 sec) and change the setting governing if the temperature rather than the icon should be displayed, but then seemingly nothing changes for the first 60 secs and you wonder if the setting was really changed.
Fanny/fanny/Menu/FNYStatusBar.swift
Outdated
|
||
func updateStatusItem() { | ||
let cpuTemperature = SMC.shared.cpuTemperatureAverage() | ||
statusItem?.button?.title = cpuTemperature!.formattedTemperature(decimals: 0, useSpaceDelimiter: false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can see the force unwrap !
causing issues here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was not sure how this should be done, addressed it in 8461f4f with a possible fix
Sure, absolutely! I agree it is not ready to merge in quite yet, but was not sure how I would share it otherwise than making a pull request (if I should have done it differently please let me know). As I said previously, I have no experience with this so please excuse the not so elegant way of doing it. Happy to assist if there are other things I could possibly do. |
… Empty does not remove the menubar item, just makes it 'invisible'
Thank guys, I was looking for this feature for a long time, hope it's going to live soon |
A PR is the right way to share 👍 |
…updates. Update preference view controller constraints. Revert version to 2.1.0.
@asvela Merged ✅ Made some changes on another branch: b352a3f I removed the "hidden" menu bar option. This isn't something I'd like to support. v2.2.0 is ready for download and contains these new features. Thank you for the PR! 👍 |
Thanks for including this! I posted a little comment on considering removing the decimals (possibly also the space) from the menubar as they take up space and are not really adding reliable information. Regarding
I just thought I'd mention this from Apple's Human interface guidelines:
It might be someone wants to use the nice widget but not the menubar icon. Relying on third party apps for hiding it is not ideal, and many programs include this feature of removing it (Dropbox, Alfred, Clipy are just some examples that came to mind). However, it seems the app needs some restructuring to do that properly, not just the cheesy way I did it, so it might be a lot of work for a niche feature. |
Unfortunately there's no way around not having a menu bar icon. Today Extension widgets require that sandbox is enabled so the widget needs needs a "main" application to retrieve all the system values. The alternative would be having an application running in your dock at all times, which isn't better IMO. Setting the menu bar to an empty string with no icon will cause confusion. |
Possible base for new feature for displaying the current CPU temperature rather than a static icon in the menubar (addressing feature request #42).
To do:
Tested on macOS 10.14.6.
(Let me know if I should have done this differently than opening a pull request, I am not familiar with how to contribute)