我如何在 C++ 中最小化所有打开的窗口?
我需要使用 C++ 代码最小化 ubuntu (ubuntu 17.10) 中所有打开的窗口。 我对此没有任何经验。我是 C++ 的初学者,我不太了解图书馆。请解释一个非常简单易懂的解决方案。
我想创建一个计时器,将一个数字(以分钟为单位)作为输入,当这个时间过去时,我想最小化所有打开的窗口。
#include <iostream>
#include <chrono>
#include <thread>
using namespace std;
int main()
{
int minute = {}, total (0);
using namespace std::chrono_literals;
cout << "Enter the minutes: ";
cin >> minute;
total = minute * 60;
for (int i = 0; i < total; i++)
{
this_thread::sleep_for(1s);
}
// in this place i want to minimize all open windows
return 0;
}
最佳答案
您需要通过管道传输到了解特定窗口管理器干扰的工具,例如,xdotool
:
关于c++ - 如何使用 STL 在 C++ 中最小化所有打开的窗口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49975323/