Title

Message

Confirm

<< Discussions<< NewsReply

Working with Triggers

DisplayFusion Triggers are a powerful and versatile way to automate your window management tasks. You can have multiple actions performed whenever certain things happen, like when new a window is created, a window is focused, or when DisplayFusion starts or exits. You can match windows based on their process path, command line parameters, window text (window title), and window class. Let's start with an overview of the different fields in the Trigger edit window.

Trigger Edit Window
Trigger Rule Edit Window
  • Event: Select what event should trigger this rule. The current options are Window Created (when the window opens), Window Focused (when you click on or Alt+Tab to the window), DisplayFusion Starts (useful for loading a specific Monitor Profile on startup), and DisplayFusion Exits.
  • Frequency: Here you can choose whether DisplayFusion will process this rule only once for each instance of this process (goes by process ID), once for only the first instance of this process (goes by process name), once for each window of this process (goes by window handle, useful when using the "Window Focused" trigger), or all windows for this process. In most cases you'll either want to use "Once-per-process ID" or "Always."
  • Stop processing triggers if this one matches: Enabling this checkbox will tell DisplayFusion to stop processing the rules on the Settings > Triggers tab if the window matches this rule. If you have a wildcard (*.*) rule after this rule in the list, you'd want to enable this checkbox if you don't want the window to be processed by the *.* rule.
  • Process Filename: You can manually enter the path to the application, or click the "Select Application" button to choose it. This option also accepts wildcards (e.g. C:\Applications\*, or *.*).
  • Process Command Line Parameters: In some cases, you may only want the rule to match if the program is running with specific command line parameters (e.g. if VLC was started with the --repeat parameter). Enter the parameters exactly in this option. You can view them for a running process by adding the "Command Line" column to the Windows Task Manager. You can also auto-populate this field by dragging the target icon and dropping it on the running program window.
  • Window Text: This option will allow you to specify a full or partial window title to match by. You can auto-populate this field by dragging the target icon and dropping it on the window you'd like to grab the title from. This field uses our text query engine, allowing you to specify multiple titles, and exclude certain text as well.
  • Window Class: This option will allow you to specify the window class to match. This is generally useful if you want to move only certain windows of an application (e.g. dialogs, settings windows, etc). You can auto-populate this field by dragging the target icon and dropping it on the window you'd like to grab the class from. This field uses our text query engine, allowing you to specify multiple classes, and exclude certain text as well.
  • Monitor Profile: This option will allow you to limit the rule to a specific Monitor Profile. This way, you can have rules for the same program, but apply different Actions for different Monitor Profiles.
  • Actions: This is where you'll add all of your moving, sizing, and other actions. Aside from moving to specific monitors and locations, and setting specific window sizes, you can also run built-in, custom, and scripted functions. For example, you can have a window be moved to a specific monitor, moved to the top-left corner, and set as "always on top." Actions in the list can be re-ordered by dragging them up or down with the mouse.

Here are a few examples:

Move to Primary Monitor, Maximize, and Dim Non-Primary Monitors
Move to Primary Monitor, Maximize, and Dim Non-Primary Monitors
Move to Monitor #3, Only if "3 Monitors" Profile is Active
Move to Monitor #3, Only if "3 Monitors" Profile is Active
Highlight the Active Window Red
Highlight the Active Window Red


Move the MS Paint Save As Window to Monitor #3
Move the MS Paint Save As Window to Monitor #3


Trigger rules are processed in the order that they're shown in each section of the list on the Triggers tab. Each Trigger type is separate from the others, so if a window is focused, only the rules in the Window Focused section will be processed. Tip: If you're using a mix of rules with specific match criteria, and rules with wildcard criteria, it's best to move the wildcard rules to the bottom of the list, so that the more specific rules get processed first.

As always, if you run into any issues, or have any questions or concerns, please don't hesitate to ask!

Jan 28, 2016 (modified Jun 28, 2019)  • #1
Avatar from Gravatar.com
The Breeze
13 discussion posts
Yes. Thank you much.
May 24, 2019  • #2
Avatar from Gravatar.com
Sun W. Kim
28 discussion posts
My basic trigger asks Display Fusion (DF) to move a new window to wherever the cursor is currently located. Is this behavior of Chrome? I have multiple tabs tied to different displays. So, it seems if I click a link in an application, a new tab will open on whatever display was last used in Chrome. If the cursor is on a display different than the last known display, DF won't create/move the tab to the correct display.

