Пытаться:
wmctrl -r “window name(or any string in the title)” -t `wmctrl -d | grep “workspace name” | cut -d" " -f1`
позвольте мне объяснить: с помощью wmctrl показывает
-r <WIN> -t <DESK> Move the window to the specified desktop.
<DESK> A desktop number. Desktops are counted from zero.
<WIN> This argument specifies the window. By default it's
interpreted as a string. The string is matched
against the window titles and the first matching
window is used. The matching isn't case sensitive
and the string may appear in any position
of the title.
The -i option may be used to interpret the argument
as a numerical window ID represented as a decimal
number. If it starts with "0x", then
it will be interpreted as a hexadecimal number.
wmctrl -d Можно перечислить все рабочие пространства, на моем компьютере теперь отображается следующее:
0 - DG: 1600x900 VP: N / A WA: 0,0 1600x868 код
1 * DG: 1600x900 VP: 0,0 WA: 0,0 1600x868 воспроизведения
2 - DG: 1600x900 VP: N / A WA: 0,01600x868 исследования
* означает текущее рабочее пространство
Кстати, wmctrl -lэто список всех окон (которые вы уже знаете), на моем компьютере теперь они:
0x05400008 1 пользовательский терминал LinuxMint
0x03a0008e 0 пользователь-LinuxMint Mozilla Firefox
так как «DESK» должен быть числом, я использую его, grep “workspace name” | cut -d" " -f1чтобы получить.
Например, если я хочу переместить Firefox в «код» рабочей области, я могу использовать:
wmctrl -r "firefox" -t 0
или
wmctrl -r "moz" -t `wmctrl -d | grep "code" | cut -d" " -f1`
но
wmctrl -r -i 0x03a0008e -t `wmctrl -d | grep "code" | cut -d" " -f1`
Просто работай со мной один раз, и я не знаю почему!