I want to get more enjoyment out of my active wallpapers. Is it possible to minimize all windows after 60 of no mouse input? And then relaunch all windows upon next mouse movement. Essentially a screensaver but for my desktop wallpaper.
I would also want a toggle switch for the timer, as I may want to enable long idles for watching videos and such. Is something like this possible? Where would I start?
The attached script below should be able to do this for you. You can import it by opening the DisplayFusion Settings > Functions > Scripted Function > Import Scripted Function. You can then run it from a "System Idle" trigger.
I'm trying to figure out how to modify the script to not run if it's on a portrait oriented monitor. Then I'd move the mouse to that screen when watching video. I found code that does this:
But I haven't yet found the docs for the Rectangle object and am unsure of what context I should be looking in. But I'd just do the above and then wrap the whole thing in an if statement conditioned on the monitor width being greater than the height.
Seems like the System Idle trigger gets fired after every delay. So if you set it to go one minute after idle starts, it'll fire off a new thread every minute until you move the mouse. Is there any way to detect an already running instance of a trigger that's still running?
Responded to your email already, but will post this here in case anyone else comes across it:
It looks like the sendkeys that the script sends makes Windows reset its idle timer. I've done a quick test here, and doing this should work around that:
// If the script is already running, exit
if (BFS.ScriptSettings.ReadValueBool("MinimizeScriptIsRunning"))
{
return;
}
// Mark the script as running
BFS.ScriptSettings.WriteValueBool("MinimizeScriptIsRunning", true);