topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 9:39 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: Dim inactive monitor after x seconds  (Read 7737 times)

Coeluh

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 273
  • Family Guy ^^
    • View Profile
    • Jeroen Coelen
    • Donate to Member
Dim inactive monitor after x seconds
« on: March 24, 2009, 11:06 AM »
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

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 273
  • Family Guy ^^
    • View Profile
    • Jeroen Coelen
    • Donate to Member
Re: Dim inactive monitor after x seconds
« Reply #1 on: March 24, 2009, 11:10 AM »
The time should be configurable 2 too and also the level of transparency and the time it fades...

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: Dim inactive monitor after x seconds
« Reply #2 on: March 24, 2009, 06:21 PM »
 :) 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

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 273
  • Family Guy ^^
    • View Profile
    • Jeroen Coelen
    • Donate to Member
Re: Dim inactive monitor after x seconds
« Reply #3 on: March 25, 2009, 01:20 PM »
:) 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
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

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 273
  • Family Guy ^^
    • View Profile
    • Jeroen Coelen
    • Donate to Member
Re: Dim inactive monitor after x seconds
« Reply #4 on: April 11, 2009, 10:12 AM »
Any progress yet?

Coeluh

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 273
  • Family Guy ^^
    • View Profile
    • Jeroen Coelen
    • Donate to Member
Re: Dim inactive monitor after x seconds
« Reply #5 on: April 23, 2009, 11:57 AM »
Maybe now?