Open JCKodel opened 3 years ago
Cool stuff! I like both, the option to see the battery level in the menu as well as setting a device to the battery level color (green to red).
@JCKodel could you share .dmg installation file?
@JCKodel could you share .dmg installation file?
Sorry, I don't work with Macs anymore and apparently I didn't backup the whole thing (I searched here in my filed and couldn't find it) =(
@JCKodel could you share .dmg installation file?
@jchobantonov Available here: https://github.com/JCKodel/razer-macos/releases/tag/0.5.0
I did this:
(charging icon and battery % refreshed each 4 seconds in the tray).
I also did this:
(added an "static" option to show battery level on the dock (from red to green)).
I will not make a pull request because I'm not sure if the code is right and I also only did that for the dock. I don't like the battery indicator in the mouse itself and I don't have Razer keyboards.
I also don't know what would happen if there is no battery available (for wired devices), so, I can't make a decent PR.
Nevertheless, those are the changes:
I've created a new menu entry above the dock
Static -> White
entry here: https://github.com/1kc/razer-macos/blob/801745a893a97c7e2a641224381f903107fb5ddf/src/main/index.js#L1235Each 4 seconds (just copied the interval from elsewhere, don't know if means something), I refresh the devices and rebuild the tray, then I get a green to red scale depending on the battery level (I guess this is something like what Razer Windows do) and I set the color to that RGB, as a static color.
The tray itself is quite simple (but bugged, I guess bacause of Electron, more on that in a minute).
On https://github.com/1kc/razer-macos/blob/801745a893a97c7e2a641224381f903107fb5ddf/src/main/index.js#L1830:
What I did was to use the
tray.setTitle()
to write the battery level and charging indicator on the tray. The only issue is when you have two monitors, MacCrappyOS dimms the inactive monitor menu bar and the text is rendered grey (notice that my temperature indicator doesn't have this issue):When the monitor is active, it shows as white (or black, because Big Sur app bar doesn't get dark theme properly):
Active monitor with dark menu bar:
Active monitor with dark menu bar that MacCrappyOS think is light because of an not visible wallpaper: