Processing Ajax...

Title
Close Dialog

Message

Confirm
Close Dialog

Confirm
Close Dialog

Confirm
Close Dialog

User Image
Chris Smith15
2 discussion posts
I originally posted my solution for swapping between my desk (dual monitors) and couch (TV) on Reddit, but once I saw a forum here I thought it made sense to post on this site as well because so many solutions failed for me. I was originally planning to use multiple tools to achieve this, but DisplayFusion ended up handling things nicely. I'm assuming the AutoHotKey portion of the post can be done with C in DispalyFusion, but for now this is working fine and I'm less comfortable with C#.

Original text is below.

___

I've recently worked on moving my computer to the living room area so that gaming is feasible either via my TV (couch) or desk. My goal was to find something that could make the switch between TV and desk with a keyboard shortcut. The final produced needed to include a means to switch audio too. Below is the solution that eventually worked where others failed.

Several solutions found on the internet did not seem to work for me for one reason or another (two Nirsoft applications, one other monitor switching application, command line options for Windows, Keyboard shortcuts built into windows).

For a few weeks, I was just turning off my monitors and manually changing the audio profile because those solutions failed. Today, I tried DisplayFusion with pretty good success.

Requirements:

AutoHotKey - https://www.autohotkey.com/ - This is used to write a keyboard short that determines how many monitors are connected to the computer and uses that information to determine which monitor profile needs to load.

DisplayFusion Pro - https://www.displayfusion.com/ - This is used to store monitor/audio configuration into profiles that can be loaded with keyboard shortcuts.

Rough Outline of steps:

    Download and install the software, AuotHotKey and Display Fusion.

    Once installed, right click on the Display Fusion icon by the system clock, and choose monitor configuration.

    Configure the desired monitor profiles and save them.

    To bind audio devices, go to Manage Monitor Profiles (in the Monitor Configuration window).

    Select the desired audio settings per profile and configure key combination (the AutoHotKey script below uses Shift + Alt + Ctrl + R and Shift + Alt + Ctrl + T).

    Close the Display Fusion windows and open Notepad.

    Copy the AutoHotKey Code snippet below to Notepad and save the file.

    Double click on the file. It should show up in the task bar by the clock.

    Test the switching.

If you want the AutoHotKey file to start with windows, I used the information at this article under the 'Add shortcut to startup folder' heading. https://www.howtogeek.com/364263/how-to-open-windows-store-apps-on-startup-in-windows-10/. Personally I put the AutoHotKey notepad file in a safe place, created a shortcut (right click > create shortcut), then copied the shortcut to the shell:Startup location.

AutoHotKey Code - This can be modified to be something that is more suitable for you. This script is what works for me. Other options could be something like using the monitor name or resolution. Some helpful information can be found here. https://www.autohotkey.com/docs/v1/lib/SysGet.htm

Code

!t:: ;Alt+T triggers the the switch..

SysGet, MonitorCount, MonitorCount ; Counts monitors

if ( MonitorCount = 1)

{

    Send +!\^R ; Sends the keyboard shortcut for the couch gaming profile

}

If ( MonitorCount > 1)

{

    Send +!\^Ts ; Sends the keyboard shortcut for the desk profile. 

}
Nov 24, 2023 (modified Nov 24, 2023)  • #1
User Image
JLJTGR
94 discussion posts
If I'm not mistaking your descriptions... this should work as a Scripted Function for DisplayFusion instead of AHK:

Code

using System;
public static class DisplayFusionFunction
{
    public static void Run(IntPtr windowHandle)
    {
        int monitorCount = BFS.Monitor.GetMonitorCountEnabled();

        if (monitorCount <= 1)  // One monitor (or less?)
        {
            BFS.DisplayFusion.LoadMonitorProfile("Named profile 1");
        }
        else    // More than one monitor
        {
            BFS.DisplayFusion.LoadMonitorProfile("Named profile 2");
        }
    }
}


Then you just give the Scripted Function a hotkey to trigger it. The Shift-Ctrl-Alt R/T shouldn't be necessary, but you can always keep them for manual control.

In the Triggers section, you may also have the Scripted Function run when Display Fusion starts or the Desktop Unlocks. (or both)
Nov 25, 2023  • #2
User Image
Chris Smith15
2 discussion posts
Thank you! I'll try this out!
Nov 25, 2023  • #3
Subscribe to this discussion topic using RSS
Was this helpful?  Login to Vote(-)  Login to Vote(-)