It is currently December 6th, 2022, 2:09 pm

Timetable Skin

Get help with creating, editing & fixing problems with skins
ItsJustRyan
Posts: 61
Joined: October 25th, 2019, 1:20 am

Timetable Skin

Post by ItsJustRyan »

Hi!

I've currently got a timetable skin that I made, and I'm trying to get it so that there under each day (Monday, Tuesday etc), it shows the dates for the current week (for example today it would say 10 Nov under Thursday and the corresponding ones under the rest.) How would I do that?

Code: Select all

[Rainmeter]
Update=10
AccurateText=1
AntiAlias=1

[Variables]
@include=#@#Variables.inc
LineSpac=12
Monday=0
Tuesday=0
Wednesday=0
Thursday=0
Friday=0
;DateMonday=0
;DateTuesday=0
;DateWednesday=0
;DateThursday=0
;DateFriday=0

[MeasureDayShort]
Measure=Time
Format=%a
Substitute=#Date#

[MeasureTimeDate]
Measure=Time
Format=%e/%m
Substitute=#Date#

[MeasureDay]
Measure=Time
Format=%A
Substitute=#Date#
IfMatch=Monday
IfMatchAction=[!SetVariable Monday "50"][!SetVariable Tuesday "0"][!SetVariable Wednesday "0"][!SetVariable Thursday "0"][!SetVariable Friday "0"]
IfMatch2=Tuesday
IfMatchAction2=[!SetVariable Tuesday "50"][!SetVariable Monday "0"][!SetVariable Wednesday "0"][!SetVariable Thursday "0"][!SetVariable Friday "0"]
IfMatch3=Wednesday
IfMatchAction3=[!SetVariable Wednesday "50"][!SetVariable Tuesday "0"][!SetVariable Monday "0"][!SetVariable Thursday "0"][!SetVariable Friday "0"]
IfMatch4=Thursday
IfMatchAction4=[!SetVariable Thursday "50"][!SetVariable Tuesday "0"][!SetVariable Wednesday "0"][!SetVariable Monday "0"][!SetVariable Friday "0"]
IfMatch5=Friday
IfMatchAction5=[!SetVariable Friday "50"][!SetVariable Tuesday "0"][!SetVariable Wednesday "0"][!SetVariable Thursday "0"][!SetVariable Monday "0"]
IfMatch6=Saturday|Sunday
IfMatchAction6=[!SetVariable Monday "0"][!SetVariable Tuesday "0"][!SetVariable Wednesday "0"][!SetVariable Thursday "0"][!SetVariable Friday "0"]
IfMatchMode=1
DynamicVariables=1

[MeasureTime]
Measure=Time
Format=%R:%S
Substitute=#Date#

[MeasureCal]
Measure=Time
Format=%d %b %Y
Substitute=#Date#

[MeasureHour]
Measure=Time
Format=%H
IfCondition=MeasureHour = 9
IfTrueAction=[!SetOption VerticalBar X "70"][!SetOption VerticalBar Hidden "0"]
IfCondition2=MeasureHour = 10
IfTrueAction2=[!SetOption VerticalBar X "128"][!SetOption VerticalBar Hidden "0"]
IfCondition3=MeasureHour = 11
IfTrueAction3=[!SetOption VerticalBar X "186"][!SetOption VerticalBar Hidden "0"]
IfCondition4=MeasureHour = 12
IfTrueAction4=[!SetOption VerticalBar X "244"][!SetOption VerticalBar Hidden "0"]
IfCondition5=MeasureHour = 13
IfTrueAction5=[!SetOption VerticalBar X "302"][!SetOption VerticalBar Hidden "0"]
IfCondition6=MeasureHour = 14
IfTrueAction6=[!SetOption VerticalBar X "360"][!SetOption VerticalBar Hidden "0"]
IfCondition7=MeasureHour = 15
IfTrueAction7=[!SetOption VerticalBar X "419"][!SetOption VerticalBar Hidden "0"]
IfCondition8=MeasureHour = 16
IfTrueAction8=[!SetOption VerticalBar X "478"][!SetOption VerticalBar Hidden "0"]
IfCondition9=MeasureHour = 17
IfTrueAction9=[!SetOption VerticalBar X "535"][!SetOption VerticalBar Hidden "0"]
IfCondition10=MeasureHour = 18
IfTrueAction10=[!SetOption VerticalBar X "592"][!SetOption VerticalBar Hidden "0"]
IfCondition11=(MeasureHour >= 19) || (MeasureHour < 9)
IfTrueAction11=[!SetOption VerticalBar Hidden "1"]

