It is currently September 30th, 2024, 1:34 am

Wallpaper change based on battery level?

General topics related to Rainmeter.
User avatar
XANCI
Posts: 104
Joined: September 18th, 2011, 6:37 am
Location: Nanjing, China

Re: Wallpaper change based on battery level?

Post by XANCI »

Code: Select all

[MeasurePower]
Measure=Plugin
Plugin=Plugins\PowerPlugin.dll
PowerState=PERCENT

[MeasureScript]
Measure=Script
ScriptFile="#CURRENTPATH#Color.lua"
Option=MeasurePower

Code: Select all

function Initialize()
	ms=SKIN:GetMeasure(SELF:GetOption('Option'))
end

function Update()
	i=ms:GetValue()
	if i<50 then
		return '255,'..(i/50*255)..',0'
	else
		return (255-(i-50)/50*255)..',255,0'
	end
end
then use [MeasureScript] with DynamicVariables=1
User avatar
thatsIch
Posts: 446
Joined: August 7th, 2012, 9:18 pm

Re: Wallpaper change based on battery level?

Post by thatsIch »

just a suggestion:
you could have prolly used the imagetint function
instead using different images

reason:
its allround
if you want a new wallpaper you need to re-create all the wallpapers