DonationCoder.com Software > Post New Requests Here
Dim inactive monitor after x seconds
Coeluh:
I've got a 2screen desktop setup here: One primary display and a secondary. Sometimes when I watch a movie on primary I want to not turn off my secondary monitor but I want to dim it. Sometimes something important happens on the secondary screen and then the primary can be dimmed. Could there be some inactivity delay, based on mouse movements on a dispay and the possibility to select which monitors it affects? Dim screen partially does this, but I'm no coding experd.
Coeluh:
The time should be configurable 2 too and also the level of transparency and the time it fades...
skrommel:
:) Test this script for me, I'm single monitor at the moment.
It only shows the level of inactivity of the monitors.
Skrommel
--- ---monitor1limit=60
monitor2limit=60
#SingleInstance,Force
#NoEnv
#Persistent,On
CoordMode,Mouse,Screen
SysGet,monitorcount,MonitorCount
Loop,% monitorcount
{
SysGet,monitor%A_Index%,Monitor,%A_Index%
monitor%A_Index%idle=0
}
SetTimer,CHECK,1000
Return
CHECK:
times=
MouseGetPos,mx,my,mwin,mctrl
Loop,% monitorcount
{
If A_TimeIdlePhysical>1000
monitor%A_Index%idle+=1
Else
If (mx>=monitor%A_Index%Left And mx<=monitor%A_Index%Right And my>=monitor%A_Index%Top And my<=monitor%A_Index%Bottom)
monitor%A_Index%idle=0
times.=A_Index "=" monitor%A_Index%idle "`n"
If (monitor%A_Index%idle>monitor%A_Index%limit And monitor%A_Index%limit>0)
GoSub,DIM
}
ToolTip,% times
Return
DIM:
MsgBox,DIM!
Return
Coeluh:
:) Test this script for me, I'm single monitor at the moment.
It only shows the level of inactivity of the monitors.
Skrommel
--- ---monitor1limit=60
monitor2limit=60
#SingleInstance,Force
#NoEnv
#Persistent,On
CoordMode,Mouse,Screen
SysGet,monitorcount,MonitorCount
Loop,% monitorcount
{
SysGet,monitor%A_Index%,Monitor,%A_Index%
monitor%A_Index%idle=0
}
SetTimer,CHECK,1000
Return
CHECK:
times=
MouseGetPos,mx,my,mwin,mctrl
Loop,% monitorcount
{
If A_TimeIdlePhysical>1000
monitor%A_Index%idle+=1
Else
If (mx>=monitor%A_Index%Left And mx<=monitor%A_Index%Right And my>=monitor%A_Index%Top And my<=monitor%A_Index%Bottom)
monitor%A_Index%idle=0
times.=A_Index "=" monitor%A_Index%idle "`n"
If (monitor%A_Index%idle>monitor%A_Index%limit And monitor%A_Index%limit>0)
GoSub,DIM
}
ToolTip,% times
Return
DIM:
MsgBox,DIM!
Return
-skrommel (March 24, 2009, 06:21 PM)
--- End quote ---
It shows a tooltip and 1=(secs) 2=(secs)
When you do nothing they start adding up by one. Of you move the mouse on a monitor, the monitor (1 or 2) count resets. Good so far eh? But when you move the mouse, the number of the monitor that is not active also stops adding up. I changed the limit to 5 secs, because I did not wanted to wait. It said DIM! after 5 secs of 'inactivity' on a monitor.
Coeluh:
Any progress yet?
Navigation
[0] Message Index
[#] Next page
Go to full version