[Background Grid]
Meter=Shape
Shape=Rectangle 0,0,650,300 | StrokeWidth 1 | FIllColor 240,240,240 | StrokeColor 0,0,0
Shape2=Rectangle 0,0,650,50 | StrokeWidth 1 | FIllColor 255,255,255,0 | StrokeColor 0,0,0,200
Shape3=Rectangle 0,50,650,50 | StrokeWidth 1 | FIllColor 255,255,255,0 | StrokeColor 0,0,0,100
Shape4=Rectangle 0,150,650,50 | StrokeWidth 1 | FIllColor 255,255,255,0 | StrokeColor 0,0,0,100
Shape5=Rectangle 0,250,650,50 | StrokeWidth 1 | FIllColor 255,255,255,0 | StrokeColor 0,0,0,100

Shape6=Rectangle 0,0,70,300 | StrokeWidth 1 | FIllColor 255,255,255,0 | StrokeColor 0,0,0,100
Shape7=Rectangle 128,0,58,300 | StrokeWidth 1 | FIllColor 255,255,255,0 | StrokeColor 0,0,0,100
Shape8=Rectangle 244,0,58,300 | StrokeWidth 1 | FIllColor 255,255,255,0 | StrokeColor 0,0,0,100
Shape9=Rectangle 360,0,58,300 | StrokeWidth 1 | FIllColor 255,255,255,0 | StrokeColor 0,0,0,100
Shape10=Rectangle 478,0,58,300 | StrokeWidth 1 | FIllColor 255,255,255,0 | StrokeColor 0,0,0,100
Shape11=Rectangle 592,0,58,300 | StrokeWidth 1 | FIllColor 255,255,255,0 | StrokeColor 0,0,0,100
;MouseOverAction=[!Refresh]
MouseScrollDownAction=[!SetTransparency "150" "Timetable" "main.ini"]
MouseScrollUpAction=[!SetTransparency "240" "Timetable" "main.ini"]

[MeterDay]
Meter=String
MeasureName=MeasureDayShort
Text="%1"
AntiAlias=1
DynamicVariables=1
StringAlign=CenterCenter
StringCase=Upper
X=35
Y=25
FontWeight=800
FontSize=9

[MeterTime]
Meter=String
MeasureName=MeasureTime
StringAlign=CenterCenter
StringCase=Upper
FontWeight=900
FontSize=10
Text="%1"
X=35
Y=41
AntiAlias=1

[MeterCal]
Meter=String
MeasureName=MeasureCal
StringAlign=CenterCenter
FontWeight=600
FontSize=8
Text="%1"
X=35
Y=10
AntiAlias=1

[LabelStyle]
FontFace=Century Gothic
FontSize=15
FontWeight=800
StringAlign=CenterCenter
W=58
H=50
Y=25

[Label1]
Meter=String
Text=0900
MeterStyle=LabelStyle
X=99

[Label2]
Meter=String
Text=1000
MeterStyle=LabelStyle
X=157

[Label3]
Meter=String
Text=1100
MeterStyle=LabelStyle
X=215

[Label4]
Meter=String
Text=1200
MeterStyle=LabelStyle
X=273

[Label5]
Meter=String
Text=1300
MeterStyle=LabelStyle
X=331

[Label6]
Meter=String
Text=1400
MeterStyle=LabelStyle
X=389

[Label7]
Meter=String
Text=1500
MeterStyle=LabelStyle
X=447

[Label8]
Meter=String
Text=1600
MeterStyle=LabelStyle
X=505

[Label9]
Meter=String
Text=1700
MeterStyle=LabelStyle
X=563

[Label10]
Meter=String
Text=1800
MeterStyle=LabelStyle
X=621

[LabelDayStyle]
FontFace=Century Gothic
FontSize=18
FontWeight=800
StringAlign=CenterCenter
W=70
H=50
X=35

[Day]
Meter=String
Text=Mon
MeterStyle=LabelDayStyle
Y=75

[Day2]
Meter=String
Text=Tues
MeterStyle=LabelDayStyle
Y=125

[Day3]
Meter=String
Text=Wed
MeterStyle=LabelDayStyle
Y=175

[Day4]
Meter=String
Text=Thur
MeterStyle=LabelDayStyle
Y=225

[Day5]
Meter=String
Text=Fri
MeterStyle=LabelDayStyle
Y=275

[TriangleExit]
Meter=Image
ImageName=#@#Images/1.png
w=70
h=50
X=0
Imagetint=255,255,255,1
ImageFlip=Horizontal
LeftMouseUpAction=[!DeactivateConfig "Timetable" "main.ini"]
RightMouseUpAction=!Execute ["C:\Users\Ryan\Documents\Rainmeter\Skins\Timetable\@Resources\variables.inc"]

[Monday]
Y=75
StringAlign=LeftCenter
ClipString=2
H=50

[Tuesday]
Y=125
StringAlign=LeftCenter
ClipString=2
H=50

