Processing Ajax...

Title

Message

Confirm

Confirm

Confirm

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure you want to delete this item?

Confirm

Are you sure?

User Image
badbob001
67 discussion posts
I have two monitors connected to my laptop for a total of 3 screens. When I close my laptop lid, only the two remaining screens remain active. When I open back the laptop lid, it's back to 3 screens but all my window positions are moved to the laptop screen.

Is there an automated way to save my window positions when it's 3 screens and then restore those positions after the screen count returns back to 3 screens?

Since I'm not just switching monitor profiles but actually effectively removing a screen, I can't use a profile change to trigger saving the window positions as that would be after the fact.

I'm currently testing an autohotkey 5-minute loop that runs the displayfusioncommand "Save Window Positions" when there are 3 monitors and then run "Restore Window Positions From Last Save" whenever the monitor count goes below 3 and then back to 3. But I'm checking to see if DF has an internal way to do this.
Jul 24, 2020  • #1
User Image
badbob001
67 discussion posts
Doesn't seem to be working. Do I need to find and activate these functions: "Save Window Positions" and "Restore Window Positions From Last Save"? Can't find them in the Download Pre-Made Function list.
Jul 25, 2020  • #2
User Image
Jim Dunn
12 discussion posts
Both of those functions show up in my list of included (built-in) functions, in the Settings-Functions-|-Window Management section. The list includes Save Window Positions and Restore Window Positions From Last Save

I'm using version 9.7.1 Beta 2, and, incidentally, according to the Change Log, it seems Restore Window Positions from Last Save (ignore minimized windows) was added in version 9.7.
-------------------------------------------------------------------------

But now I read your post again, it seems you've already found them and they just don't work in the way you are trying to use them?

The Command Line Tool help has this example:
Quote:
DisplayFusionCommand.exe -functionrun "Start Screen Saver"
Runs the built-in DisplayFusion Function that starts the Screen Saver

Is that how you're trying to use them?

i.e.:

Code

DisplayFusionCommand.exe -functionrun "Save Window Positions"

Code

DisplayFusionCommand.exe -functionrun "Restore Window Positions From Last Save"


I just tested those (copied and pasted from this post) from a Windows command prompt issued in the Display Fusion program files directory, and they did indeed save and restore my window positions (I moved a couple of windows after issuing the first command and they were moved back by the second one)

Maybe it's just a "path" issue, and you should either have your script 'change' to that directory first, include the Display Fusion program directory in the path your script uses, or just check the path to DisplayFusionCommand.exe which you are providing, or the syntax?

I'm not really familiar with your "autohotkey" tool and exactly how its scripts work (I tend to use Windows 'native' scripting or knock something up in VS), so I don't know how you're specifying path/executable/parameters in it - but I can, at least, confirm that the bare commands seem to work fine "out of the box" when run manually (without "downloading" or "activating" anything), on my installation anyway...

One other thought - you can actually assign a key-combination to the function(s) in the DisplayFusion function list in your DF settings. If, for some reason, passing the correct path/executable/parameters is problematical then maybe your tool would more easily just issue a key-combination of your choice to trigger the function(s) externally? (A quick search finds this, which may or may not not be relevant to your situation). Again, I'm not familiar with your tool so I'm not sure if that would help - just sharing a thought...
Jul 26, 2020 (modified Jul 26, 2020)  • #3
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)