Want to earn a free DisplayFusion Pro license? We're looking for DisplayFusion translators!
<< DiscussionsReply
Fade All Monitors Except Primary modification request
Jeffen Nilsson's profile on WallpaperFusion.com
I really like the Fade All Monitors Except Primary scripted function and i would like to modify it into 2 different functions. one function that only fades, and the other that only unfades. Is this possible?

Ill explain my use case so maybe someone can come up with a better idea.

I open game.exe and i want the other monitors to FADE.
while playing game.exe i want to tab out of it and i want the monitors to UNFADE when i do that.
after i tab out and then go back to game.exe i want the monitors to FADE again.
and in the end when im done playing game.exe i close down the game and i want the monitors to UNFADE.

The problem i could see is that the function will overlap each other so that maybe DF will try to fade/unfade several times in a row so there would have to be something in the script that checks whether the other script is running or not
May 27, 2017 (modified May 27, 2017)  • #1
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
Are you wanting those two functions to run automatically? Or just want the fade/unfade in separate functions so that you can run them via key combinations?
May 29, 2017  • #2
Jeffen Nilsson's profile on WallpaperFusion.com
Quote:
Are you wanting those two functions to run automatically? Or just want the fade/unfade in separate functions so that you can run them via key combinations?


i want them to run automatically

i have tried running the function through a trigger but it is very inconsistent, sometimes it works, sometimes it doesnt, sometimes it runs twice so it cancels itself out.
May 29, 2017 (modified May 29, 2017)  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
I'm wondering if we can modify the script so that it's just a long running script that checks the focused window every few seconds. If it's the game window, make sure the other monitors are dimmed, if it's not, then undim them. Does that sound like it would work for your scenario?
May 30, 2017  • #4
Jeffen Nilsson's profile on WallpaperFusion.com
Quote:
I'm wondering if we can modify the script so that it's just a long running script that checks the focused window every few seconds. If it's the game window, make sure the other monitors are dimmed, if it's not, then undim them. Does that sound like it would work for your scenario?


i'm not sure. I also do this with video players and browser windows so im not sure whats the best.

it feels like it would be easier to use the functions when split into 2 but i'm not sure if that would be annoying to implement.

We could try the easiest solution first and if that doesn't work we could try something else if that makes sense.
May 30, 2017  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
The script could just check for whatever window it was run on, so it should work for anything. Let me see what I can find out.
Jun 2, 2017  • #6
Jeffen Nilsson's profile on WallpaperFusion.com
Quote:
The script could just check for whatever window it was run on, so it should work for anything. Let me see what I can find out.


have you found anything yet or are you still testing?
Jul 1, 2017  • #7
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
Sorry, I haven't forgotten about this, just waiting for one of our devs to have a few minutes of free time to write a Scripted Function for this
Jul 6, 2017  • #8
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
Sorry for the long wait! I put together a script that should work for you and attached it to this post. Here's how to get it into DisplayFusion:

  • Download the file attached to this post
  • Open the DisplayFusion Settings Window
  • On the "Functions" tab, click the "Add Scripted" button
  • Copy the text from the file you download in the first step into the window that pops up
  • Give the script a name and a key combination
  • Click OK to close that window, and OK again to save and apply your changes

I hope this works for you!
Jul 21, 2017  • #9
Jeffen Nilsson's profile on WallpaperFusion.com
Quote:
Sorry for the long wait! I put together a script that should work for you and attached it to this post. Here's how to get it into DisplayFusion:

  • Download the file attached to this post
  • Open the DisplayFusion Settings Window
  • On the "Functions" tab, click the "Add Scripted" button
  • Copy the text from the file you download in the first step into the window that pops up
  • Give the script a name and a key combination
  • Click OK to close that window, and OK again to save and apply your changes

I hope this works for you!


That script seems to work pretty well the only problem i have is when it activates and when it shuts off.

I want the script to activate when i open game.exe and dim the other monitors, if i then tab out from game.exe i want the other monitors to go back to full brightness, and then when i go back to the game.exe window i want the other monitors to dim again. When i then close game.exe i want the script to stop running.

im not sure if i can do this through triggers or if there is something in the script that has to be edited


I made 2 triggers for game.exe for when the window is created and for when it is destroyed. I have no problem with the destroy trigger but i do have a problem with the created trigger.

When the game.exe window is created and focused the script does run but it does not dim the other monitors even though the game.exe window is focused, i first have to focus a different window and then turn the focus back to game.exe for the other monitors to dim, a small problem perhaps but it is indeed a bit annoying.

I would also like to know where in the script the dim amount is stored so that i can change it if i want. and i would like to know if its possible to add a fade time to the dim so that it gradually dims to its full amount.
Aug 21, 2017 (modified Aug 22, 2017)  • #10
Jeffen Nilsson's profile on WallpaperFusion.com
Any update on this problem?
27 days ago  • #11
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
Sorry for the wait! I updated the script to fade in and out, and it should now also work with the Window Created Trigger. You can follow the same steps as my previous post to get this script working in DisplayFusion.

I also added two constants on line 18 and 19 that should help you customize the transparency and fade time of the script.

I hope this works for you!
25 days ago  • #12
Jeffen Nilsson's profile on WallpaperFusion.com
Quote:
Sorry for the wait! I updated the script to fade in and out, and it should now also work with the Window Created Trigger. You can follow the same steps as my previous post to get this script working in DisplayFusion.

I also added two constants on line 18 and 19 that should help you customize the transparency and fade time of the script.

I hope this works for you!


The custom transparency and the fade time work perfectly.

I'm still having a problem with the Created window trigger though. The script will run for the window specified but i have to focus a different window and then refocus the intended window for the fade to take effect.

It doesn't work right away with the hotkey for the function either, pressing the hotkey to run the function will remove focus from the affected window and then i have to refocus the window for the fade to take effect.
25 days ago (modified 25 days ago)  • #13
Thomas Malloch (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
That's really strange! Is the hotkey working right away with other windows, or are you having the same issue?
21 days ago  • #14
Jeffen Nilsson's profile on WallpaperFusion.com
Quote:
That's really strange! Is the hotkey working right away with other windows, or are you having the same issue?


the hotkey seems to always remove focus from the intended window and then i always have to refocus the window for the monitors to dim.
i tried several different windows (chrome, foobar, firefox, vlc, windows explorer) and they all work the same.

the trigger seems to keep the focus on the window but i have to remove the focus from the window and then refocus it for the monitors to dim.
21 days ago (modified 21 days ago)  • #15
Jeffen Nilsson's profile on WallpaperFusion.com
any ideas what the problem might be?
11 days ago  • #16
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Binary Fortress Administrator
 Binary Fortress Administrator
Sorry for the delay, Thomas is busy with ClipboardFusion development at the moment, but he'll have a look at this as soon as he has a chance.
11 days ago  • #17
Was this helpful?  Login to Vote  Login to Vote
<< DiscussionsReply
Visit DisplayFusion on FacebookVisit DisplayFusion on TwitterVisit DisplayFusion on Google+Visit DisplayFusion on LinkedInSearch for DisplayFusion on RedditFollow DisplayFusion on RSSVisit DisplayFusion on Instagram
Copyright © 2007-2017 Binary Fortress Software • News • Discussions • 常見問題集 • 支援 • Privacy • ToS