It is currently October 22nd, 2021, 10:52 pm

Scrolling Text in a Container

Tips and Tricks from the Rainmeter Community
User avatar
jsmorley
Developer
Posts: 22374
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Scrolling Text in a Container

Post by jsmorley »

CaseyScroll_1.1.rmskin


Click to animate
GIF.gif


CaseyScroll.ini:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
LeastY=13
CurrentY=13
; This FontHeight is the height in pixels of a character in 
; the font, inlcuding any slack space above or below the actual
; character glyph.
FontHeight=17

[MeasureFile]
Measure=WebParser
; The file should be encoded as UTF-8 or ANSI. If you need to use a
; file that is encoded as UTF-16 LE, Set CodePage=1200 on this measure.
URL=file://#@#Text\Casey at the bat.txt
;URL=file://#@#Text\Charge of the Light Bridage.txt
RegExp=(?siU)^(.*)$
StringIndex=1
FinishAction=[!UpdateMeter MeasureTextHeight]

[MeterHider]
Meter=Shape
; So we don't want [MeasureTextHeight] to impact the height of the
; overall skin, nor to in any way be actually displayed, so we put
; it inside a Container that is a "singularity". It will still have
; the measureable width and height that it would on its own, but will
; not display, nor make the size of the skin any larger.
X=-1
Y=-1
W=1
H=1
SolidColor=0,0,0,1

[MeasureTextHeight]
Meter=String
; We use this to measure the height of the text as if it was displayed,
; by using [MeasureTextHeight:H] in a formula anywhere.
MeasureName=MeasureFile
W=483
ClipString=2
FontSize=11
FontColor=0,0,0,0
Container=MeterHider

[MeterContainerVisible]
Meter=Shape
Shape=Rectangle 1,1,483,303 | StrokeWidth 2 | Stroke Color 150,150,150,255 | Fill Color 47,47,47,255