[Wednesday]
Y=175
StringAlign=LeftCenter
ClipString=2
H=50

[Thursday]
Y=225
StringAlign=LeftCenter
ClipString=2
H=50

[Friday]
Y=275
StringAlign=LeftCenter
ClipString=2
H=50

[0900]
X=70

[1000]
X=128

[1100]
X=186

[1200]
X=244

[1300]
X=302

[1400]
X=360

[1500]
X=418

[1600]
X=478

[1700]
X=536

[1800]
X=592

[Group1]
Text=#G1Name#
SolidColor=#G1Col#
FontFace=Century Gothic
FontSize=8
FontWeight=800
AntiAlias=1

[Group2]
Text=#G2Name#
SolidColor=#G2Col#
FontFace=Century Gothic
FontSize=8
FontWeight=800
AntiAlias=1

[Group3]
Text=#G3Name#
SolidColor=#G3Col#
FontFace=Century Gothic
FontSize=8
FontWeight=800
AntiAlias=1

[Group4]
Text=#G4Name#
SolidColor=#G4Col#
FontFace=Century Gothic
FontSize=8
FontWeight=800
AntiAlias=1

[Block1]
Meter=String
Postfix=#Note1#
MeterStyle=#Style1#
W=#W1#

[Block2]
Meter=String
Postfix=#Note2#
MeterStyle=#Style2#
W=#W2#

[Block3]
Meter=String
Postfix=#Note3#
MeterStyle=#Style3#
W=#W3#

[Block4]
Meter=String
Postfix=#Note4#
MeterStyle=#Style4#
W=#W4#

[Block5]
Meter=String
Postfix=#Note5#
MeterStyle=#Style5#
W=#W5#

[Block6]
Meter=String
Postfix=#Note6#
MeterStyle=#Style6#
W=#W6#

[Block7]
Meter=String
Postfix=#Note7#
MeterStyle=#Style7#
W=#W7#

[Block8]
Meter=String
Postfix=#Note8#
MeterStyle=#Style8#
W=#W8#

[Block9]
Meter=String
Postfix=#Note9#
MeterStyle=#Style9#
W=#W9#

[Block10]
Meter=String
Postfix=#Note10#
MeterStyle=#Style10#
W=#W10#

;-------------------------------------------------------

[HorizontalBar]
Meter=Shape
Shape=Rectangle 0,50,650,50 | StrokeWidth 0 | FIllColor 0,0,255,#Monday# | StrokeColor 0,0,0,#Monday#
Shape2=Rectangle 0,100,650,50 | StrokeWidth 0 | FIllColor 0,0,255,#Tuesday# | StrokeColor 0,0,0,#Tuesday#
Shape3=Rectangle 0,150,650,50 | StrokeWidth 0 | FIllColor 0,0,255,#Wednesday# | StrokeColor 0,0,0,#Wednesday#
Shape4=Rectangle 0,200,650,50 | StrokeWidth 0 | FIllColor 0,0,255,#Thursday# | StrokeColor 0,0,0,#Thursday#
Shape5=Rectangle 0,250,650,50 | StrokeWidth 0 | FIllColor 0,0,255,#Friday# | StrokeColor 0,0,0,#Friday#
DynamicVariables=1

[VerticalBar]
Meter=Shape
Shape=Rectangle 0,0,58,300 | StrokeWidth 0 | FIllColor 255,0,0,50 | StrokeColor 0,0,0,50
X=0

[DateMon]
Meter=String
Text=#DateMonday#
X=35
Y=92
StringAlign=CenterCenter

[DateTue]
Meter=String
Text=#DateTuesday#
X=35
Y=142
StringAlign=CenterCenter

[DateWed]
Meter=String
Text=#DateWednesday#
X=35
Y=192
StringAlign=CenterCenter

[DateThu]
Meter=String
Text=#DateThursday#
X=35
Y=242
StringAlign=CenterCenter

[DateFri]
Meter=String
Text=#DateFriday#
X=35
Y=292
StringAlign=CenterCenter
User avatar
balala
Rainmeter Sage
Posts: 14766
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Timetable Skin

Post by balala »

ItsJustRyan wrote: November 10th, 2022, 7:55 pm I've currently got a timetable skin that I made, and I'm trying to get it so that there under each day (Monday, Tuesday etc), it shows the dates for the current week (for example today it would say 10 Nov under Thursday and the corresponding ones under the rest.) How would I do that?
Not quite easy, but possible. But you need a trick: you get the date of today, from which you extract the weekday number. The result in most cases is the date of Monday of current week. However at the beginning of month, this is not true, with the above procedure you might get a negative date for Monday. What you have to do in such cases is to add the length of previous month to the above difference. There are a few other details to be taken into account.
In your case, add the following measures to your code:

Code: Select all

