Skip to content
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

More improvements for macOS and conky generally #577

Closed
wants to merge 19 commits into from

Conversation

npyl
Copy link
Collaborator

@npyl npyl commented Aug 7, 2018

Hi!
This is some work on both general stuff and macOS specific stuff. 😝

General Changes

  • Activated the option BUILD_WLAN for all OSs (set to false by default)
  • Fixed $wireless_essid (also affected Linux, probably other OS, too!) crashing conky when no arg was passed. Correct behaviour would be to allocate dev with default interface (e.g. eth0). Adding parse_net_stat_arg fixes the problem.
  • Removed interface name from $downspeed and $upspeed from conky.conf and conky_no_x11.conf; we want conky to always use the DEFAULTNETDEV which is set during configuration with cmake and my vary from OS to OS. This is part of 147499f.

macOS Changes

  • Fixed $if_up by removing the SOCK_CLOEXEC flag from socket() in net_stats.cc when building for macOS; for some reason the function fails with error 43: Protocol not supported. This may also affect linux but I haven't checked yet.
  • Improve support for macOS (Patches for #29 and #26 are applied automatically now as of 147499f during cmake configuration)
  • Improve get_freq() using the Intel Power Gadget API if BUILD_IPGFREQ is enabled.
  • Add build option BUILD_IPGFREQ (set to false by default) so that the user can choose whether to use IPG or stick with old behaviour (Print constant factory frequency of CPU).

IPG (Intel Power Gadget concerns)

Intel Power Gadget can be installed using Homebrew-cask and it installs a .app, a Framework and a kernel-extension. This will seem a bit troublesome in my opinion for many users thus the BUILD_IPGFREQ option.
Now, one has the option to either use a better $freq or avoid the hussle of installing a library/kernel extension (with sacrifices).

NOTE: IPG doesn't seem to support multiple cores although stating the opposite in the documentation thus, all readings are for core0.

More Concerns

I am not sure if using Objective-C++ in darwin.mm will be a problem for sonar but if there is a problem I will work it out.

Epilogue

This is a prequel; actual support for WLAN on macOS is coming soon!

npyl and others added 18 commits July 11, 2018 19:55
Keep BUILD_WLAN OFF by default for compatibility reasons.
There are some problems (probably null-dereference)
Conky wasn't parsing the argument of the variable as it should, thus wasn't allocating the `dev` member variable.

Also fix some documentation stuff.
Using the Intel® Power Gadget API (https://software.intel.com/en-us/blogs/2012/12/13/using-the-intel-power-gadget-api-on-mac-os-x) we can now get actual Core frequency and not the constant factory one.

Though, for some weird reason the API gives the same freq for all Cores, thus the |cpu| arg becomes useless.
This build option has been introduced for one particular reason:

On macOS getting current core-frequency is not supported by the APIs.  A solution is to install Intel's ® Power Gadget which comes with an .app, a Framework and a kernel-extension.  Though, this may trouble some alot, thus introduce BUILD_IPGFREQ.
Fix frequency not printing correctly (I wasn't using the divisor)
Add more guards.
Updated default conky config to monitor Mac Networking
@brndnmtthws
Copy link
Owner

Let me make you a collaborator, and you can push your branch directly to this repo.

@npyl
Copy link
Collaborator Author

npyl commented Aug 7, 2018

There must be some problem with sonar, probably because I changed darwin.cc to darwin.mm for Objective-C++, I will have to investigate this.

@brndnmtthws
Copy link
Owner

@npyl Sonar doesn't work with external pull requests. The PR must originate from a branch on this repo, so it won't pass with this PR.

@brndnmtthws
Copy link
Owner

@npyl Have a look at #579, the sonar checks should run on that PR.

@npyl
Copy link
Collaborator Author

npyl commented Aug 7, 2018

I see!! Thats great! But still, why hasn't it passed the check yet? Sonar has been going from the moment I opened the PR

@brndnmtthws
Copy link
Owner

@npyl it can take 5-10 minutes.

@npyl npyl closed this Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants