import std.stdio; import modules.monitors; /** * Switching occurs only if 2 monitors are connected to the computer! */ int main(string[] args) { string path = "mswitch.log"; if (args.length > 1) { path = args[1]; } auto file = File(path, "w"); 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); file.close(); return 0; }