It is currently April 19th, 2024, 3:46 pm

cmdWrapper & Scroller

Share and get help with Plugins and Addons
RedK
Posts: 12
Joined: March 18th, 2012, 10:28 pm

cmdWrapper & Scroller

Post by RedK »

cmdWrapper

UPDATE 2

Latest version: 0.5.5.0

Description:
cmdWrapper - can get console output text directly into your skin. Plugin can launch processes and capture console output from them. Additionally it can: send input to those processes, kill them, slightly manage the way how output text will be shown.

Notes:
-After you launch process and till it works, all further input (what you send to plugin) will be treated as input to that process.
-If you launch program that has GUI, plugin won't capture console IO from it, and you are free to launch another program, or even close rainmeter, the program will stay.
-Plugin on exit won't automatically close process that working in it. (there is a !bang for this).
-You can get output Text from plugin via using it as variable. (Text=[cmdWrapper_Measure_Name]);

Plugin variables: (currently all variables have default values and not required to be set at plugin start)
pureCMD (Type: string. Accepted values: "true", "false". If true, when start of a new process occurs, "cmd.exe" will start instead. Def value: "false");
LinesToShow (Type: number. Accepted values: 1-100. Determines how much text lines of output will be showed in Meter. Take notice that possible Meter text wrapping capabilities are not taken into account. Note: all lines are stored inside plugin till it quits, or "cls" !bang was received. Def value: 10);
IdleMessage (Type: string. Message that will be shown on process exit. Def value "");

Bangs: Must be send as !CommandMeasure cmdWrapper_Measure_Name "bang"
"Execute File_Name Arguments" - Launch process with selected file name and arguments. Example: !CommandMeasure cmdWrapper_Measure_Name "execute cmd ping localhost"
"KillEmAll" - Kill working process and all his children's.

Commands: Must be send as !CommandMeasure cmdWrapper_Measure_Name "Execute command"
"cls" - Clear all received lines in plugin memory.
"debug" - show some variables...

cmdWrapper skin example:
[Rainmeter]
BackgroundMode=2

[Variables]
varWidth=655
varHeight=829
varTextInputHeight=20

[Frame]
Meter=Image
SolidColor=2e2d2d
W=#varWidth#
H=#varHeight#