I'm thinking this is by design or some sort of limitation w/ Chrome. The trigger seems to work fine on any application that is single window.
• Attachment [protected]: 191015-04.jpg [26,388 bytes]
Oct 15, 2019  • #3
Keith Lammers (BFS)'s profile on WallpaperFusion.com
You're correct, that's by design with Chrome, and unfortunately DisplayFusion can't manage individual tabs, only the window itself.

Sorry!
Oct 16, 2019  • #4
Avatar from Gravatar.com
Fear na Boinne
23 discussion posts
Is there a way to trigger on the starting/stopping of the screensaver?
Jan 13, 2020  • #5
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Not at the moment, but this is currently on our feature request list, so I've added your vote to it. We'll be sure to let you know if/when we're able to implement it in the future.

Thanks!
Jan 13, 2020  • #6
Avatar from Gravatar.com
NetMage
252 discussion posts
Can we get more documentation on the triggers, such as when will System Idle trigger or what Windows System Event that each corresponds to?
Jan 23, 2020  • #7
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Windows has its own idle timer that counts up when there's no input. DisplayFusion uses that timer for the System Idle Timer trigger event.
Jan 27, 2020  • #8
Avatar from Gravatar.com
Robnw
1 discussion post
Is there a way to trigger when I plug my laptop into a dock with two monitors? I often disconnect/reconnect during the day and it would be nice if the windows that are already open would automatically snap to the monitor they used to be on. I've set up a Window Position Profile but I need to execute it manually each time I connect to the dock.

Edit: I worked it out. I learned that if I set up a Monitor Profile, I can attach my Window Position Profile to it.
Jan 29, 2020 (modified Jan 30, 2020)  • #9
Avatar from Gravatar.com
MarkOteam
8 discussion posts
Hi
I have a trigger that moves Word to monitor 2 and maximises.
However it doesn't always work.
If it's working, one thing that makes it stop working is, opening a Word from email attachment. DF wont move that instance, and any new word doc opened after that.
It also will just top working about sometimes 10 times of working sometimes 5.

Sometimes to make it work again, i open a blank word doc, and it will move Word, and new instances after that.

I have attached the log. I've tried every combination of trigger settings. I can't make it work all the time.. tends to work about 10 times, and then stops.

Monitor 2 has a DF taskbar set to the top of the screen.

Mark.
• Attachment [protected]: DF log.txt [203,639 bytes]
Mar 18, 2020  • #10
Jon Tackabury (BFS)'s profile on WallpaperFusion.com
Thank you for the information! We're a bit backed-up right now but we'll take a look as soon as we can and get back to you. Thanks!
Mar 19, 2020  • #11
Keith Lammers (BFS)'s profile on WallpaperFusion.com
@MarkOteam: Word sometimes re-uses window handles (instead of generating new ones each time a window opens) which trips up the Window Created Trigger Event. Could you try changing the Trigger Event to Window Focused to see if that helps?
Mar 20, 2020  • #12
Avatar from Gravatar.com
MarkOteam
8 discussion posts
Quote:
@MarkOteam: Word sometimes re-uses window handles (instead of generating new ones each time a window opens) which trips up the Window Created Trigger Event. Could you try changing the Trigger Event to Window Focused to see if that helps?


Thank you, can you recommend what the other settings should be, as now it's not maximising.. I have Window Focused. Frequency: once-per-process name. Stop preccessing trigger if this one matches and match condiition is the path of Word.
I have removed the maximise action, saved. added it back. no change.

Thanks Mark.
Mar 21, 2020  • #13
Avatar from Gravatar.com
Fear na Boinne
23 discussion posts
Quote:
Quote:
@MarkOteam: Word sometimes re-uses window handles (instead of generating new ones each time a window opens) which trips up the Window Created Trigger Event. Could you try changing the Trigger Event to Window Focused to see if that helps?


Thank you, can you recommend what the other settings should be, as now it's not maximising.. I have Window Focused. Frequency: once-per-process name. Stop preccessing trigger if this one matches and match condiition is the path of Word.
I have removed the maximise action, saved. added it back. no change.

Thanks Mark.