[MeasureWeekDay]
Measure=Time
Format=%u

[MeasureToday]
Measure=Time
Format=%d

[MeasureLeapYear]
Measure=Time
Format=%Y
IfCondition=(MeasureLeapYear%4=0)
IfTrueAction=[!SetVariable Leap "29"]
IfFalseAction=[!SetVariable Leap "28"]

[MeasurePrevMonthL]
Measure=Time
Format=%#m
RegExpSubstitute=1
Substitute="^1$":"31","^2$":"31","^3$":"#Leap#","^4$":"31","^5$":"30","^6$":"31","^7$":"30","^8$":"31","^9$":"31","^10$":"30","^11$":"31","^12$":"30"
DynamicVariables=1

[MeasureMonday]
Measure=Calc
Formula=(( MeasureToday - MeasureWeekDay + 1 ) + [MeasurePrevMonthL] * (( MeasureToday - MeasureWeekDay ) < 0 ))
DynamicVariables=1
The [MeasureMonday] measure returns what you need. I didn't add options to transfere this date into the #DateMonday# variable, you should add the MeasureName=MeasureMonday option to the [DateMon] meter and replace the Text option of the same meter with Text=%1.
Please check the above procedure and let me know if it works for you. If it does, there are needed a few other measures to get the date of Tuesday, Wednesday and so one (adding one, two and so on, to the date of Monday doesn't work in all cases).
ItsJustRyan
Posts: 61
Joined: October 25th, 2019, 1:20 am

Re: Timetable Skin

Post by ItsJustRyan »

Yup! It displays the number 7 (which is correct). Im guessing for the other 4 i just add to that and have it loop back around at the end of the month. (Which is variable :/)
User avatar
balala
Rainmeter Sage
Posts: 14766
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Timetable Skin

Post by balala »

ItsJustRyan wrote: November 10th, 2022, 10:43 pm Yup! It displays the number 7 (which is correct). Im guessing for the other 4 i just add to that and have it loop back around at the end of the month. (Which is variable :/)
There is a much - much easier and simpler solution, but unfortunately, I didn't realize in time. So, forget what I wrote last time and do this way: add the following measures to your original code:

Code: Select all

[MeasureWeekDay]
Measure=Time
Format=%u

[MeasureMonday]
Measure=Time
Format=%d
TimeStamp=([MeasureWeekDay:TimeStamp]-86400*([MeasureWeekDay]-1))
DynamicVariables=1

[MeasureTuesday]
Measure=Time
Format=%d
TimeStamp=([MeasureWeekDay:TimeStamp]-86400*([MeasureWeekDay]-2))
DynamicVariables=1

[MeasureWednesday]
Measure=Time
Format=%d
TimeStamp=([MeasureWeekDay:TimeStamp]-86400*([MeasureWeekDay]-3))
DynamicVariables=1

[MeasureThursday]
Measure=Time
Format=%d
TimeStamp=([MeasureWeekDay:TimeStamp]-86400*([MeasureWeekDay]-4))
DynamicVariables=1

[MeasureFriday]
Measure=Time
Format=%d
TimeStamp=([MeasureWeekDay:TimeStamp]-86400*([MeasureWeekDay]-5))
DynamicVariables=1

[MeasureSaturday]
Measure=Time
Format=%d
TimeStamp=([MeasureWeekDay:TimeStamp]-86400*([MeasureWeekDay]-6))
DynamicVariables=1

[MeasureSunday]
Measure=Time
Format=%d
TimeStamp=([MeasureWeekDay:TimeStamp]-86400*([MeasureWeekDay]-7))
DynamicVariables=1
As you probably figured out, [MeasureMonday] returnes the date of Monday of current week, [MeasureTuesday] the date of Tuesday, [MeasureWednesday] the date of Wednesday and so on.
Much simpler, right? Definitely is. And besides, much more precise, because this time Time measures are used. Same thing I talked about in my previous reply applies here as well: I didn1t transfere the dates into variable either now, but if needed this can easily be done. Please let me know if needed, but you don1t know how to deal with this.
:? Sorry for my stupid :? (extremely - extremely stupid) mistake! :?
ItsJustRyan
Posts: 61
Joined: October 25th, 2019, 1:20 am

Re: Timetable Skin

Post by ItsJustRyan »

No worries :D

What I had in mind originally before I asked for help was much dumber. Didn't realise the Timestamp thing lets you set a kind of benchmark date, which is much easier.

So now I've got a timetable that shows timetable stuff and both the dates for this week and the week before (just to test)
User avatar
balala
Rainmeter Sage
Posts: 14766
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Timetable Skin

Post by balala »

ItsJustRyan wrote: November 11th, 2022, 11:52 pm So now I've got a timetable that shows timetable stuff and both the dates for this week and the week before (just to test)
:thumbup: