Compare commits

..

1 Commits
master ... dev

Author SHA1 Message Date
Alexander Zhirov 056f01658b development 2022-05-20 18:21:10 +03:00
2 changed files with 13 additions and 5 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
*.o
mswitch
mswitch.log

View File

@ -1,5 +1,6 @@
import std.stdio;
import modules.monitors;
import core.thread;
/**
* Switching occurs only if 2 monitors are connected to the computer!
@ -16,11 +17,17 @@ int main(string[] args)
auto monitors = getMonitorsInfo();
file.writeln(monitors);
setPrimaryMonitor(monitors[1].name);
file.writeln("-- Switch monitors --");
swapMonitors(monitors[0].name, monitors[1].name, Relation.right_of);
monitors = getMonitorsInfo();
file.writeln(monitors);
while (true)
{
setPrimaryMonitor(monitors[1].name);
file.writeln("-- Switch monitors --");
swapMonitors(monitors[0].name, monitors[1].name, Relation.right_of);
monitors = getMonitorsInfo();
file.writeln(monitors);
Thread.sleep(dur!("seconds")(10));
}
file.close();