====== WMCtrl ====== * Linux X Window 에서 창을 명령행으로 자유롭게 다룰 수 있게 해주는 툴. * [[http://tripie.sweb.cz/utils/wmctrl/|wmctrl - A command line tool to interact with an EWMH/NetWM compatible X Window Manager.]] * [[https://www.freedesktop.org/wiki/Software/wmctrl/|wmctrl]] * [[https://linux.die.net/man/1/wmctrl|wmctrl(1) - Linux man page]] * [[linux:xdotool|XDOTool]] ===== 창 목록 ===== wmctrl -l ===== 창 위치 옮기기 ===== * ''wmctrl -r 창이름 -e 0,X,Y,W,H'' * **창이름** 은 코드값이 아닌 그냥 일반적인 이름 * X,Y,W,H 값이 ''-1'' 이면 현재 상태 유지 * X,Y 를 음수로 주면 화면밖으로 창을 보내버릴 수 있음. 잘 안돼면 아예 큰 양수값으로 지정 ''wmctrl -r 창이름 -e 0,10000,10000,-1,-1'' ===== Window fullscreen toggle ===== * 현재 활성창에 대한 Full Screen toggle wmctrl -r ':ACTIVE:' -b toggle,fullscreen ===== workspace 작업공간 ===== # 작업공간 목록 wmctrl -d # 작업공간 이동(0부터 시작) wmctrl -s 0 * 참고, [[linux:gnome|Gnome]] 에서 작업공간 갯수 gsettings get org.gnome.desktop.wm.preferences num-workspaces * ''wmctrl'' 명령으로 작업공간 이동 [[https://www.artificialworlds.net/blog/2011/03/04/switching-workspace-in-gnome-via-the-command-line/|Switching workspace in GNOME via the command line – Andy Balaam's Blog]] : 2011년 글이지만 명령 몇개만 고치면 사용가능할 듯. * [[https://gist.github.com/kwon37xi/68a7ea43759ba270e9ae224d314b959a|gnome-workspace-switcher.sh]] ===== show desktop ===== * [[https://www.linuxuprising.com/2018/05/how-to-add-show-desktop-icon-to-ubuntu.html|How To Add A Show Desktop Icon To Ubuntu Dock / Dash To Dock]] * 가장 단순한 데스크 탑 보기/끄기. ''~/.local/bin/show-desktop.sh'' #!/bin/bash status="$(wmctrl -m | grep "showing the desktop" | sed -r 's/(.*)(ON|OFF)/\2/g')" if [ $status == "ON" ]; then wmctrl -k off else wmctrl -k on fi