It is currently September 29th, 2022, 6:18 pm

Rainmeter Log Window

Skins that control functions in Windows or Rainmeter
User avatar
tass_co
Posts: 363
Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY

Rainmeter Log Window

Post by tass_co »

Hi everyone,

I made a skin that instantly displays the last 5 messages in the Rainmeter Log file content.
(This number can be increased)

I believe it can help in some cases :phhht

21.09.2022 - 03.28.29-About Rainmeter.png



Skin ini

Code: Select all

[Rainmeter]
Update=1000

[Variables]
LogFile="#SETTINGSPATH#Rainmeter.log"
LastWritten1=
LastWritten2=
LastWritten3=
LastWritten4=
LastWritten5=

[MeaLua]
Measure=Script
ScriptFile="#CURRENTPATH#LuaWrite.lua"
FileName=#Path#

[MtrShape]
Meter=Shape
X=0
Y=0
Shape=Rectangle 0,0,306,178 | Extend MyModifiers1
MyModifiers1=Fill Color 0,0,0 | StrokeWidth 2 | Stroke Color 255,0,0

[Strtime]
Meter=String
X=4
Y=4
W=300
H=174
SolidColor=0,0,0
StringStyle=Normal
StringAlign=Left
FontSize=10
FontFace=URW DIN SemiCond W05 Demi
FontColor=240,240,240
ClipString=1
Text=#LastWritten1##CRLF##LastWritten2##CRLF##LastWritten3##CRLF##LastWritten4##CRLF##LastWritten5#
AntiAlias=1
DynamicVariables=1
LuaWrite.lua

Code: Select all

function Initialize()

	FileName = SKIN:GetVariable('LogFile')
	
end

function Update()
	FilePath = SKIN:MakePathAbsolute(FileName)
	local file = io.open(FilePath, 'r')
	fLines = {}
		for line in file:lines() do
			table.insert(fLines, line)
		end
	local count = 0
	for line in io.lines(FilePath) do
	   count = count + 1
	end
	file:close()
	cLine = count - 1
	SKIN:Bang('!SetVariable', 'LastWritten1', fLines[cLine + 1])
	SKIN:Bang('!SetVariable', 'LastWritten2', fLines[cLine])
	SKIN:Bang('!SetVariable', 'LastWritten3', fLines[cLine - 1])
	SKIN:Bang('!SetVariable', 'LastWritten4', fLines[cLine - 2])
	SKIN:Bang('!SetVariable', 'LastWritten5', fLines[cLine - 3])
end
Rainmeter Log_1.0.rmskin
You do not have the required permissions to view the files attached to this post.
I don't know where i going from here, but i promise it won't be boring... :great: