시험:
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 : 해당 없음 WA : 0,0 1600x868 코드
1 * DG : 1600x900 VP : 0,0 WA : 0,0 1600x868 재생
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를 workspace "code"로 옮기려면 다음을 사용할 수 있습니다.
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`
한 번만 일하면 왜 그런지 모르겠어요!