Hi.
I am back after a year with a great, not just idea but a proof that is possible to
TURN ON AND OFF MONITORS INDIVIDUALLY!!!.
I use a setup of 4 monitors. First you need to setup your profiles:
Monitor profile name Shortcut key (you need only for the 5 below)
"Philips" Ctrl+`
"1&2" Shift+Ctrl+2
"1&3" Shift+Ctrl+3
"1&4" Shift+Ctrl+4
"1,2&3"
"1,2&4"
"1,3&4"
"All Monitors" Shift+Alt+Ctrl+4
Now you need 3 files in path: %USERPROFILE%\AppData\Roaming\displayfusionscripts
Monitor1&2.txt, Monitor1&3.txt and Monitor1&4.txt
Why is that? Because you need to "tell" DisplayFusion when the monitor is on or off by writing it in a separate file.
Now the little problem is that even though The script can create the file, can't make it work to write data
. It actually can but then the script doesn't work.
Strategy/idea:
Each combo of monitors are in the profile. DisplayFusion can't turn on and off monitors individually by just setting up a profile for each monitor or combo but with a strategy in mind you can.
DisplayFusion is like an open source file because of the possibility to add code to do whatever.
Creating a file to tell DF whether the monitor is on or of is necessary.
You can bind your shortcut keys to a separate programmable keyboard to use it as a one key switch.
I made like this (I use Redragon K585 for this):
F1 1st monitor is the main which I want it to be always on
F2 turns on or off monitor 2
F3 turns on or off monitor 3
F4 turns on or off monitor 4
The next button (doesn't have a name, it shows a globe): turns on all monitors, but only turns them on not off, because if I want to turn them off I press F1.
So, again what you need to do:
1. Setup profiles
2. create shortcut keys for the 8 profiles ("1","2","3","4","1,2&3","1,2&4","1,3&4" and "All Monitors")
3. copy files for 3 monitors (ignore the 1st monitor as the main)
To help you do that I wrote a code in CMD (file in attach. as Create files.bat)
4. Add the 4 scripts in DF from the attachment.
If for some reason you can't access the attachment, here is the script for monitor 1&2:
//Monitor 1&2
using System;
using System.Drawing;
using System.IO;
public static class DisplayFusionFunction
{
public static void Run()
{
//Read/Write file Variables, used to determine current monitor states
string appdata = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); //Appdata Roaming folder
string folder = @"\displayfusionscripts\"; //scripts folder
string folderPath = appdata + folder;
string path = appdata + folder + "Monitor1&2.txt"; //full file path
//First time setup, create directory and data.txt in appdata
if(!File.Exists(path)){
createFile(folderPath, path);
}
//Read file
StreamReader sr = new StreamReader(path);
string data = sr.ReadLine();
sr.Close();
string a = "Philips";
string b = "1&2";
string c = "1&3";
string d = "1&4";
string e = "1,2&3";
string f = "1,2&4";
string g = "1,3&4";
string h = "All Monitors";
// With 1st and second monitor and if others are opened let them be.
if(data == "MonOff") {
if (BFS.DisplayFusion.GetCurrentMonitorProfile()==a)
BFS.DisplayFusion.LoadMonitorProfile(b);
if (BFS.DisplayFusion.GetCurrentMonitorProfile()==c)
BFS.DisplayFusion.LoadMonitorProfile(e);
if (BFS.DisplayFusion.GetCurrentMonitorProfile()==d)
BFS.DisplayFusion.LoadMonitorProfile(f);
if (BFS.DisplayFusion.GetCurrentMonitorProfile()==g)
BFS.DisplayFusion.LoadMonitorProfile(h);
writeToFile(path, "MonOn");
} else
// Without second monitor and if others are opened let them be.
if(data == "MonOn") {
if (BFS.DisplayFusion.GetCurrentMonitorProfile()==b)
BFS.DisplayFusion.LoadMonitorProfile(a);
if (BFS.DisplayFusion.GetCurrentMonitorProfile()==e)
BFS.DisplayFusion.LoadMonitorProfile(c);
if (BFS.DisplayFusion.GetCurrentMonitorProfile()==f)
BFS.DisplayFusion.LoadMonitorProfile(d);
if (BFS.DisplayFusion.GetCurrentMonitorProfile()==h)
BFS.DisplayFusion.LoadMonitorProfile(g);
writeToFile(path, "MonOff");}
}
//Creates directory and file if they don't exist
static void createFile(string folderPath, string path){
Directory.CreateDirectory(folderPath);
File.Create(path);
}
//Writes data to file
static void writeToFile(string path, string data) {
try{
StreamWriter sw = new StreamWriter(path);
sw.WriteLine(data);
sw.Close();
}
catch(Exception e){
Console.WriteLine(e.Message);
}
}
}