development
This commit is contained in:
parent
61df35ee17
commit
056f01658b
|
@ -1,2 +1,3 @@
|
||||||
*.o
|
*.o
|
||||||
mswitch
|
mswitch
|
||||||
|
mswitch.log
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import std.stdio;
|
import std.stdio;
|
||||||
import modules.monitors;
|
import modules.monitors;
|
||||||
|
import core.thread;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Switching occurs only if 2 monitors are connected to the computer!
|
* Switching occurs only if 2 monitors are connected to the computer!
|
||||||
|
@ -16,12 +17,18 @@ int main(string[] args)
|
||||||
|
|
||||||
auto monitors = getMonitorsInfo();
|
auto monitors = getMonitorsInfo();
|
||||||
file.writeln(monitors);
|
file.writeln(monitors);
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
setPrimaryMonitor(monitors[1].name);
|
setPrimaryMonitor(monitors[1].name);
|
||||||
file.writeln("-- Switch monitors --");
|
file.writeln("-- Switch monitors --");
|
||||||
swapMonitors(monitors[0].name, monitors[1].name, Relation.right_of);
|
swapMonitors(monitors[0].name, monitors[1].name, Relation.right_of);
|
||||||
monitors = getMonitorsInfo();
|
monitors = getMonitorsInfo();
|
||||||
file.writeln(monitors);
|
file.writeln(monitors);
|
||||||
|
|
||||||
|
Thread.sleep(dur!("seconds")(10));
|
||||||
|
}
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue