It is currently December 7th, 2023, 4:45 pm
Get help with creating, editing & fixing problems with skins
tass_co
Posts: 500 Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY
Post
by tass_co » September 20th, 2022, 8:41 pm
Sorry for interrupting.
I guess the action is requested to be executed when the value in the
OFF variable is equal.
(Sorry if I misunderstood)
I made some changes to your code
The format in the
OFF variable should be "
##:##:## "
I added
[] and
"" to your Shutdown,Restart,etc variables to make it work.
Code: Select all
[Rainmeter]
Update=1000
AccurateText=1
MouseActionCursor=0
BackgroundMode=2
SolidColor=255,255,255
MouseOverAction=[!ToggleMeterGroup Power] [!UpdateMeter *] [!Redraw]
MouseLeaveAction=[!ToggleMeterGroup Power] [!UpdateMeter *] [!Redraw]
RightMouseUpAction=[!TraMenu]
SkinWidth=150
SkinHeight=55
[Metadata]
Name=Clock + Shutdown
Author=sl23
Information=Clock with Shutdown.||
Version=2022.9.20
License=CC BY 3.0
[Variables]
Black=0,0,0
Trans=0,0,0,1
Shutdown.=250,150,150
Restart.=100,200,100
Sleep.=150,150,250
Lock.=235,170,100
Shutdown=["shutdown.exe" -s -t 00 -f]
;[!Log "Shutdown"]
Restart=["shutdown.exe" -r -t 0]
;[!Log "Restart"]
Sleep=["rundll32.exe" powrprof.dll,SetSuspendState]
;[!Log "Sleep"]
Lock=["rundll32.exe" user32.dll, LockWorkStation]
;[!Log "Lock"]
Startup=["shell:Startup"]
OFF="4:25:00"
========================================
; Time
========================================
[mTime]
Measure=Time
Format=%#I:%M:%S
IfMatch=#OFF#
IfMatchAction=#Sleep#
DynamicVariables=1
[Time]
Meter=String
MeasureName=mTime
FontFace=Trebuchet MS
StringStyle=Bold
StringAlign=CenterCenter
FontSize=25
FontColor=#Black#
;SolidColor=120,120,120
AntiAlias=1
Text=%1
LeftMouseUpAction=[!RefreshApp]
LeftMouseDoubleClickAction=#Startup#
MiddleMouseUpAction=[!Quit]
;ToolTipText="L - Refresh#CRLF#M - Exit"
X=75
Y=20
H=28
========================================
; SHUTDOWN
========================================
[sShut]
Shape=Rectangle 0,0,10,10,5 | Extend FillColor | StrokeWidth 2 | Extend StrokeAlpha
FillColor=Fill Color [#[#CURRENTSECTION]]
StrokeAlpha=Stroke Color #Trans#
MouseOverAction=[!SetOption #CURRENTSECTION# StrokeAlpha "Stroke Color #Black#"] [!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StrokeAlpha ""] [!UpdateMeter *] [!Redraw]
DynamicVariables=1
ToolTipText=#CURRENTSECTION#
Group=Power
Hidden=1
X=15r
Y=r
[Shutdown.]
Meter=Shape
MeterStyle=sShut
LeftMouseUpAction=#Shutdown#
X=-26r
Y=18r
[Restart.]
Meter=Shape
MeterStyle=sShut
LeftMouseUpAction=#Restart#
[Sleep.]
Meter=Shape
MeterStyle=sShut
LeftMouseUpAction=#Sleep#
[Lock.]
Meter=Shape
MeterStyle=sShut
LeftMouseUpAction=#Lock#
Last edited by tass_co on September 21st, 2022, 12:54 am, edited 1 time in total.
I don't know where i going from here, but i promise it won't be boring...
sl23
Posts: 1140 Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away
Post
by sl23 » September 20th, 2022, 9:17 pm
Thanks to both of you for your help
I tried tass_co's suggestion first, simply due to less editing involved, and that worked a treat. Thanks for the solution.
I'll let you know tomorrow if it worked or not...
tass_co
Posts: 500 Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY
Post
by tass_co » September 20th, 2022, 10:25 pm
sl23 wrote: ↑ September 20th, 2022, 9:17 pm
Thanks to both of you for your help
I tried tass_co's suggestion first, simply due to less editing involved, and that worked a treat. Thanks for the solution.
I'll let you know tomorrow if it worked or not...
I want to make a correction.
#OFF# should be "
4:25:00 ".
I thought it would show "04:25:00" time but no leading zero "0".
Sorry for that
21.09.2022 - 01.25.40-About Rainmeter.png
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...
sl23
Posts: 1140 Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away
Post
by sl23 » September 21st, 2022, 9:38 am
thanks, already sussed it!
sl23
Posts: 1140 Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away
Post
by sl23 » September 21st, 2022, 4:02 pm
Problem solved, thanks for your help
balala
Rainmeter Sage
Posts: 15824 Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania
Post
by balala » September 21st, 2022, 4:38 pm
sl23 wrote: ↑ September 20th, 2022, 9:17 pm
I tried tass_co's suggestion first, simply due to less editing involved, and that worked a treat. Thanks for the solution.
Did you try the IfCondition solution? Am just curious...
sl23
Posts: 1140 Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away
Post
by sl23 » September 21st, 2022, 8:53 pm
No I used IfMatch
tass_co
Posts: 500 Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY
Post
by tass_co » September 22nd, 2022, 12:16 pm
sl23 wrote: ↑ September 21st, 2022, 8:53 pm
No I used IfMatch
I've realized now
If you only want it to execute an action at an hour in the afternoon, we need to add another timer.
I made the solution using AM/PM difference.
Code: Select all
.
.
.
========================================
; Time
========================================
[mTimePM]
Measure=Time
Format=%p%#I:%M:%S
RegExpSubstitute=1
Substitute="PM":""
[mTime]
Measure=Time
Format=%#I:%M:%S
IfMatch=(?=.*#OFF#)([&mTimePM])
IfMatchAction=#Sleep#
DynamicVariables=1
.
.
.
.
22.09.2022 - 07.15.55-About Rainmeter.png
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...
sl23
Posts: 1140 Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away
Post
by sl23 » September 23rd, 2022, 6:59 am
That's really good of you tass_co, thanks, but it's not necessary as the pc won't be on in the morning so it doesn't cause a problem. But it is working fine as is.
Appreciate your continuing thoughts though
tass_co
Posts: 500 Joined: May 4th, 2020, 3:01 pm
Location: Ankara, TURKEY
Post
by tass_co » September 23rd, 2022, 8:14 am
sl23 wrote: ↑ September 23rd, 2022, 6:59 am
That's really good of you tass_co, thanks, but it's not necessary as the pc won't be on in the morning so it doesn't cause a problem. But it is working fine as is.
Appreciate your continuing thoughts though
I don't know where i going from here, but i promise it won't be boring...