Running on battery

Hi All

when performing using my laptop, always run the laptop connected to the mains. I am however dreading to not notice in time that the power for the laptop is not connected.

so my question is is there a way to detect if a laptop is runnning on battery or is connected to mains? I have been looking a bit in the system, windows and device categories but have not found a way to see if I am running on mains or not.

is there such a node?

I mean it would be pretty useful to change the color of the patch background to red in case of running on battery and green if plugged into mains.


i took this problem as a neat little excercise for my sketchy c# skills…

a plugin, especially for you, sunep :)

outputs battery state in percentage and PowerMode (Main or Battery)

PowerState.dll (20.5 kB)

WOW! Thanks U7:)

I will test immediately


Brilliant :)

it seems to work well. now seeing it when I run my battery flat :)

thanks again

I will encourage you to include it in the addon pack

a well…that’s what i’m trying right now…no info about uploading to the repo. i’m going to ask mr.joreg

ok is uploaded to the repository, might be part of the next addon pack


what a great way to start the weekend!

did some cleanup of the files and added a build file.

that’s nice but renaming the powerstate.cs file makes the solution missing a reference. what’s the point ?

added PowerMessages, tells you about

Critical (The battery level is below the critical level specified in the user’s preferences.)

PowerState.dll (20.5 kB)

the solution and the project are updated aswell. i renamed the .cs file, because the c# code convention likes it, when the file has the same name as the class declared in it…

I made a quick help file for it.

PowerState (Windows 0.1) help.v4p (7.0 kB)

nice plug. another nice one for performance situations would be CPU/GPU temp monitor so some preventative action can be taken if things look like their getting a little hot down at the club.

interesting … but quick googling tells there isn’t a standard interface to get these values from all the different mainboards. windows can give you cpu temp (doesn’t always work) but gpu temp is not implemented…yet ?

anyway, if something gets too hot, you will notice instantly ;)