You probably don't want "once per session", as that does literally do what is says: restrict the trigger to only trigger onve in a session...
Mar 21, 2020  • #14
Avatar from Gravatar.com
MarkOteam
8 discussion posts
Hi when i had windows focused, in word if another Word dialoug box opened, like a date insert we have from a plugin, it would maximise that date insert box.. taking it off focused stoped it from doing that.
but still it's not consistent. Now when open Word app, doesn't move. Open a Word doc, and it will move..
I've got it on Window Focused, once per-Process name.
stop processing triggers if this on matches
Mar 24, 2020  • #15
Avatar from Gravatar.com
Eric888
1 discussion post
Hi there
Is there a means to add a trigger like "on-drag"?
Basically, I would like to make windows semi-transparent while dragged (and back to normal after that)
TIA
Mar 24, 2020  • #16
Keith Lammers (BFS)'s profile on WallpaperFusion.com
@MarkOTeam: I would set it back to "Always" instead of "Once-Per-Process" and then add this to the Window Text condition:
" - Word"


That will make it only match windows that have stuff like this in the title "Document1 - Word" which should only be the main document windows, and not the child windows.

@Eric888: There isn't an "on drag" Trigger Event, sorry!
Mar 27, 2020  • #17
Avatar from Gravatar.com
MarkOteam
8 discussion posts
Quote:
@MarkOTeam: I would set it back to "Always" instead of "Once-Per-Process" and then add this to the Window Text condition:
" - Word"


That will make it only match windows that have stuff like this in the title "Document1 - Word" which should only be the main document windows, and not the child windows.

@Eric888: There isn't an "on drag" Trigger Event, sorry!


Thank you, with Text condition " - Word " the child window still opens up maximised, which is a date picker. The title of that window is 'Chose a date...' is there a way to make it not expand that window?

Thanks Mark
Apr 10, 2020  • #18
Avatar from Gravatar.com
MarkOteam
8 discussion posts
@Keith Lammers any ideas for this?
thank you
Mark.
Apr 14, 2020  • #19
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Forgive my ignorance, but could you tell me how to open that date picker window in Word? I can't find it for the life of me!
Apr 14, 2020  • #20
Avatar from Gravatar.com
MarkOteam
8 discussion posts
Hi Kieth.. sorry for that.. the date picker is a word plugin we have. that when you hit 'date insert' button a box opens that lets you select a date to insert into document. It's that window that is maximising. I've attached screen shot showing, it not maximised.

Any way to make it not maximise that seconday window from Word?

Mark.
• Attachment [protected]: WINWORD_nAAhMZNx5m.png [32,609 bytes]
Apr 15, 2020  • #21
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Ah ok, gotcha! Could you add this to the Window Text condition in the Trigger rule? (make sure to include the dash in front)

-"Choose a date"


So if the current Window Text is set to
"Microsoft Word"
, the whole thing would look like this:
"Microsoft Word" -"Choose a date"
Apr 15, 2020  • #22
Avatar from Gravatar.com
dbaldon
19 discussion posts
Quote:
Is there a way to trigger when I plug my laptop into a dock with two monitors? I often disconnect/reconnect during the day and it would be nice if the windows that are already open would automatically snap to the monitor they used to be on. I've set up a Window Position Profile but I need to execute it manually each time I connect to the dock.

Edit: I worked it out. I learned that if I set up a Monitor Profile, I can attach my Window Position Profile to it.
Can you provide more detail about how you worked it out? I have both Monitor Profiles set up and Window Position Profiles but haven't been able to switch between position profiles automatically.
Apr 16, 2020  • #23
Avatar from Gravatar.com
MarkOteam
8 discussion posts
Quote:
Ah ok, gotcha! Could you add this to the Window Text condition in the Trigger rule? (make sure to include the dash in front)

-"Choose a date"


So if the current Window Text is set to
"Microsoft Word"
, the whole thing would look like this:
"Microsoft Word" -"Choose a date"


Thank you, this has worked for not maximising a 2nd word window. However our customer says that Word doesn't always move to monitor 2 (the righthand screen) maximised as the trigger says to do.

We also tried DF for moving opened Outlook message to monitor 2 (the righthand screen)
but had to take it off as there was sometimes a delay, 2 seconds for it to move.

I have enabled logging and attach the logs.

Can you take a look at the log and make any suggestions for our Word, Excel trigger being reliable and Outlook trigger to move as fast as possible.

thank you.
• Attachment [protected]: DisplayFusionDebugInfo24april.zip [362,089 bytes]
Apr 24, 2020  • #24
Keith Lammers (BFS)'s profile on WallpaperFusion.com
@MarkOteam: Are your Triggers for the Office apps set to use Window Created, or Window Focused?
Apr 24, 2020  • #25
Avatar from Gravatar.com
MarkOteam
8 discussion posts
Quote:
@MarkOteam: Are your Triggers for the Office apps set to use Window Created, or Window Focused?


Hi, Word and Outlook are on Window Focused.
All the other triggers are set to Window Created.

