Спробуйте:
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 play
2 - DG: 1600x900 VP: N / A WA: 0,01600x868 дослідження
* означає поточну робочу область
BTW, 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`
Просто працюй мені один раз, і я не знаю чому!