bWKV='!WriteKeyValue'
bRFA='!RefreshApp'
sV=tostring(SKIN:GetVariable('SETTINGSPATH'))..'Rainmeter.ini'
fR=io.open(sV,'r')
if type(fR)~='nil' then
sR=fR:read('*a')
fR:close()
iD=tonumber(string.match(sR,'%[Rainmeter%][^%[%]]*\nUseD2D=(%d*)'))
if type(iD)=='nil' then
SKIN:Bang(bWKV,'Rainmeter','UseD2D',0,sV)
SKIN:Bang(bRFA)
elseif iD~=0 then
SKIN:Bang(bWKV,'Rainmeter','UseD2D',0,sV)
SKIN:Bang(bRFA)
end
end
I see how that turns D2D "off", but don't see where it turns it "on"... I would also recommend that for completeness you might want to take into account that UseD2D can in theory be in any string case, if a user manually adds it to Rainmeter.ini.