And we just went from 0 ways of doing something to more than one way of doing it in no time. The beauty of open source modular design...jsmorley wrote: ↑March 3rd, 2020, 11:16 pm Or...
https://forum.rainmeter.net/viewtopic.php?f=128&t=21785#p115480
It is currently April 26th, 2024, 5:51 pm
Help with Hiding/Showing Skin with Active Opened Program
-
- Rainmeter Sage
- Posts: 7172
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Help with Hiding/Showing Skin with Active Opened Program
-
- Posts: 6
- Joined: March 2nd, 2020, 6:26 am
Re: Help with Hiding/Showing Skin with Active Opened Program
Ah man im can't get it to work can someone input that new code to make it work for me, i did install the powershellRM
here is modified code that worked but is missing the code for window in focus function...
thank you
here is modified code that worked but is missing the code for window in focus function...
Code: Select all
[MeasureProcess]
Measure=Plugin
Plugin=Process
ProcessName="Adobe Premiere Pro.exe"
IfAboveValue=0
IfAboveAction=[!Show][!Delay 1000][!ZPos "1"][!Delay 1000][!Move "1460" "1155"]
IfBelowValue=0
IfBelowAction=[!Move "3089" "2045"][!Delay 1000][!ZPos "-1"]
[Rainmeter]
Update=1000
Group=EdgeSys
BackgroundMode=1
BackgroundMargins=30,10,10,10
ContextAction=[!ActivateConfig "#ROOTCONFIG#\Settings" "Settings.ini"]
ContextTitle=Open Settings panel
LeftMouseDoubleClickAction=[!ActivateConfig "#ROOTCONFIG#\Local Machine\CPU\Usage" "Normal.ini"]
OnRefreshAction=[!FadeDuration "100"]
[Metadata]
Name=CPU Usage
Author=Saber Akiyama
Information=Displays CPU Usage
License=Creative Commons BY-NC-SA 4.0 International
Version=3.0.1
[Variables]
@include=#@#Measures\CPU.inc
@include2=#@#String Styles.inc
@include3=#@#Variables.inc
@include4=#@#HWiNFO.inc
[mLabelCPU]
Meter=String
MeterStyle=SysLeftText
X=25
Y=20
DynamicVariables=1
SolidColor=0,0,0,1
Text=CPU Usage
ToolTipTitle=CPU Name
ToolTipType=1
ToolTipIcon=Info
ToolTipText="Driver Name: [CPUName]"
[mPercent]
Meter=String
MeterStyle=SysRightText
MeasureName=CPUUsgValue
MeasureName2=CPUUsgUnits
X=200r
Y=0r
NumOfDecimals=2
LeftMouseUpAction=["taskmgr.exe"]
Percentual=1
SolidColor=0,0,0,1
Text="%1%2"
ToolTipText=Open Task Manager
[mTopCPU]
Meter=String
MeterStyle=SysLeftText
MeasureName=mTopProc
X=15
Y=41r
W=265
Text="Top: %1"
[mBarCPU]
Meter=Bar
MeterStyle=SysBar
MeasureName=CPUUsgValue
TransformationMatrix=-1; 0; -1; 1; 15; 0
X=-237
Y=37
W=180
H=13
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 7172
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Help with Hiding/Showing Skin with Active Opened Program
bukashka59 wrote: ↑March 5th, 2020, 5:44 pm Ah man im can't get it to work can someone input that new code to make it work for me, i did install the powershellRM
here is modified code that worked but is missing the code for window in focus function...
thank you
So, Jeff, it's your turn to help now - it's your discovery...Jeff wrote: ↑March 3rd, 2020, 7:36 pmthis but you addto [FGWindow] and on the Process measure you just addCode: Select all
IfMatch = The Window Name IfMatchAction = !SetVariable Active 1 IfNotMatchAction = !SetVariable Active 0
you can probably modify the powershell lines to do both but idk right now how to, but that's how you get if the window is active/in focus and running :PCode: Select all
DynamicVariables=1 IfCondition = (#CURRENTSECTION# = 1) && (#Active# = 1) IfTrueAction = ... IfFalseAction = ...
-
- Rainmeter Sage
- Posts: 16173
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Help with Hiding/Showing Skin with Active Opened Program
I don't have installed Adobe Premiere Pro, so when I load the skin of your code, I always get executed the bangs of the IfBelowAction of the [MeasureProcess] measure. This in my case is somehow improper, moving the skin outside of my screen. Its horizontal resolution is smaller than 3089 pixels, so with the above used values, I got the skin moved outside of my screen. So, I had to rewrite the above values. Make sure in your case these values are correct and your screen has higher resolution then 3089 x 2045 pixels, to get kept the skin on screen.bukashka59 wrote: ↑March 5th, 2020, 5:44 pm Ah man im can't get it to work can someone input that new code to make it work for me, i did install the powershellRM
here is modified code that worked but is missing the code for window in focus function...Code: Select all
[MeasureProcess] Measure=Plugin Plugin=Process ProcessName="Adobe Premiere Pro.exe" IfAboveValue=0 IfAboveAction=[!Show][!Delay 1000][!ZPos "1"][!Delay 1000][!Move "1460" "1155"] IfBelowValue=0 IfBelowAction=[!Move "3089" "2045"][!Delay 1000][!ZPos "-1"]
Otherwise I'm not sure I do understand what the
does mean. Could you please give us a few details on what doesn't work? Do you see the skin on screen? If so, what do you see? What the skin does?
-
- Posts: 6
- Joined: March 2nd, 2020, 6:26 am
Re: Help with Hiding/Showing Skin with Active Opened Program
Hi again, the skin is not hiding when other windows other then premiere pro are open and are in focus. Im not a programmer and have no idea where i should stick that new piece of code that you guys gave me, plus there is the ... don't know what to put in there.....
Code: Select all
[MeasureProcess]
Measure=Plugin
Plugin=Process
ProcessName="Adobe Premiere Pro.exe"
IfAboveValue=0
IfAboveAction=[!Show][!Delay 1000][!ZPos "1"][!Delay 1000][!Move "1460" "1155"]
IfBelowValue=0
IfBelowAction=[!Move "3089" "2045"][!Delay 1000][!ZPos "-1"]
DynamicVariables=1
IfCondition = (#CURRENTSECTION# = 1) && (#Active# = 1)
IfTrueAction = ...
IfFalseAction = ...
[FGWindow]
IfMatch = Adobe Premiere Pro.exe
IfMatchAction = !SetVariable Active 1
IfNotMatchAction = !SetVariable Active 0
[Rainmeter]
Update=1000
Group=EdgeSys
BackgroundMode=1
BackgroundMargins=30,10,10,10
ContextAction=[!ActivateConfig "#ROOTCONFIG#\Settings" "Settings.ini"]
ContextTitle=Open Settings panel
LeftMouseDoubleClickAction=[!ActivateConfig "#ROOTCONFIG#\Local Machine\CPU\Usage" "Normal.ini"]
OnRefreshAction=[!FadeDuration "100"]
[Metadata]
Name=CPU Usage
Author=Saber Akiyama
Information=Displays CPU Usage
License=Creative Commons BY-NC-SA 4.0 International
Version=3.0.1
[Variables]
@include=#@#Measures\CPU.inc
@include2=#@#String Styles.inc
@include3=#@#Variables.inc
@include4=#@#HWiNFO.inc
[mLabelCPU]
Meter=String
MeterStyle=SysLeftText
X=25
Y=20
DynamicVariables=1
SolidColor=0,0,0,1
Text=CPU Usage
ToolTipTitle=CPU Name
ToolTipType=1
ToolTipIcon=Info
ToolTipText="Driver Name: [CPUName]"
[mPercent]
Meter=String
MeterStyle=SysRightText
MeasureName=CPUUsgValue
MeasureName2=CPUUsgUnits
X=200r
Y=0r
NumOfDecimals=2
LeftMouseUpAction=["taskmgr.exe"]
Percentual=1
SolidColor=0,0,0,1
Text="%1%2"
ToolTipText=Open Task Manager
[mTopCPU]
Meter=String
MeterStyle=SysLeftText
MeasureName=mTopProc
X=15
Y=41r
W=265
Text="Top: %1"
[mBarCPU]
Meter=Bar
MeterStyle=SysBar
MeasureName=CPUUsgValue
TransformationMatrix=-1; 0; -1; 1; 15; 0
X=-237
Y=37
W=180
H=13
DynamicVariables=1
-
- Rainmeter Sage
- Posts: 16173
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Help with Hiding/Showing Skin with Active Opened Program
But it doesn't even have to. What it does is to check if the program is running and if it does, the skin is shown (through the !Show bang of the IfAboveAction option) and moved to the 1460, 1155 position, while if it doesn't, nothing is hidden (there is no a !Hide bang in the IfBelow Action option), but the skin is moved to the 3089, 2045 position (quite right and down). I suppose that maybe a !Hide bang is missing from this last IfBelowAction option, but I'm not sure about your intention.bukashka59 wrote: ↑March 6th, 2020, 6:07 pm Hi again, the skin is not hiding when other windows other then premiere pro are open.
On the other hand, this code as it is written, can't check and doesn't even care too much, what other windows are open or what other programs are running. The [MeasureProcess] measure checks only the status of Adobe Premiere Pro. Would you like to hide the skin when other programs are running? Which one, because the code can't check if ANY other program is running? This is quite hard to be achieved, or even more, it probably can't be. I don't see a way to check if any unnamed program is running, not talking that in Windows probably always is running some programs, so there is no way to not have programs opened. So, I'm not sure what to recommend in this point...
-
- Rainmeter Sage
- Posts: 7172
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Help with Hiding/Showing Skin with Active Opened Program
No, balala, the OP wants to implement Jeff's solution, using the PowershellRM plugin ... and he doesn't know how to do it. I'm in the process of trying just that, but I'll have to see how it works first.balala wrote: ↑March 6th, 2020, 6:27 pm But it doesn't even have to. What it does is to check if the program is running and if it does, the skin is shown (through the !Show bang of the IfAboveAction option) and moved to the 1460, 1155 position, while if it doesn't, nothing is hidden (there is no a !Hide bang in the IfBelow Action option), but the skin is moved to the 3089, 2045 position (quite right and down). I suppose that maybe a !Hide bang is missing from this last IfBelowAction option, but I'm not sure about your intention.
On the other hand, this code as it is written, can't check and doesn't even care too much, what other windows are open or what other programs are running. The [MeasureProcess] measure checks only the status of Adobe Premiere Pro. Would you like to hide the skin when other programs are running? Which one, because the code can't check if ANY other program is running? This is quite hard to be achieved, or even more, it probably can't be. I don't see a way to check if any unnamed program is running, not talking that in Windows probably always is running some programs, so there is no way to not have programs opened. So, I'm not sure what to recommend in this point...
-
- Rainmeter Sage
- Posts: 16173
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Help with Hiding/Showing Skin with Active Opened Program
Oh, sorry. Was not careful enough, it seems.Yincognito wrote: ↑March 6th, 2020, 6:44 pm No, balala, the OP wants to implement Jeff's solution, using the PowershellRM plugin ... and he doesn't know how to do it. I'm in the process of trying just that, but I'll have to see how it works first.
Ok go ahead and try help him, in this case.
-
- Rainmeter Sage
- Posts: 7172
- Joined: February 27th, 2015, 2:38 pm
- Location: Terra Yincognita
Re: Help with Hiding/Showing Skin with Active Opened Program
Ok, so this is what you should do:bukashka59 wrote: ↑March 6th, 2020, 6:07 pmHi again, the skin is not hiding when other windows other then premiere pro are open and are in focus. Im not a programmer and have no idea where i should stick that new piece of code that you guys gave me, plus there is the ... don't know what to put in there.....
1. Go here and download PowershellRM_0.6.0.rmskin, then install the skin into your Rainmeter, but uncheck PowerShellRMExample in the "Rainmeter Skin Installer" window, in order to only install the plugin's DLL files, without the sample skin in the download (you should know how to do this by now, right?)
2. Now replace your code with this (make sure you remember the values that you want for the movement, because I didn't use your last posted code when writing the code below):
Code: Select all
[Variables]
Active=0
[GetFunc]
Measure = Plugin
Plugin = PowershellRM
Line = Add-Type @"
Line2 = using System;
Line3 = using System.Runtime.InteropServices;
Line4 = public class USER32 {
Line5 = [DllImport("user32.dll")]
Line6 = public static extern IntPtr GetForegroundWindow();
Line7 = }
Line8 = "@
UpdateDivider = -1
[FGWindow]
Measure = Plugin
Plugin = PowershellRM
Parent = GetFunc
Line = $proc = Get-Process | ? { $_.MainWindowHandle -eq [USER32]::GetForegroundWindow() }
Line2 = $proc.ProcessName
IfMatch=^notepad$
IfMatchAction=[!SetVariable Active 1]
IfNotMatchAction=[!SetVariable Active 0]
[MeasureProcess]
Measure=Plugin
Plugin=Process
ProcessName="notepad.exe"
IfCondition=(#CURRENTSECTION#=1) && (#Active#=1)
IfTrueAction=[!Show][!Delay 1000][!ZPos "1"][!Delay 1000][!Move "100" "100"]
IfFalseAction=[!Move "50" "50"][!Delay 1000][!ZPos "-1"][!Delay 1000][!Hide]
DynamicVariables=1
[Rainmeter]
Update=1000
Group=EdgeSys
BackgroundMode=1
BackgroundMargins=30,10,10,10
ContextAction=[!ActivateConfig "#ROOTCONFIG#\Settings" "Settings.ini"]
ContextTitle=Open Settings panel
LeftMouseDoubleClickAction=[!ActivateConfig "#ROOTCONFIG#\Local Machine\CPU\Usage" "Normal.ini"]
OnRefreshAction=[!FadeDuration "100"]
[Metadata]
Name=CPU Usage
Author=Saber Akiyama
Information=Displays CPU Usage
License=Creative Commons BY-NC-SA 4.0 International
Version=3.0.1
[Variables]
@include=#@#Measures\CPU.inc
@include2=#@#String Styles.inc
@include3=#@#Variables.inc
@include4=#@#HWiNFO.inc
[mBackground]
Meter=Shape
Shape=Rectangle 0.5,0.5,(300-1),(100-1) | Fill Color 67,67,67,255 | Stroke Color 188,185,178,255 | StrokeWidth 1
DynamicVariables=1
[mLabelCPU]
Meter=String
MeterStyle=SysLeftText
X=25
Y=20
DynamicVariables=1
SolidColor=0,0,0,1
Text=CPU Usage
ToolTipTitle=CPU Name
ToolTipType=1
ToolTipIcon=Info
ToolTipText="Driver Name: [CPUName]"
[mPercent]
Meter=String
MeterStyle=SysRightText
MeasureName=CPUUsgValue
MeasureName2=CPUUsgUnits
X=200r
Y=0r
NumOfDecimals=2
LeftMouseUpAction=["taskmgr.exe"]
Percentual=1
SolidColor=0,0,0,1
Text="%1%2"
ToolTipText=Open Task Manager
[mTopCPU]
Meter=String
MeterStyle=SysLeftText
MeasureName=mTopProc
X=15
Y=48r
W=265
Text="Top: %1"
[mBarCPU]
Meter=Bar
MeterStyle=SysBar
MeasureName=CPUUsgValue
TransformationMatrix=-1; 0; -1; 1; 15; 0
X=-250
Y=37
W=200
H=15
DynamicVariables=1
In other words, just like when I posted the last time, you'd have to adapt the code to your needs. This shouldn't be too hard, considering you did just fine last time when we went down this road.
-
- Posts: 6
- Joined: March 2nd, 2020, 6:26 am
Re: Help with Hiding/Showing Skin with Active Opened Program
again thank you Yincongnito, ive tried to use what you gave me, unfortunately makes my system a bit unresponsive and looking at taskmanager rainmeter goes to 3.5% ofcpu use... and thats 18core &4.5ghz..... also it doesnt show any values for cpu usage or top program thats using that cpu....as well as made all texts black.....
Seems like its not the best way to go about this as its taking too much of the resources...
Seems like its not the best way to go about this as its taking too much of the resources...