@KEITH LAMMERS (BFS) anything you can suggest, Outlook messages opening on the screen 2 maximised is a big issue for my customer.
Apr 25, 2020 (modified Apr 27, 2020)  • #26
Keith Lammers (BFS)'s profile on WallpaperFusion.com
@MarkOTeam: Let's move this to a new discussions topic (or email) so we don't take up too much space in the comments for the how-to guide. Could you post a new Discussions topic, or send a support request and include a backup of the settings from the affected machine?

Thanks!
Apr 27, 2020  • #27
Avatar from Gravatar.com
Andrey Mamontov
9 discussion posts
Hi!

Is there any way to disable triggers without opening the settings? For example using a keyboard shortcut or taskbar icon's context menu?

In my case after starting DisplayFusion - trigger open a lot of Windows and this is very convenient but not always.
May 7, 2020  • #28
Keith Lammers (BFS)'s profile on WallpaperFusion.com
It sure is! On the Settings > Functions tab, double-click the "Toggle Triggers" function in the list and then you can set a hotkey on it

Hope that helps!
May 12, 2020  • #29
Avatar from Gravatar.com
Andrey Mamontov
9 discussion posts
Quote:
It sure is! On the Settings > Functions tab, double-click the "Toggle Triggers" function in the list and then you can set a hotkey on it

Hope that helps!


Great, thanks!
May 12, 2020  • #30
Avatar from Gravatar.com
David Richmond1
1 discussion post
I'd love a built-in trigger for monitor setup changes, e.g. if a monitor is plugged/unplugged.

I've built this myself by:
1) Running a powershell script to listen for WM_DISPLAYCHANGE using a System.EventHandler
2) Having this PS script launch a process with a specific command line string
3) Creating a "Process created" trigger that monitors process command lines for the exact string that appears

It's a hack, but it totally works! Just a few lines of code too. Think this kind of thing could be coded in? Surely it wouldn't break anything 🙃 does DF monitor for this event already? I'd guess it does, somewhere, for something...
Jun 9, 2020  • #31
Avatar from Gravatar.com
NetMage
252 discussion posts
It would seem like it would be nice if DF would switch Monitor Profiles automatically when monitors are enabled/disabled physically (or perhaps in Windows) and then the Monitor Change Event could be used.
Jun 9, 2020  • #32
Keith Lammers (BFS)'s profile on WallpaperFusion.com
@David: I've added that to our feature request list, thanks!
Jun 9, 2020  • #33
Avatar from Gravatar.com
Christian_Bailey
16 discussion posts
Is it possible to make two different events fire the same Trigger? I want
Window Created
and
Monitor Profile Changed
. (I searched help and couldn't find anything on this.)

If not, I presume I have to duplicate the Trigger. Do I have to laboriously copy all the Match conditions and Actions, or is there same way to duplicate? (I searched help and couldn't find one.)
Jun 16, 2020  • #34
Keith Lammers (BFS)'s profile on WallpaperFusion.com
There isn't a way to use different events for the same rule, no, sorry! We're planning to add a duplicate button for the Trigger rules in a future update though.

Thanks!
Jun 16, 2020  • #35
Avatar from Gravatar.com
Justin91313
1 discussion post
Is there any way to pass parameters/arguments from triggers to functions? When I use the Monitor Profile Changed trigger, I want the function that I run (a call to run Nodejs with a JS script) to be able to know what profile it was changed to.

Alternatively, is there any way to hook into DF to listen for monitor profile changes? Particularly, I'm looking for a way to do this from Nodejs, but basically any other thing that can be executed can be used. (For example, I'm using Nodejs to set the monitor profile via a command exec to the CLI)
Jun 20, 2020  • #36
Keith Lammers (BFS)'s profile on WallpaperFusion.com
Can your JS script read from the registry? If so, you could create a scripted function in DisplayFusion that writes the current monitor profile name to the registry.

Get the Monitor Profile name: BFS.DisplayFusion.GetCurrentMonitorProfile

Write to the registry: BFS.ScriptSettings.WriteValue

You can then have your Trigger rule run that scripted function.

Hope that helps!
Jun 23, 2020  • #37
Keith Lammers (BFS)'s profile on WallpaperFusion.com
The comments chain here is getting pretty long, so we're going to lock this thread. If you have any questions or issues using Triggers, please create a new topic in the Discussions, or contact us here: https://www.displayfusion.com/Support/#contact

Thanks!
Jun 23, 2020  • #38
Was this helpful?  (10)  (3)
<< Discussions<< NewsReply