XDOTOOL(1) XDOTOOL(1) (NAME) xdotool - X11 (SYNOPSIS) xdotool cmd args... : [window] . "%1" . "%1" "WINDOW STACK" . (DESCRIPTION) xdotool ( ) . XTEST X11 Xlib . Extended Window Manager Hints ( EWMH NetWM ) . "EXTENDED WINDOW MANAGER HINTS" ..SH " (KEYBOARD COMMANDS)" key [options] keystroke [keystroke ...] : --window window . <> <<%1>> <<%@>> . <<%1>> . : <> <> --clearmodifiers (modifiers) . CLEARMODIFIERS . --delay milliseconds . 12ms . . <> <> <> <>. X Keysym . '+' . <> <> <> <> <> Foo_L Alt_L Control_L . xdotool (keycode) . <> xdotool xdotool . : <> xdotool key F2 : 'a' ( xdotool ) xdotool key Aacute : ctrl+l BackSpace : xdotool key ctrl+l BackSpace : ctrl+c 'gdb' ( <> ) xdotool search --name gdb key ctrl+c keydown [options] keystroke (keydown / press) . keyup keystroke (keyup / release) . type [options] something to type : --window windowid . <> . . XTEST . <<%1>> ( <> ). --delay milliseconds . 12ms . --clearmodifiers (modifiers) . CLEARMODIFIERS . . (ASCII newline tab) . --delay . <> 'type' . : 'Hello world!' : xdotool type 'Hello world!' mousemove [options] x y OR 'restore' X Y . X Y 'restore' . . --window . - : xdotool mousemove 0 0 click 1 mousemove restore --window WINDOW . 0,0 . "WINDOW STACK" %1 %@ %@ . --screen SCREEN . Xinerama . . --window --screen . --polar . 'x' ( - ) 'y' . 'up' ( ) : = = = . . --window . --clearmodifiers CLEARMODIFIERS . --sync . . . : . . mousemove_relative [options] x y x,y . --polar . 'x' ( - ) 'y' . 'up' ( ) : = = = . --sync . . . . . --clearmodifiers CLEARMODIFIERS . click [options] button mousedown mouseup ( ). : . --clearmodifiers (modifiers) . CLEARMODIFIERS . --repeat REPEAT . . '--repeat 2' . --delay MILLISECONDS . --repeat () . --window WINDOW . "SENDEVENT NOTES" . . . XTEST . "%1" ( "WINDOW STACK" ). mousedown [options] button click (mousedown) . mouseup [options] button click (mouseup) . getmouselocation [--shell] x y screen (window id) . Xinerama screen . . --shell getmouselocation eval . : % xdotool getmouselocation --shell X=880 Y=443 SCREEN=0 WINDOW=16777250 % eval $(xdotool getmouselocation --shell) % echo $X,$Y 714,324 behave_screen_edge [options] where command ... . : --delay MILLISECONDS . . . --quiesce MILLISECONDS . --delay ( ) . * . * delay delay . * / . * quiesce (cool-down) 'where' : left top-left top right bottom-left bottom bottom-right : # google-chrome -: xdotool behave_screen_edge bottom-left \ search --class google-chrome windowactivate # (). GNOME (metacity compiz) xdotool behave_screen_edge --delay 500 bottom-right key XF86Forward # firefox xdotool behave_screen_edge --delay 1000 top-left \ search --classname Navigator \ windowactivate --sync key --delay 250 ctrl+t ctrl+k ctrl+v Return (WINDOW COMMANDS) search [options] pattern (regular expression). X . << >> (COMMAND CHAINING) search stdout ( ) ( ). (window stack) . << (WINDOW STACK)>> << (COMMAND CHAINING)>> . (POSIX ERE) "Chrom(e|ium)$" "Chrome" "Chromium" . regex(7) . (case-insensitive). "--name --class --classname --role" ( --name --class --classname --role ). : --class (window class). --classname (window classname). --role (window role). --maxdepth N /. -1 . 0 (root windows) . (toplevel) maxdepth 1 ( 2) . --name . . --onlyvisible . IsViewable . --pid PID (PID) . X . --screen N . . Xinerama . --desktop N (desktop) . 'N' . . --limit N N . . ( '--limit 0' ). --title (DEPRECATED). --name . --all . : xdotool search --all --pid 1424 --name "Hello World" "Hello World" pid 1424 . --any ( 'or' <<>>). . : xdotool search --any --pid 1424 --name "Hello World" pid 1424 "Hello World" . --sync . . : google-chrome & xdotool search --sync --onlyvisible --class "google-chrome" selectwindow ( ) . . (kill) : xdotool selectwindow windowkill behave window action command ... (action) . xdotool . %1 . . : mouse-enter . 'mouse over' (javascript) . mouse-leave . 'mouse-enter' . mouse-click . focus (input focus) . blur . : # : xdotool search --onlyvisible . behave %@ mouse-enter getmouselocation # pid xterm xdotool search --class xterm behave %@ focus getwindowname getwindowpid # focus-follows-mouse ( ) xdotool search . behave %@ mouse-enter windowfocus PID . . _NET_WM_PID . "EXTENDED WINDOW MANAGER HINTS" . '%1' . . "WINDOW STACK" . : PID xterm: xdotool search --class xterm getwindowpid %@ getwindowname [window] (title) . . '%1' . . "WINDOW STACK" . getwindowgeometry [options] [window] (geometry) . x y . --shell 'eval' . getwindowfocus [-f] (window id) . . "WINDOW STACK" . WM_CLASS (top-level) WM_CLASS . WM_CLASS 'getwindowfocus -f' . windowsize [options] [window] width height . %1 . "WINDOW STACK" "COMMAND CHAINING" . . . : xdotool windowsize 100% 50% --usehints . : --usehints ( ) . / . --sync . . . : . : 80x24 : xdotool windowsize --usehints 80 24 windowmove [options] [window] x y . %1 . "WINDOW STACK" "COMMAND CHAINING" . x 'x' x . 'y' . : xdotool getactivewindow windowmove 100 100 # Moves to 100,100 xdotool getactivewindow windowmove x 100 # Moves to x,100 xdotool getactivewindow windowmove 100 y # Moves to 100,y xdotool getactivewindow windowmove 100 y # Moves to 100,y . . : xdotool windowmove 100% 50% --sync . . . --relative . windowfocus [options] [window] . %1 . "WINDOW STACK" "COMMAND CHAINING" . XSetInputFocus . --sync . . windowmap [options] [window] (Map) . X11 . %1 . "WINDOW STACK" "COMMAND CHAINING" . --sync () . . windowminimize [options] [window] . X11 'iconify' . %1 . "WINDOW STACK" "COMMAND CHAINING" . --sync . . windowraise [window_id=%1] ( ). . %1 . "WINDOW STACK" "COMMAND CHAINING" . windowlower [window_id=%1] ( ). . %1 . "WINDOW STACK" "COMMAND CHAINING" . windowreparent [source_window] destination_window (Reparent). source_window destination_window . %1 . "WINDOW STACK" ( %1) source_window destination_window . "WINDOW STACK" "COMMAND CHAINING" . windowclose [window] . (destroy ) (kill ) . %1 . "WINDOW STACK" "COMMAND CHAINING" ..IP "windowquit [window]" 4 (gracefully). . %1 . <> <> . windowkill [window] (kill) . (kill ). %1 . <> <> . windowunmap [options] [window_id=%1] (unmap) . %1 . <> <> . --sync unmap unmap () . . set_window [options] [windowid=%1] . %1 . <> <> . : --name newname WM_NAME ( ). --icon-name newiconname WM_ICON_NAME ( ). --role newrole WM_WINDOW_ROLE . --classname newclassname (class name) ( ). --class newclass ( ). --urgency value (urgency hint) . 1 . 0 . --overrideredirect value override_redirect . . 0 . 1 . (map) 'windowunmap' 'windowmap' . (DESKTOP AND WINDOW COMMANDS) EWMH . <> . windowactivate [options] [window] . windowfocus : . . windowfocus . %1 . <> <> . --sync . . getactivewindow . getwindowfocus . (window stack) . <> . windowstate [--add PROPERTY] [--remove PROPERTY] [--toggle PROPERTY] [window] . . : MODAL - (modal) STICKY - MAXIMIZED_VERT - MAXIMIZED_HORZ - ABOVE - ( ) BELOW - SKIP_TASKBAR - SKIP_PAGER - (pager) FULLSCREEN - HIDDEN - (unmap) SHADED - () DEMANDS_ATTENTION - EWMH . :) getwindowclassname [window] (class name) . set_num_desktops number . get_num_desktops . get_desktop_viewport [--shell] (viewport) . --shell (shell eval) . << >> viewport . viewport . set_desktop_viewport x y (viewport) . - . 1280x800 : xdotool set_desktop_viewport 1280 0 set_desktop [options] desktop_number . --relative . . : # xdotool set_desktop 5 # . ( "--" ) xdotool set_desktop --relative -- -1 get_desktop . set_desktop_for_window [window] desktop_number . %1 . <> <> ..IP "get_desktop_for_window [window]" 4 . . %1 . WINDOW STACK "COMMAND CHAINING" . (MISCELLANEOUS COMMANDS) exec [options] command [...] . behave_screen_edge . : --sync . (xdotool) . : # top-right xdotool behave_screen_edge --delay 1000 top-right \ exec gnome-screensaver-command --lock # 'xscreensaver-command -lock' . # '--sync' # /bin/false : xdotool exec --sync /bin/false mousemove 0 0 # --sync exec . xdotool exec /bin/false mousemove 0 0 sleep seconds () . ( 1.3 0.4) . (SCRIPTS) xdotool stdin . . 'script' . ( CONTACT ). ( $1 $2 ... ) ( $HOME $WINDOWID) . . xdotool ( COMMAND CHAINING) . o : xdotool filename o stdin: xdotool - o (redirected): xdotool - < myfile xdotool . : #!/usr/local/bin/xdotool search --onlyvisible --classname $1 windowsize %@ $2 $3 windowraise %@ windowmove %1 0 0 windowmove %2 $2 0 windowmove %3 0 $3 windowmove %4 $2 $3 classname ($1) 2x2 . : % ./myscript xterm 600 400 xterm 2x2 600x400 ..SH " (CLEARMODIFIERS)" --clearmodifiers (modifier) . : xdotool key a shift 'a' 'A' . xdotool . 'xdotool key --clearmodifiers a' shift : 1. ( shift ) 2. shift 'key up' shift 3. 'xdotool key a' 4. shift 'key down' shift --clearmodifiers : o (keymap) . ( 'xmodmap -pm' xmodmap(1) ) o (1 2 3 4 5) o caps lock SENDEVENT (SENDEVENT NOTES) xdotool . . API . 'xdotool type --window 12345 hello' xdotool 12345 . X11 ( XEvent.xany.send_event X11 ). . XSendEvent . XTEST . xdotool . . ( ): * Firefox 3 . * xterm ctrl+leftclick 'Allow SendEvents' . * gnome-terminal . (WINDOW STACK) (search getactivewindow getwindowfocus) . stdout xdotool . << (COMMAND CHAINING)>> . . . (COMMAND CHAINING) xdotool . ( << (WINDOW STACK)>> ) . "%N" N '@' . %N N . . (stacking order) (XQueryTree(3) ). . "window" . xterm 80x24: xdotool search --class xterm -- windowsize --usehints %@ 80 24 : xdotool getactivewindow windowmove 0 0 "%1" . . . firefox : xdotool search --class firefox windowactivate : xdotool windowactivate xdotool windowactivate %1 xdotool windowactivate %@ xdotool . << (WINDOW STACK)>> . : # Output the active window: % xdotool getactivewindow 20971533 # Output the pid of the active window, but not the active window id: % xdotool getactivewindow getwindowpid 4686 EWMH : _NET_SUPPORTED . _NET_CURRENT_DESKTOP . : "set_desktop" "get_desktop". _NET_WM_DESKTOP . : "set_desktop_for_window" "get_desktop_for_window". _NET_ACTIVE_WINDOW . : "windowactivate" "getactivewindow". _NET_WM_PID . PID . : "getwindowpid". (SUPPORTED FEATURES) xdotool ( libxdo) . X . xdotool . << (EXTENDED WINDOW MANAGER HINTS)>> . XTEST X XTEST . << >> ( libxdo) . XTEST X . X 'xdpyinfo' 'number of extensions: ...' . (BUGS) us . (SEE ALSO) xprop(1) xwininfo(1) : : EWMH: (CONTACT) xdotool-users@googlegroups.com . : :) (AUTHORS) xdotool Jordan Sissel . Daniel Kahn Gillmor ( ). Jordan Sissel . . CHANGELIST . 2026-03-15 XDOTOOL(1)