[Background]
Meter=Image
SolidColor=000000
X=2
Y=22
W=(#varWidth#-4)
H=(#varHeight#-24)
LeftMouseDownAction=!CommandMeasure cmdInput "ExecuteBatch 1"
MiddleMouseDownAction=!CommandMeasure cmdWrapper KillEmALL

[Header]
Meter=STRING
X=2
Y=2
H=20
FontFace=Consolas
FontColor=00F0FF
FontSize=10
AntiAlias=1
ToolTipType=1
ToolTipIcon=INFO
ToolTipTitle="Help:"
ToolTipText="Apply to black space below:#CRLF#Left mouse click - Enable text input.#CRLF#Middle mouse click - Kill current running program, and all its child threads."
Text="cmdWrapper output:"

[CloseButton]
Meter=Image
ImageName=exit.png
AntiAlias=1
X=(#varWidth#-20)
Y=2
W=18
H=18
ToolTipType=1
ToolTipIcon=WARNING
ToolTipTitle="WARNING:"
ToolTipText="This button will deactivate this skin.#CRLF#Processes, that was launched by this skin won't be closed...#CRLF#may cause Rainmeter to crash (unlikely btw)"
LeftMouseDownAction=!DeactivateConfig #CURRENTCONFIG#

[cmdWrapper]
Measure=Plugin
Plugin=cmdWrapper
IdleMessage="->End Of Line"
LinesToShow=35

[cmdOutputText]
Meter=STRING
MeasureName=cmdWrapper
FontColor=25ed13
FontFace=Consolas
FontSize=12
X=5
Y=25
W=(#varWidth#-10)
H=(#varHeight#-30)
ClipString=1

[cmdInput]
Measure=Plugin
Plugin=InputText
SolidColor=000000
FontColor=25ed13
FontFace=Consolas
FontSize=12
X=2
Y=807
W=651
H=#varTextInputHeight#
FocusDismiss=1
Command1=!CommandMeasure "cmdWrapper" "execute $UserInput$" #CURRENTCONFIG#
cmdWrapper.rmskin
CmdWrapperTest.zip
Scroller

UPDATE 1

Latest version: 0.8.2.0

Description:
Scroller - plugin for rainmeter. When enabled, can capture global mouse wheel movement and increment/decrement #number# on specific amount, depending on mouse wheel scroll direction.

Note:
Theoretically plugin can be recognized by anti vius software as "Keylogger".
#number# - numeric variable that is stored inside plugin and get incremented/decremented on occasion.

Plugin variables: (currently all variables have default values and not required to be set at plugin start)
DefaultValue (Type: number. Starting value of a number that will be stored inside and be incremented or decremented; Def value: 0);
MinValue (Type: number. Minimum value of a #number#. Decrementation won't occur if number reached this or lover value. Def value: 0);
MaxValue (Type: number. Maximum value of a #number#. Incrementation won't occur after #number# reached this or higher value. Def value: 100);
Step (Type: number. On how much number will be incremented or decremented when mouse wheel movement was detected. Def value: 1);
LoopValue (Type: string. Accepted values: "true", "false". If true - after #number# reached it's minValue and decrement occur, #number# will be set to maxValue and vice versa. false - just stop at min/maxVale. Def value: "false");
Invert (Type: string. Accepted values: "true", "false". Reverse plugin reaction on mouse wheel scroll. Def value: false);
Enable (Type: string. Accepted values: "true", "false". If true - plugin start capruring global mouse events and proces them depending on other options. false - stop capture. Def value: false);

Bangs:
"setVariable #number#" - Will set number inside plugin to this #number#; !CommandMeasure scroller_Measuer_Name "setVariable 15"
"resetVariable" - Wll reset number inside plugin to DefaultValue currently set as option; !CommandMeasure scroller_Measuer_Name "resetVariable"

Scroller skin example:
[Rainmeter]
;Frequent update time needed for smooth Font Size change.
Update=10

[Scroller]
Measure=Plugin
Plugin=Scroller
DefaultValue=12
MinValue=8
MaxValue=40

[Background]
Meter=Image
SolidColor=0,0,0,1
W=300
H=70
MouseOverAction=!Execute [!SetOption Scroller Enable "true"]
MouseLeaveAction=!Execute [!SetOption Scroller Enable "false"]

[Text]
Meter=STRING
FontColor=00F0FF
FontSize=[Scroller]
AntiAlias=1
Text="Scroll me!"
DynamicVariables=1
cmdWrapper skin example with scroller:
[Rainmeter]
BackgroundMode=2

[Variables]
varWidth=655
varHeight=829
varTextInputHeight=20

[Frame]
Meter=Image
SolidColor=2e2d2d
W=#varWidth#
H=#varHeight#
MiddleMouseDownAction=!CommandMeasure Scroller debug

[Background]
Meter=Image
SolidColor=000000
X=2
Y=22
W=(#varWidth#-4)
H=(#varHeight#-24)
LeftMouseDownAction=!CommandMeasure cmdInput "ExecuteBatch 1"
MiddleMouseDownAction=!CommandMeasure cmdWrapper KillEmALL
MouseOverAction=!Execute [!SetOption Scroller Enable "true"] [!UpdateMeasure Scroller #CURRENTCONFIG#]
MouseLeaveAction=!Execute [!SetOption Scroller Enable "false"] [!UpdateMeasure Scroller #CURRENTCONFIG#]

[Header]
Meter=STRING
X=2
Y=2
H=20
FontFace=Consolas
FontColor=00F0FF
FontSize=10
AntiAlias=1
ToolTipType=1
ToolTipIcon=INFO
ToolTipTitle="Help:"
ToolTipText="Apply to black space below:#CRLF#Left mouse click - Enable text input.#CRLF#Middle mouse click - Kill current running program, and all its child threads."
Text="Terminal window:"

[CloseButton]
Meter=Image
ImageName=exit.png
AntiAlias=1
X=(#varWidth#-20)
Y=2
W=18
H=18
ToolTipType=1
ToolTipIcon=WARNING
ToolTipTitle="WARNING:"
ToolTipText="This button will deactivate this skin.#CRLF#Processes, that was launched by this skin won't be closed...#CRLF#may cause Rainmeter to crash (unlikely btw)"
LeftMouseDownAction=!DeactivateConfig #CURRENTCONFIG#

[Scroller]
Measure=Plugin
Plugin=Scroller
OutputMeasureName=cmdWrapper
OutputMeasureOption=ScrollModificator
DefaultValue=0
MinValue=0
MaxValue=150
Step=1

[cmdWrapper]
Measure=Plugin
Plugin=cmdWrapper
IdleMessage="->End Of Line"
LinesToShow=35

[cmdOutputText]
Meter=STRING
MeasureName=cmdWrapper
FontColor=25ed13
FontFace=Consolas
FontSize=12
X=5
Y=25
W=(#varWidth#-10)
H=(#varHeight#-30)
ClipString=1

[cmdInput]
Measure=Plugin
Plugin=InputText
SolidColor=000000
FontColor=25ed13
FontFace=Consolas
FontSize=12
X=2
Y=807
W=651
H=#varTextInputHeight#
FocusDismiss=1
Command1=!CommandMeasure "cmdWrapper" "execute $UserInput$" #CURRENTCONFIG#
Scroller.rmskin
P.S.
I hope someone can find those plugins useful. Plugins was developed and tested under Windows 7 x64. Ability to work in other OS was not confirmed.
And of course: You install and use those plugins at your own risk. I do not take any responsibility for any harm they may do to any kind of your property. (not that i'm implying they can do any)

P.P.S.
If you have any: questions, suggestions, bug reports, complaints about my English. Feel free to post them here.
You do not have the required permissions to view the files attached to this post.
Last edited by RedK on May 29th, 2012, 10:59 am, edited 2 times in total.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: cmdWrapper & Scroller

Post by jsmorley »

Interesting work. Glad to see some more plugin authors getting in the mix. The only thing I would suggest is that you compile and include both 32bit and 64bit versions. That will make it available to a lot more users, as there are still quite a few folks who are running 32bit.
poiru
Developer
Posts: 2872
Joined: April 17th, 2009, 12:18 pm

Re: cmdWrapper & Scroller

Post by poiru »

Don't use !SetOption [OutputMeasureName] Text [answer string] in the plugin. Instead, return the value in GetString().

Using bangs in a plugin to set the value of a STRING meter is not consistent other measures/plugins. None of the other plugins use anything similar to OutputMeasureName (which, by the way, should be OutputStringMeterName). You cannot use Substitute= with this method, for example.
RedK
Posts: 12
Joined: March 18th, 2012, 10:28 pm

Re: cmdWrapper & Scroller

Post by RedK »

jsmorley wrote:Interesting work. Glad to see some more plugin authors getting in the mix. The only thing I would suggest is that you compile and include both 32bit and 64bit versions. That will make it available to a lot more users, as there are still quite a few folks who are running 32bit.
Done and wrapped in .rmskin. Although I currently don't have 32bit OS to test if plugins work properly on them.
poiru wrote:Don't use !SetOption [OutputMeasureName] Text [answer string] in the plugin. Instead, return the value in GetString().

Using bangs in a plugin to set the value of a STRING meter is not consistent other measures/plugins. None of the other plugins use anything similar to OutputMeasureName (which, by the way, should be OutputStringMeterName). You cannot use Substitute= with this method, for example.
I think i understand you, and why this is a bad thing. So, now i will just remove this option from plugin description and examples (if yo don't set this option, no bang occur) and in future i will remove it from code itself. btw cmdWrapper does return value via GetString();
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: cmdWrapper & Scroller

Post by KreAch3R »

Hello,

Thank you for your plugins! I am currently inserting Scroller into a skin, and I think an "inverted" scrolling would be a nice feature addition. By "inverted", I mean that when the user scrolls down, the number goes up.

Would that be easy to implement?
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
RedK
Posts: 12
Joined: March 18th, 2012, 10:28 pm

Re: cmdWrapper & Scroller

Post by RedK »

KreAch3R wrote:Hello,

Thank you for your plugins! I am currently inserting Scroller into a skin, and I think an "inverted" scrolling would be a nice feature addition. By "inverted", I mean that when the user scrolls down, the number goes up.

Would that be easy to implement?
I'm glad my plugin can be useful to someone. "inverted" option could be implemented pretty easily, I will do this somewhere near the end of the week. Thanks for the idea.
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: cmdWrapper & Scroller

Post by KreAch3R »

RedK wrote: I'm glad my plugin can be useful to someone. "inverted" option could be implemented pretty easily, I will do this somewhere near the end of the week. Thanks for the idea.
They are very good, I am suprised I haven't seen a lot of skins popping out based on them, yet. :) I'm looking forward to the inverted option. No worries about the time frame.
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
RedK
Posts: 12
Joined: March 18th, 2012, 10:28 pm

Re: cmdWrapper & Scroller

Post by RedK »

KreAch3R wrote: They are very good, I am suprised I haven't seen a lot of skins popping out based on them, yet. :) I'm looking forward to the inverted option. No worries about the time frame.
Done. Added "Invert" option to Scroller plugin.
User avatar
KreAch3R
Posts: 608
Joined: February 7th, 2011, 7:27 pm
Location: Thessaloniki, GR

Re: cmdWrapper & Scroller

Post by KreAch3R »

RedK wrote:
Done. Added "Invert" option to Scroller plugin.
Thank you! Worked without any hiccups. Update the first post information, when you find the time, too. :) I had to guess that Invert=TRUE was the way to go. :P
Inactive, due to life changes. Send me a PM for any question.

Desktop DeviartArt
Image
Skymil
Posts: 24
Joined: July 19th, 2011, 9:44 am
Location: France

Re: cmdWrapper & Scroller

Post by Skymil »

Thank you for your plugin! Thanks to it, I have realised a scrollbar in my skin (and I used the "Invert" option, thank you KreAch3R :P).