Próbować:
wmctrl -r “window name(or any string in the title)” -t `wmctrl -d | grep “workspace name” | cut -d" " -f1`
pozwól mi wyjaśnić: w pomocy programów 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 mogę wyświetlić listę wszystkich obszarów roboczych, na moim komputerze teraz pokazuje się następująco:
0 - DG: 1600x900 VP: nie dotyczy WA: 0,0 kod 1600x868
1 * DG: 1600x900 VP: 0,0 WA: 0,0 1600x868 grać
2 - DG: 1600x900 VP: brak danych WA: 0,01600x868 badań
* oznacza bieżący obszar roboczy
BTW, wmctrl -ljest na liście wszystkich okien (które już znasz), na moim komputerze są teraz:
0x05400008 1 użytkownik LinuxMint Terminal
0x03a0008e 0 użytkownik LinuxMint Mozilla Firefox
ponieważ „DESK” musi być liczbą, używam grep “workspace name” | cut -d" " -f1go, aby go zdobyć.
Na przykład, jeśli chcę przenieść Firefox do „kodu” obszaru roboczego, mogę użyć:
wmctrl -r "firefox" -t 0
lub
wmctrl -r "moz" -t `wmctrl -d | grep "code" | cut -d" " -f1`
ale
wmctrl -r -i 0x03a0008e -t `wmctrl -d | grep "code" | cut -d" " -f1`
Po prostu przepracuj mnie raz, a nie wiem dlaczego!