It is currently July 27th, 2024, 12:55 am

Coding a simple Clock

General topics related to Rainmeter.
odsmk
Posts: 1
Joined: November 16th, 2010, 2:56 pm

Coding a simple Clock

Post by odsmk »

--Friend requested a simple guide.


Coding a clock for rainmeter!

1. Ok, so first download rainmeter: http://code.google.com/p/rainmeter/downloads/list
--SETTING UP
2. Next, find the rainmeter folder in "My Documents"
3. Make a folder inside skins called.. Clock. I guess.
4. Inside it make a notepad.
5. Click file -> Save as once you open the notepad
6. Name it "Clock.ini" without the "s
7. Delete the first notepad (the new one should have a cog-like shape on it) and keep the new one.
8. Open it.
--CODING

Code: Select all

[Rainmeter]
Created by [firstname] [lastname]

;=========MEASURES

[MeasureTime]
Measure=Time
Format= %I:%M %p

;=========METERS

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=0
Y=0
FontColor=*color code*
FontSize=*size picked*
FontFace=*font name*
StringAlign=LEFT
AntiAlias=1
I will be adding sidenotes/tips at the end of each code.
Okay, since this will be your creation, start it off like this (optional)

Code: Select all

[Rainmeter]
Created by [firstname] [lastname]
Then, we will start the measures.

So measures are pretty much what they are called. They are the variable that measures what you are coding. Most of the time, coding anything for rainmeter, the measure will be pretty simple. To be honest clocks are a bit more because you have to use letter commands.

So begin the measures like so

Code: Select all

[Rainmeter]
Created by [firstname] [lastname]

;=========MEASURES

[MeasureTime]
Measure=Time
Format=%I
So far this is measuring the hour on a 12-hour-clock schedule. Here is what it would be like that would say a clock like "6:25"

Code: Select all

[Rainmeter]
Created by [firstname] [lastname]

;=========MEASURES

[MeasureTime]
Measure=Time
Format= %I:%M
Now to make it something like "6:25 AM"

Code: Select all

[Rainmeter]
Created by [firstname] [lastname]

;=========MEASURES

[MeasureTime]
Measure=Time
Format= %I:%M %p
• You may do anything like --------MEASURES------- or just Measures, it is just a label to locate things in the code easier. The ;=======MEASURES thing that is. It is COMPLETELY optional.

• Again, each of the [MeasureHour] things are optional, just there to locate things faster.

• I will be putting all of the letter commands at the bottom of the thread.
Now we will move to Meters. Meters are pretty much the looks of the clock. Font color, size, font, etc.

Code: Select all

[Rainmeter]
Created by [firstname] [lastname]

;=========MEASURES

[MeasureTime]
Measure=Time
Format= %I:%M %p

;=========METERS

[MeterTime]
MeasureName=MeasureTime
So far, you are pretty much just telling the meter what to work with. Since in most projects, you will have more than one item, it works out good.

I will be taking meters away from the whole project to save space, but at the end I'll put it together.

Code: Select all

;=========METERS

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
I am not really sure what the hell string means, but if you don't have it the whole clock doesn't work if I am not right.

Code: Select all

;=========METERS

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=0
Y=0
These are the X and Y coordinates. X moves left to right, Y moves up and down. The higher your X, the more right it will Go. X=0 is the left side of your screen, Y=0 is the top. Of course you can still drag it around, but this works well when you have things like date and stuff separate from the time, but in the same code.

Code: Select all

;=========METERS

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=0
Y=0
FontColor=*color code*
FontSize=*size picked*
FontFace=*font name*
This is where you pick out the color, size, and font for the clock. Size is pretty much like on WORD, 10 = small, 100 = huge. You will have to decide this depending on what you want.
• For more about color codes: http://rainmeter.net/cms/Meters-ColorCodes_beta
-0,0,0,250 is black
-250,250,250,250 is white

• For some awesome fonts, read this thread: http://www.madstory.org/general-discussion-f29/dafontcom-t1043.htm

Code: Select all

;=========METERS

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=0
Y=0
FontColor=*color code*
FontSize=*size picked*
FontFace=*font name*
StringAlign=LEFT
Kind of like left, center, right on WORD.

Code: Select all

;=========METERS

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=0
Y=0
FontColor=*color code*
FontSize=*size picked*
FontFace=*font name*
StringAlign=LEFT
AntiAlias=1
I am not really sure of the whole purpose, but if you don't include this or make it 0, the font is kind of a glitchy looking type. If you put it at 1, it is more readable and such. You'll have to decide for your clock. I didn't really test like 2, 3, -1, etc. You can for yourself if you want.

Code: Select all

[Rainmeter]
Created by [firstname] [lastname]

;=========MEASURES

[MeasureTime]
Measure=Time
Format= %I:%M %p

;=========METERS

[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=0
Y=0
FontColor=*color code*
FontSize=*size picked*
FontFace=*font name*
StringAlign=LEFT
AntiAlias=1


So this is for a simple simple clock. You can make different things with Meters, so long as the MeasureName=[Measure you are working with].

Every measure with clocks you make will be Measure=Time. Even for date. It is all time.

If you have any questions or concerns, comment below!
A - Day of the week (e.g. Tuesday)
a - Day of the week Minimized (e.g. Tue)
B - Month of the Year (e.g. NOVEMBER)
b - Month of the Year Minimized (e.g. NOV)
c - Date in numbers, all time (e.g. 09/19/10 12:53:52)
d - Date of the month in numbers (e.g. 24)
H - Hour Military Time (e.g. 24 hour-clock)
I - Hour Regular (e.g. 12 hour-clock)
j - Day of the Year 9 (e.g. 320)
M - Minute of the Hour (e.g. 45)
m - Month in numbers (e.g. 12 = December)
p - AM/PM (e.g. Adds AM/PM to the end)
S - Second of the Minute (e.g. 33)
U - Week of the Year?? (This or W puts the week of the year, not completely sure. e.g. 38)
W - Week of the Year?? (This or W puts the week of the year, not completely sure. e.g. 38)
w - Day of the week in Numbers (e.g. 5 = Thursday)
X - Time, Military (e.g. 13:05:10)
x - Date in Numbers (e.g. 09/19/10)
Y - Year (e.g. 2010)
y - Year minimized (e.g. 10 for 2010)
Z - Timezone (e.g. Central Standard Time)
z - Timezone (e.g. Central Standard Time)
User avatar
Chewtoy
Moderator
Posts: 995
Joined: June 10th, 2009, 12:44 pm
Location: Sweden

Re: Coding a simple Clock

Post by Chewtoy »

There's already something like this: http://rainmeter.net/cms/Rainmeter101-Tutorial2, but it doesn't hurt to have it here as well, and your explanation is quite good. Thanks!
I don't think, therefore I'm not.
Raleigh
Posts: 1
Joined: November 18th, 2010, 12:06 am

Re: Coding a simple Clock

Post by Raleigh »

I can't seem to save it as an .ini doc. Do i need to download something first?