Compare commits
1 Commits
Author | SHA1 | Date |
---|---|---|
Alexander Zhirov | 056f01658b |
|
@ -1,2 +1,3 @@
|
|||
*.o
|
||||
mswitch
|
||||
mswitch.log
|
||||
|
|
17
source/app.d
17
source/app.d
|
@ -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();
|
||||
|
||||
|
|
Loading…
Reference in New Issue