/home/bill/System_maintenance/xdotool/0_xdotool - notes and problems.txt ************** 30Sep2016 xdotool window commands : windowfocus [options] [window] waits until window is focussed !!! (doesn't alway work) windowactivate [options] [window] waits until window is activated!!! (can change window without raising it? windowraise [window] raise window to top of stack 29Sep2016 for typing into window - can I use ID_process, rather than ID_window?? ***************** 11Sep2016 xdotool type - misses spaces http://stackoverflow.com/questions/18434940/sed-code-works-ok-via-terminal-but-not-in-a-bash-script-what-should-i-esc answered Aug 30 '13 at 22:45 Gordon Davisson I'm not sure what's causing the final problem, but there's an earlier problem: referring to variables without double-quotes around them will cause unwanted parsing of the variable's value. For instance, the command echo $a will substitute the value of $a, then perform word splitting (which removes leasing and trailing whitespace, and converts whitespace within the variable into word breaks), then glob (aka wildcard) expansion if any of the words contain wildcards. (And then echo pastes the "words" it receives back together with a single space between them.) echo "$a", on the other hand, echoes the value of $a intact: **************** 10Sep2016 List of keysyms http://wiki.linuxquestions.org/wiki/List_of_keysyms This list will vary depending on compilation factors. You can view yours with the command : $ dumpkeys -l nul 0x0000 Control_a through g 0x0001 through 0x0008 BackSpace 0x0008 Remove the character to the left. Delete does the same thing, but it works at the login prompt as well. To remove the character under the cursor, use the string "\033[3~" (mapped to Remove by default). Control_h is a synonym. Tab 0x0009 Moves one tabwidth to the right. Control_i is a synonym. Linefeed 0x000a Starts a new line. Control_j is a synonym. Down 0x0600 Left 0x0601 Right 0x0602 Up 0x0603 Prior 0x0118 PageUp is a synonym Next 0x0119 PageDown is a synonym Shift 0x0700 Control_k through z 0x000b through 0x001a Escape 0x001b Control_backslash 0x001c Control_bracketright 0x001d Control_asciicircum 0x001e Control_underscore 0x001f NUTS!!! How do I get a simple line feed!??!!? Kwrite -> Menu -> Settings -> configure shortcuts Insert new smartline Shift+Return or Shift+Enter >> ONLY Shift+Return works!!!!! ********* But use --clearmodifiers !!!! Kwrite : Delete next character or selected ctrl+a select all ctrl+c copy selected ctrl+f search (find) ctrl+g+n goto line n ctrl+i indent line ctrl+j join lines ctrl+k kill (delete) several lines? ctrl+n new window ctrl+o open file ctrl+p+filename print to file ctrl+q quit ctrl+r search & replace ctrl+t transpose letter before&after cursor ctrl+u captalize next letter ctrl+v paste ctrl+w close file without save and open new (?) ctrl+x cut selected ctrl+z ?undo? ************* 05Sep2016 First attempt to run - missing programs on Lenovo! xdotool gpicview audiopreview 10Sep2016 BINGO!!!! http://askubuntu.com/questions/400363/bfgminer-not-catching-xdotool bfgminer not catching xdotool asked Jan 5 '14 at 8:14, xdaimon Many programs do not accept key strokes when they do not have the keyboard forcus - which certainly makes some sense. But you do not need to use "windowactivate", "windowfocus" works, and does not bring the window to front etc.: xdotool windowfocus 8392809 key p Also, you can simplify your command to one line by using the sleep command of xdotool xdotool key p sleep 0.5 key s or by using the option --delay with the command key. answered Aug 3 '14 at 10:03 Volker Siegel **************************** 01Apr2014 can't send keys to a window with xdotool Intersting : http://superuser.com/questions/518907/command-line-way-to-send-keystrokes-to-a-window-open-on-a-different-x-session or you might have better luck with these instead of "ctrl+s"/"ctrl+q" xdotool key "meta+f" "s" xdotool key "meta+f" "c" xdotool key "meta+f" "x" http://stackoverflow.com/questions/3792487/sending-keyboard-input-to-a-program-from-command-line I found these two programs xmacro and xremote you may take a look, but it seems that they're not well documented. I also found this utility xvkbd in answer to this question SO Q&A titled: Sending keycode to Xorg + wine with bash script. http://codebright.wordpress.com/2010/06/27/sendkeys-in-linux/ SendKeys in Linux Posted on June 27, 2010 by codebright SendKeys is a useful function in the Windows API which enables a program to send keystrokes. I was looking for an equivalent in Linux, first in Ubuntu at home, and then in Fedora 13 at work. For Ubuntu (Hardy Heron, 8.04), I found xautomation (http://hoopajoo.net/projects/xautomation.html), which worked fine. For many (but not all) of the non alpha-numeric keystrokes, you need to use the name of the key – there is a helpful list here (http://www.tcl.tk/man/tcl8.4/TkCmd/keysyms.htm). I tried xautomation with Fedora 13, but it was not happy. So I had a look around for an alternative. One possibility (I found them hard to find) was xdotool. Of course, the syntax for sending keystrokes is slightly different! It is slightly more consistent in that non-alphanumerics all need to be sent using the name of the key, so the helpful list (above) is still helpful! Muon - xautomation description Control X from the command line for scripts, and do "visual scraping" to find things on the screen. The control interface allows mouse movement, clicking, button up/down, key up/down, etc, and uses the XTest extension so you don't have the annoying problems that xse has when apps ignore sent events. The visgrep program find images inside of images and reports the coordinates, allowing programs to find buttons, etc, on the screen to click on. EWMH specification: http://standards/freedesktop.org/wm-spec/wm-spec-1.3.html http://danielj.se/2011/06/29/control-keystrokes-and-mouse-from-the-command-line-with-xautomation/ Control Keystrokes and Mouse from the Command-Line with Xautomation Handy for xte!! AWESOME!!! : http://blog.sleeplessbeastie.eu/2013/01/21/how-to-automate-mouse-and-keyboard/ xwd as well -> dump an image of an xwindow ***************** # media_kill - 01Jul2014 # tried at end of operator to giv time for shellApp_cmd -> didn't help host 'sleep 5s' ; # ?activate a window before closing it? # by manually opening an image in 'gpicview', ctrl+q closes it, but ctrl+c does not # try host, with one of : (link char_char 'xdotool key --window ' winID ' ctrl+c ' char_char) (link char_char 'xdotool key --window ' winID ' ctrl+q ' char_char) (link char_char 'xdotool windowkill ' winID char_char) # ctrl+q & windowkill - Problem is that "qnial gets stuck" and needs a ctrl+c in terminal # ctrl+c - doesn't close the window by itself # others? - ctrl+x etc # using windowkill -> doesn't see to help? (link char_char 'xdotool windowactivate --sync ' winID char_char) ; # This stopped ALL windows. They got caught in "qnial gets stuck" # and needed a ctrl+c in terminal # use generic routine via bash script! -> didn't work, but very useful!! shellApp_cmds command_lines ; # try this to avoid "qnial gets stuck" (winID didn't work, try with ID_Qnial) ; shellApp_cmds solitary (link char_char 'xdotool key --window ' ID_Qnial ' ctrl+c ' char_char) ; # maybe don't go through bash for a ctrl+c to Qnial? host (link char_char 'xdotool key --window ' ID_Qnial ' ctrl+c ' char_char) ; # This time, one ctrl+c manual frees one window, a second ctrl+c frees all the rest ! # maybe clearmodifiers? (01Jul2014 I didn't try yet...) # 02Jul2014 # using ctrl+q & ctrl+q : activate a window before closing it : didn't work shellApp_cmds (link char_char 'xdotool windowactivate --sync ' winID char_char) (link char_char 'xdotool key --window ' ID_Qnial ' ctrl+c ' char_char) ; # test windowactivate from terminal : This worked -> brought window to top, ready for input!! $ xdotool search --name "Qnial" $ xdotool windowactivate --syn # observe the effect from within qnial program via test routine winActivate_test - once "qnial gets stuck", then even ctrl+q from a terminal will NOT close the window! - somehow the errors seems to freeze widow control, ctrl+c in QNial unlocks this and allows the window to be closed # ID_voice, ID_music have NO values after pv is run!?!? Both have MULTIPLE window ID's!!! 33 for amarok, 2 for audacious Run once more : same as before -> 33 for amarok, 2 for audacious Modify winID_get to return a series of strings split-by a space, dropping the space, then test the return value for solitary or list. ** new windows are appended! # keep it simple : enddoc