[MeterContainer]
Meter=Shape
; Note that we don't want any text to overlap the border "stroke" on the 
; visible container, so we make the actual container a tad inset and smaller.
Shape=Rectangle 2,2,480,300
DynamicVariables=1
MouseScrollDownAction=[!SetVariable CurrentY "(Clamp((#CurrentY# - (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable CurrentY "(Clamp((#CurrentY# + (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]

[MeterText]
Meter=String
MeasureName=MeasureFile
Y=#CurrentY#
W=483
ClipString=2
FontSize=11
FontWeight=400
FontColor=255,255,255,255
Padding=10,0,0,0
AntiAlias=1
DynamicVariables=1
Container=MeterContainer
You do not have the required permissions to view the files attached to this post.
joemorcullo
Posts: 1
Joined: January 28th, 2021, 1:50 pm

Re: Scrolling Text in a Container

Post by joemorcullo »

jsmorley wrote: February 23rd, 2019, 3:04 pm
CaseyScroll_1.1.rmskin


Click to animate
GIF.gif


CaseyScroll.ini:

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[Variables]
LeastY=13
CurrentY=13
; This FontHeight is the height in pixels of a character in 
; the font, inlcuding any slack space above or below the actual
; character glyph.
FontHeight=17

[MeasureFile]
Measure=WebParser
; The file should be encoded as UTF-8 or ANSI. If you need to use a
; file that is encoded as UTF-16 LE, Set CodePage=1200 on this measure.
URL=file://#@#Text\Casey at the bat.txt
;URL=file://#@#Text\Charge of the Light Bridage.txt
RegExp=(?siU)^(.*)$
StringIndex=1
FinishAction=[!UpdateMeter MeasureTextHeight]

[MeterHider]
Meter=Shape
; So we don't want [MeasureTextHeight] to impact the height of the
; overall skin, nor to in any way be actually displayed, so we put
; it inside a Container that is a "singularity". It will still have
; the measureable width and height that it would on its own, but will
; not display, nor make the size of the skin any larger.
X=-1
Y=-1
W=1
H=1
SolidColor=0,0,0,1

[MeasureTextHeight]
Meter=String
; We use this to measure the height of the text as if it was displayed,
; by using [MeasureTextHeight:H] in a formula anywhere.
MeasureName=MeasureFile
W=483
ClipString=2
FontSize=11
FontColor=0,0,0,0
Container=MeterHider

[MeterContainerVisible]
Meter=Shape
Shape=Rectangle 1,1,483,303 | StrokeWidth 2 | Stroke Color 150,150,150,255 | Fill Color 47,47,47,255

[MeterContainer]
Meter=Shape
; Note that we don't want any text to overlap the border "stroke" on the 
; visible container, so we make the actual container a tad inset and smaller.
Shape=Rectangle 2,2,480,300
DynamicVariables=1
MouseScrollDownAction=[!SetVariable CurrentY "(Clamp((#CurrentY# - (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable CurrentY "(Clamp((#CurrentY# + (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]

[MeterText]
Meter=String
MeasureName=MeasureFile
Y=#CurrentY#
W=483
ClipString=2
FontSize=11
FontWeight=400
FontColor=255,255,255,255
Padding=10,0,0,0
AntiAlias=1
DynamicVariables=1
Container=MeterContainer
:thumbup: :thumbup: :thumbup:

How about the possibility to change the URL value dynamically? Let say I have a file "Notes1.txt" then upon clicking an image/button, it should change to "Notes2.txt". I already done this with QuotePlugin but I'm having a hard time to do this on WebParser :D
User avatar
jsmorley
Developer
Posts: 22374
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Scrolling Text in a Container

Post by jsmorley »

The key is to use !CommandMeasure to force WebParser to immediately go out to the remote resource, rather than waiting for the nature course of UpdateRate to update the data.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
ContextTitle=Casey at the Bat
ContextAction=[!SetOption MeasureFile URL "file://#@#Text\Casey at the bat.txt"][!CommandMeasure MeasureFile "Update"][!Update]
ContextTitle2=Charge of the Light Brigade 
ContextAction2=[!SetOption MeasureFile URL "file://#@#Text\Charge of the Light Brigade.txt"][!CommandMeasure MeasureFile "Update"][!Update]

[Variables]
LeastY=13
CurrentY=13
; This FontHeight is the height in pixels of a character in 
; the font, inlcuding any slack space above or below the actual
; character glyph.
FontHeight=17

[MeasureFile]
Measure=WebParser
; The file should be encoded as UTF-8 or ANSI. If you need to use a
; file that is encoded as UTF-16 LE, Set CodePage=1200 on this measure.
URL=file://#@#Text\Casey at the bat.txt
;URL=file://#@#Text\Charge of the Light Brigade.txt
RegExp=(?siU)^(.*)$
StringIndex=1
FinishAction=[!UpdateMeter MeasureTextHeight]

[MeterHider]
Meter=Shape
; So we don't want [MeasureTextHeight] to impact the height of the
; overall skin, nor to in any way be actually displayed, so we put
; it inside a Container that is a "singularity". It will still have
; the measureable width and height that it would on its own, but will
; not display, nor make the size of the skin any larger.
X=-1
Y=-1
W=1
H=1
SolidColor=0,0,0,1

[MeasureTextHeight]
Meter=String
; We use this to measure the height of the text as if it was displayed,
; by using [MeasureTextHeight:H] in a formula anywhere.
MeasureName=MeasureFile
W=483
ClipString=2
FontSize=11
FontColor=0,0,0,0
Container=MeterHider

[MeterContainerVisible]
Meter=Shape
Shape=Rectangle 1,1,483,303 | StrokeWidth 2 | Stroke Color 150,150,150,255 | Fill Color 47,47,47,255

[MeterContainer]
Meter=Shape
; Note that we don't want any text to overlap the border "stroke" on the 
; visible container, so we make the actual container a tad inset and smaller.
Shape=Rectangle 2,2,480,300
DynamicVariables=1
MouseScrollDownAction=[!SetVariable CurrentY "(Clamp((#CurrentY# - (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable CurrentY "(Clamp((#CurrentY# + (#FontHeight#*2)),(-([&MeasureTextHeight:H]-300)),#LeastY#))"][!UpdateMeter *][!Redraw]

[MeterText]
Meter=String
MeasureName=MeasureFile
Y=#CurrentY#
W=483
ClipString=2
FontSize=11
FontWeight=400
FontColor=255,255,255,255
Padding=10,0,0,0
AntiAlias=1
DynamicVariables=1
Container=MeterContainer

https://docs.rainmeter.net/manual/measures/webparser/#CommandMeasureUpdate


It's all here as an example. How you trigger the change is up to you.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1
ContextTitle=Casey at the Bat
ContextAction=[!SetOption MeasureFile URL "file://#@#Text\Casey at the bat.txt"][!CommandMeasure MeasureFile "Update"][!Update]
ContextTitle2=Charge of the Light Brigade 
ContextAction2=[!SetOption MeasureFile URL "file://#@#Text\Charge of the Light Brigade.txt"][!CommandMeasure MeasureFile "Update"][!Update]
nek
Posts: 47
Joined: November 3rd, 2019, 12:00 am

Re: Scrolling Text in a Container

Post by nek »

I always learn something from jsmorley's codes. Thank you as always.
Here is my deliverables. SKIN: Displays a HTTP response headers and body using a RunCommand plugin and curl.exe.


Animated preview:
Image
  • Scrolling Text in a Container.
  • Update=-1 in the [Rainmeter] section.
  • There are not meters/measures having a DynamicVariables=1
  • Using a Mouse.dll plugin to grab the scrollbar button.
  • Advanced context menus with sub-menus.
A part of codes:
RunCommand.curl.ini

Code: Select all

;;20210308
;;UTF-16LE BOM / UCS-2 LE BOM

[Variables]
CONTENT_HEIGHT=0
CURRENT_CONTENT=msResponseHeader
CRNT_Y=0
FONT_HEIGHT=18
FONT_NAME=Segoe UI
FONT_SIZE=10
FONT_WEIGHT=600
INIT_Y=0
LOCK_SKIN=0
SCROLLBAR_BUTTON_HEIGHT=20
SKIN_HEIGHT=320
SKIN_WIDTH=480
URL=https://checkip.amazonaws.com/
USER_AGENT="-A "Mozilla/5.0 (iPhone; CPU iPhone OS 14_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.0 Mobile/15E148 Safari/604.1""
ACT0=[!WriteKeyValue Variables CALLER_CONFIG "#CURRENTCONFIG#" "[#*FP*]"][!WriteKeyValue Variables CALLER_FILE "#CURRENTFILE#" "[#*FP*]"]

[msScript]
Measure=Script
ScriptFile=#CURRENTPATH#RunCommand.curl.lua
Disabled=1
;;Script measure | https://docs.rainmeter.net/manual/measures/script/

[msRunCommand]
Measure=Plugin
Plugin=RunCommand
Parameter=curl.exe -s -i -L --url #URL# #USER_AGENT#
OutputType=UTF8
Timeout=-1
FinishAction=[!EnableMeasure msAction_Toggle_ScrollBar][!EnableMeasure msAction_UpdateContent][!EnableMeasureGroup groupResponse][!SetOptionGroup groupResponse String "[#CURRENTSECTION#]"][!UpdateMeasureGroup groupResponse]
;;RunCommand plugin | https://docs.rainmeter.net/manual/plugins/runcommand/

[msResponseHeader]
Measure=String
RegExpSubstitute=1
Substitute="^(?(?!HTTP\/\d)[\s\S]+)":"","^(HTTP\/\d[\s\S]+?)\n{2,}(?!HTTP\/\d)[\s\S]+$":"\1"
Disabled=1
Group=groupResponse
;;Substitute | https://docs.rainmeter.net/manual/measures/general-options/substitute/
;;Newline | https://en.wikipedia.org/wiki/Newline | Unix \n, Windows \r\n, Mac \r
;;The following regular expression is NOT strict. This code might cause Rainmeter.exe to crash.

[msResponseBody]
Measure=String
RegExpSubstitute=1
;;The following regular expression is NOT strict. This code might cause Rainmeter.exe to crash.
Substitute="^(?(?!HTTP\/\d)[\s\S]+)":"","^HTTP\/\d[\s\S]+?\n{2,}(?!HTTP\/\d)([\s\S]+)$":"\1"
Disabled=1
Group=groupResponse
OnUpdateAction=[!UpdateMeasure msAction_UpdateContent]

[msAction_UpdateContent]
Measure=String
OnUpdateAction=[!SetVariable CRNT_Y "#INIT_Y#"][!CommandMeasure msScript "setHEIGHT('mtFontHeight','FONT_HEIGHT')"][!SetOption mtContent Y #INIT_Y#][!UpdateMeter mtContent][!CommandMeasure msScript "setHEIGHT('mtContent','CONTENT_HEIGHT')"][!SetOption msMouse DynamicVariables 0][!UpdateMeasure msMouse][!SetOption mtVrtScrollBarButton Y "[mtHeader:YH]"][!SetOptionGroup grDynamicMeters DynamicVariables 0][!UpdateMeterGroup grDynamicMeters][!SetOption msAction_Toggle_ScrollBar DynamicVariables 0][!UpdateMeasure msAction_Toggle_ScrollBar][!Redraw]
Disabled=1

[msAction_LOCK_SKIN]
Measure=String
IfCondition=1=#LOCK_SKIN#
IfTrueAction=[!Draggable 0][!SetVariable MENU1 "Lock the skin [\x2714]"]
IfFalseAction=[!Draggable 1][!SetVariable MENU1 "Lock the skin"]
;;IfConditions | https://docs.rainmeter.net/manual/measures/general-options/ifconditions/

[msAction_Toggle_ScrollBar]
Measure=String
IfCondition=#CONTENT_HEIGHT#>[mtContentContainer:H]
IfTrueAction=[!EnableMouseAction mtContentContainer "MouseScrollDownAction|MouseScrollUpAction"][!ShowMeterGroup grScrollBar]
IfFalseAction=[!DisableMouseAction mtContentContainer "MouseScrollDownAction|MouseScrollUpAction"][!HideMeterGroup grScrollBar]
Disabled=1
;;EnableMouseAction | https://docs.rainmeter.net/manual/bangs/#EnableMouseAction

[msMouse]
Measure=Plugin
Plugin=Mouse
RelativeToSkin=1
RequireDragging=1
;;60=[mtBar:H]+[mtHeader:H]
LeftMouseDragAction=[!SetOption mtVrtScrollBarButton Y "(Clamp($MouseY$-#SCROLLBAR_BUTTON_HEIGHT#/2,60,#SKIN_HEIGHT#-#SCROLLBAR_BUTTON_HEIGHT#))"][!UpdateMeter mtVrtScrollBarButton][!Redraw]
LeftMouseUpAction=[!CommandMeasure #CURRENTSECTION# "Stop"][!SetVariable CRNT_Y "(Clamp(-((#CONTENT_HEIGHT#-[mtContentContainer:H])*(([mtVrtScrollBarButton:Y]-60)/([mtVrtScrollBarArea:H]-#SCROLLBAR_BUTTON_HEIGHT#))),(-(#CONTENT_HEIGHT#-[mtContentContainer:H])),#INIT_Y#))"][!SetOption mtContent Y [#CRNT_Y]][!UpdateMeter mtContent][!Redraw][!Delay 100][!EnableMouseAction mtVrtScrollBarArea "LeftMouseUpAction"]
;DynamicVariables=1
;;Mouse plugin | https://github.com/NighthawkSLO/Mouse.dll/wiki/Documentation

[stContent]
FontColor=000000DE
FontFace=#FONT_NAME#
FontSize=#FONT_SIZE#
FontWeight=#FONT_WEIGHT#

[mtFontHeight]
Meter=String
MeterStyle=stContent
Text=.
FontColor=00000000
Hidden=0

[mtBackground]
Meter=Image
W=#SKIN_WIDTH#
H=#SKIN_HEIGHT#
SolidColor=E1E2E1FF

[mtBar]
Meter=Image
W=[mtBackground:W]
H=20
Solidcolor=1C313AFF

[stButton]
AntiAlias=1
FontColor=FFFFFF99
FontFace=Segoe UI
FontSize=10
FontWeight=700
MouseActionCursor=1
MouseLeaveAction=[!SetOption #CURRENTSECTION# FontColor "FFFFFF99"][!UpdateMeter #CURRENTSECTION#][!Redraw]
MouseOverAction=[!SetOption #CURRENTSECTION# FontColor "FFFFFFDE"][!UpdateMeter #CURRENTSECTION#][!Redraw]
;;Mouse Actions | https://docs.rainmeter.net/manual/mouse-actions/

[mtURL]
Meter=String
MeterStyle=stButton
Text=#URL#
X=10
W=([mtBackground:W]-140)
LeftMouseUpAction=["#URL#"]
ToolTipText=#URL#
ClipString=1
;;Tooltips | https://docs.rainmeter.net/manual/meters/general-options/tooltips/

[mtButtonHeader]
Meter=String
MeterStyle=stButton
Text=Header
X=([mtBackground:W]-95)
W=50
StringAlign=Center
LeftMouseUpAction=[!SetVariable CURRENT_CONTENT "msResponseHeader"][!UpdateMeter mtContent][!UpdateMeasure msAction_UpdateContent]
;;StringAlign | https://docs.rainmeter.net/manual/meters/string/#StringAlign

[mtButtonBody]
Meter=String
MeterStyle=stButton
Text=Body
X=([mtBackground:W]-50-10+25)
W=50
StringAlign=Center
LeftMouseUpAction=[!SetVariable CURRENT_CONTENT "msResponseBody"][!UpdateMeter mtContent][!UpdateMeasure msAction_UpdateContent]

[mtHeader]
Meter=Image
X=0
Y=[mtBar:YH]
W=[mtBackground:W]
H=40
Solidcolor=445963FF

[mtHeaderTitle]
Meter=String
Text=RunCommand plugin & curl.exe
X=0
Y=0r
W=([mtBackground:W]-20)
AntiAlias=1
FontColor=FFFFFFDE
FontFace=Segoe UI
FontSize=20
Padding=10,0,10,0

[mtContentContainer]
Meter=Image
X=10
Y=([mtHeader:YH]+10)
W=([mtBackground:W]-20)
H=([mtBackground:H]-[mtHeader:YH]-20)
Group=grDynamicMeters
SolidColor=FFFFFFFF
MouseScrollDownAction=[!SetVariable CRNT_Y "(#CONTENT_HEIGHT#>[#CURRENTSECTION#:H]?(Clamp(([#CRNT_Y]-(#FONT_HEIGHT#*3)),(-(#CONTENT_HEIGHT#-[#CURRENTSECTION#:H])),#INIT_Y#)):#INIT_Y#)"][!SetOption mtContent Y [#CRNT_Y]][!UpdateMeter mtContent][!SetOption mtVrtScrollBarButton Y (#CONTENT_HEIGHT#<=[#CURRENTSECTION#:H]?[mtHeader:YH]:(60+([mtBackground:H]-[mtHeader:YH]-#SCROLLBAR_BUTTON_HEIGHT#)*(ABS([#CRNT_Y])/(#CONTENT_HEIGHT#-[#CURRENTSECTION#:H]))))][!UpdateMeter mtVrtScrollBarButton][!Redraw]
MouseScrollUpAction=[!SetVariable CRNT_Y "(#CONTENT_HEIGHT#>[#CURRENTSECTION#:H]?(Clamp(([#CRNT_Y]+(#FONT_HEIGHT#*3)),(-(#CONTENT_HEIGHT#-[#CURRENTSECTION#:H])),#INIT_Y#)):#INIT_Y#)"][!SetOption mtContent Y [#CRNT_Y]][!UpdateMeter mtContent][!SetOption mtVrtScrollBarButton Y (#CONTENT_HEIGHT#<=[#CURRENTSECTION#:H]?[mtHeader:YH]:(60+([mtBackground:H]-[mtHeader:YH]-#SCROLLBAR_BUTTON_HEIGHT#)*(ABS([#CRNT_Y])/(#CONTENT_HEIGHT#-[#CURRENTSECTION#:H]))))][!UpdateMeter mtVrtScrollBarButton][!Redraw]
;;Container | https://docs.rainmeter.net/manual/meters/general-options/container/

[mtContent]
Meter=String
MeterStyle=stContent
MeasureName=#CURRENT_CONTENT#
Y=#INIT_Y#
W=[mtContentContainer:W]
AntiAlias=1
Container=mtContentContainer
Group=grDynamicMeters
;;If ClipString=1 or 2, It can not get proper CONTENT_HEIGHT with huge strings. `function setHEIGHT(MeterName, VariableName)` always set variable 9985 or 9986.
ClipString=0
;;ClipString | https://docs.rainmeter.net/manual/meters/string/#ClipString
;;Wrapping Text | https://docs.rainmeter.net/tips/wrapping-text/

[mtVrtScrollBarArea]
Meter=Image
X=(#SKIN_WIDTH#-15)
Y=[mtHeader:YH]
W=15
H=(#SKIN_HEIGHT#-[mtHeader:YH])
Group=grScrollBar|grDynamicMeters
Hidden=1
SolidColor=FFFFFF33
LeftMouseDownAction=[]
LeftMouseUpAction=[!SetOption mtVrtScrollBarButton Y "(Clamp(60+$MouseY$-#SCROLLBAR_BUTTON_HEIGHT#/2,60,#SKIN_HEIGHT#-#SCROLLBAR_BUTTON_HEIGHT#))"][!UpdateMeter mtVrtScrollBarButton][!SetVariable CRNT_Y "(Clamp(-((#CONTENT_HEIGHT#-[mtContentContainer:H])*(([mtVrtScrollBarButton:Y]-60)/([mtVrtScrollBarArea:H]-#SCROLLBAR_BUTTON_HEIGHT#))),(-(#CONTENT_HEIGHT#-[mtContentContainer:H])),#INIT_Y#))"][!SetOption mtContent Y [#CRNT_Y]][!UpdateMeter mtContent][!Redraw]

[mtVrtScrollBarButton]
Meter=Image
X=(#SKIN_WIDTH#-14)
Y=[mtHeader:YH]
W=13
H=#SCROLLBAR_BUTTON_HEIGHT#
Group=grScrollBar|grDynamicMeters
Hidden=1
SolidColor=CDCDCDFF
LeftMouseDownAction=[!DisableMouseAction mtVrtScrollBarArea "LeftMouseUpAction"][!CommandMeasure msMouse "Start"]
;;Button Height is fixed.

[Rainmeter]
Update=-1
;DefaultUpdateDivider=-1
AccurateText=1
ContextTitle=URL [\x23F5]
ContextAction=[!SetVariable FP "#ROOTCONFIGPATH#@ContextMenus\URL.ini"]#ACT0#[!WriteKeyValue Variables VARIABLE_NAME "URL" "[#FP]"][!ActivateConfig "#ROOTCONFIG#\@ContextMenus" "URL.ini"]
ContextTitle2=User-Agent [\x23F5]
ContextAction2=[!SetVariable FP "#ROOTCONFIGPATH#@ContextMenus\UserAgent.ini"]#ACT0#[!WriteKeyValue Variables VARIABLE_NAME "USER_AGENT" "[#FP]"][!ActivateConfig "#ROOTCONFIG#\@ContextMenus" "UserAgent.ini"]
ContextTitle3=-
ContextAction3=[]
ContextTitle4=Font &Name [\x23F5]
ContextAction4=[!SetVariable FP "#ROOTCONFIGPATH#@ContextMenus\FontName.ini"]#ACT0#[!WriteKeyValue Variables VARIABLE_NAME "FONT_NAME" "[#FP]"][!WriteKeyValue Variables CURRENT_VALUE "#FONT_NAME#" "[#FP]"][!ActivateConfig "#ROOTCONFIG#\@ContextMenus" "FontName.ini"]
ContextTitle5=Font &Size [\x23F5]
ContextAction5=[!SetVariable FP "#ROOTCONFIGPATH#@ContextMenus\FontSize.ini"]#ACT0#[!WriteKeyValue Variables VARIABLE_NAME "FONT_SIZE" "[#FP]"][!WriteKeyValue Variables CURRENT_VALUE "#FONT_SIZE#" "[#FP]"][!ActivateConfig "#ROOTCONFIG#\@ContextMenus" "FontSize.ini"]
ContextTitle6=Font &Weight [\x23F5]
ContextAction6=[!SetVariable FP "#ROOTCONFIGPATH#@ContextMenus\FontWeight.ini"]#ACT0#[!WriteKeyValue Variables VARIABLE_NAME "FONT_WEIGHT" "[#FP]"][!WriteKeyValue Variables CURRENT_VALUE "#FONT_WEIGHT#" "[#FP]"][!ActivateConfig "#ROOTCONFIG#\@ContextMenus" "FontWeight.ini"]
ContextTitle7=-
ContextAction7=[]
ContextTitle8=300 x 200
ContextAction8=[!WriteKeyValue Variables SKIN_WIDTH 300][!WriteKeyValue Variables SKIN_HEIGHT 200][!Refresh]
ContextTitle9=480 x 320
ContextAction9=[!WriteKeyValue Variables SKIN_WIDTH 480][!WriteKeyValue Variables SKIN_HEIGHT 320][!Refresh]
ContextTitle10=600 x 400
ContextAction10=[!WriteKeyValue Variables SKIN_WIDTH 600][!WriteKeyValue Variables SKIN_HEIGHT 400][!Refresh]
ContextTitle11=960 x 640
ContextAction11=[!WriteKeyValue Variables SKIN_WIDTH 960][!WriteKeyValue Variables SKIN_HEIGHT 640][!Refresh]
ContextTitle12=1200 x 800
ContextAction12=[!WriteKeyValue Variables SKIN_WIDTH 1200][!WriteKeyValue Variables SKIN_HEIGHT 800][!Refresh]
ContextTitle13=-
ContextAction13=[]
ContextTitle14=&Copy to clipboard
ContextAction14=[!SetClip [#CURRENT_CONTENT#]]
ContextTitle15=#MENU1#
ContextAction15=[!WriteKeyValue Variables LOCK_SKIN (1-#LOCK_SKIN#)][!SetVariable LOCK_SKIN (1-#LOCK_SKIN#)][!SetOption msAction_LOCK_SKIN DynamicVariables 0][!UpdateMeasure msAction_LOCK_SKIN]
ContextTitle16=-
ContextAction16=[]
ContextTitle17=Skin menu...
ContextAction17=[!SkinMenu]
ContextTitle18=&Edit skin
ContextAction18=[!EditSkin]
ContextTitle19=&Refresh skin
ContextAction19=[!Refresh]
ContextTitle20=&Unload skin
ContextAction20=[!DeactivateConfig]
RightMouseUpAction=[!SkinCustomMenu]
MouseActionCursor=0
OnRefreshAction=[!CommandMeasure msRunCommand "Run"]
;;Context options | https://docs.rainmeter.net/manual/skins/rainmeter-section/#Context
;;OnRefreshAction | https://docs.rainmeter.net/manual/skins/rainmeter-section/#OnRefreshAction

[Metadata]
Name=RunCommand+curl
Author=https://github.com/nek7u
Version=20210308
License=Feel free to copy and use these codes.
Information=Displays HTTP response headers and response body.|Testing a possibility of RunCommand Plugin + curl.exe.|Requires Windows 10 1803 or later, Rainmeter4.3 or later.
;;Scrolling Text in a Container by jsmorley | https://forum.rainmeter.net/viewtopic.php?t=31531
;;Advanced context menus by jsmorley | https://forum.rainmeter.net/viewtopic.php?t=20050
;;Mouse.dll plugin by NighthawkSLO | https://github.com/NighthawkSLO/Mouse.dll
;;Color Tool by Material Design | https://material.io/resources/color/

RunCommand.curl.lua

Code: Select all

--20210220
--UTF-16LE BOM / UCS-2 LE BOM

function setHEIGHT(MeterName, VariableName)
	local m = SKIN:GetMeter(MeterName)
	SKIN:Bang('!SetVariable', VariableName, (nil~=m and m:GetH() or 0))
end
Download:
RunCommand+curl_20210308.rmskin (120 KB, github.com)
SHA256 a78ecceb5bc5c9ed2ab06fba6793472600217a781960bddc8b9ff7990fe29fd8

Credits: