Giter Club home page Giter Club logo

juice's Introduction

Juice ⚡️

Make your battery information a bit more interesting by making your own measurement scale instead of a boring battery indicator.

I was browsing Tumblr one day and saw Cyle make a post about this:

This got me to thinking if something like that was possible from the frameworks that Apple gives us developers. As it turns out the IOKit framework provides a wealth of information and triggers about what's going on with your computer. With this framework you can get power source information and generate callback when values of these sources change!

Going a step further, I wanted to define a format that would allow for people to create their own scales! Which you can now do, but it's strings only for the time being.

Screenshots

Installation

You can either compile the app through Xcode with the sources, or downloaded the latest binary that has been released here

Adding A Scale

  1. Go to preferences and click the "Add New Scale", this will attempt to create and open a new plist file that can be used by Juice to load a custom scale. The structure of the plist is described below
  2. Make the desired changes to your scale plist in your favorite text editor and save.
  3. Go to preferences and rescan for scales, you should now see the title of the scale you just created in the drop down list of scales to pick from.

Plist Format

The format currently used to load custom scales is a simple plist file, let's look at the structure of the document:

<?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>default</key>
	<string>Edit The Default Value To Show</string>
	<key>detents</key>
	<dict>
		<key>0</key>
		<string>Edit Me, I'll be triggered from 0 to 10%</string>
		<key>1</key>
		<string>Edit Me, I'll be triggered from 10 to 20%</string>
		<key>2</key>
		<string>Edit Me, I'll be triggered from 20 to 30%</string>
		<key>3</key>
		<string>Edit Me, I'll be triggered from 30 to 40%</string>
		<key>4</key>
		<string>Edit Me, I'll be triggered from 40 to 50%</string>
		<key>5</key>
		<string>Edit Me, I'll be triggered from 50 to 60%</string>
		<key>6</key>
		<string>Edit Me, I'll be triggered from 60 to 70%</string>
		<key>7</key>
		<string>Edit Me, I'll be triggered from 70 to 80%</string>
		<key>8</key>
		<string>Edit Me, I'll be triggered from 80 to 90%</string>
		<key>9</key>
		<string>Edit Me, I'll be triggered from 90 to 100%</string>
	</dict>
	<key>title</key>
	<string>Edit The Title</string>
</dict>
</plist>
Key Name Value Type Description
default String The default value to be shown if Juice can't figure out what's going on with the power source
detents Dictionary<String, String> A mapping of detents (steps in the charge ratio) to string values to show to the user
title String The title of the scale to be displayed in the preference UI

NOTE: The name of the plist file you save should be unique, by default UUID's are generated as the name of files if you create a scale through the UI.

If you'd like to drop your own plist to be used by the application, new files can be dropped into the ~/Library/Containers/com.bsm.macos.Juice/Data/Library/Application Support/Juice folder.

✌️

Feel free to contribute by making a pull request and I'll take a look when I can! If you'd like to reach me, feel free to hit me up on Twitter @brianmichel.

juice's People

Contributors

3raxton avatar brianmichel avatar heylookltsme avatar rachelhyman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

juice's Issues

Icon not dimmed when using multiple displays

Hi Briaaaaaaaaan! 👋 ❤️

Today I noticed that the Juice icon doesn't dim when you're using multiple displays and the focus is on a different display.

Screenshot_2_20_20__3_35_PM

macOS Mojave 10.14.6

Emojis a little too bright

Emojis looks too bright as you can see on the picture below, it's translucid and then when I click on it the emoji loose its transparency so it looks better imo
Maybe because I don't have a Retina display?

capture d ecran 2016-12-26 a 17 48 35

Start Juice on system startup

Currently Juice does not startup automatically on system startup. This would be a nice option to add in preference.

Add step "0% to 5% battery"

At the moment, we can only use steps that go 10% each (eg. 0-10%, 10-20%...). But the Apple silicon machines have gotten such long battery life that I want to show a "charge" indicator only below 5%, not below 10%. Is this somehow possible by editing the scale files?

I tried adding a "0.5" entry, but this didn't work (see picture)
juice

OS X 10.12 minimum

I'm still running 10.11 (yes, shame on me).
Just curious, does this only work on 10.12 or could we also add support for 10.11 without much effort?

Homebrew / Cask

Hi, this is a really tweak, maybe consider adding it Homebrew? :)

Allow editing of created scales from the UI.

Not sure if I'm missing something here.

But the ability to edit scales would be nice.

Had to redo a full scale because I misspelled something and didn't read the docs to find where I saved the plist.

Bug

Hello,

Ok for the bug I talked to you I have on a MacbookPro Retina 15 "mid-2014

For the realization it is enough just to want to change the smileys by another thing (even if we change for the same thing) it puts "Edit The Title" and we can no longer change it ...:
capture d ecran 2017-01-09 a 16 34 54
capture d ecran 2017-01-09 a 16 34 47

Second problem

is resolved

Spelling Error

In preferences menu:
Launch option - The word "automatically" is spelled wrong :)

screen shot 2017-01-03 at 12 20 12 pm

Emoji doesn't replace current battery indicator!

Installed it through the binary release. Although I noticed that the Emoji does not replace the already existing battery indicator!. Is this the intended behaviour? (I assumed it would replace it).

See screenshot for reference:
screen shot 2016-12-19 at 5 03 43 pm

Image Status Indicators

It'd be nice to be able to include images as the value of a detent to make fun custom indicators.

Charging Status Indicator

To ape the built in battery status indicator, it'd be great if I could tell if my laptop was charging just by looking at the status bar.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.