xdotool

Get X/Y position of caret (input text cursor) under Xorg?

淺唱寂寞╮ 提交于 2019-12-13 12:26:32
问题 I'd like to display a popover right above where the user is typing, in any Linux app (GTK, Qt, Electron, etc.), running on X. I figured out creating the popover, now I'm trying to figure out how to get the coordinates of the input text cursor (what blinks while you type, not sure if it's called "caret"?) relative to the screen. I know I can get info on where the mouse with xdotool : xdotool getmouselocation I would need the same thing but for the text cursor, in the currently focused window.

xdotool - Why sleep before running commands?

你。 提交于 2019-12-12 13:58:18
问题 I'm using xdotool to automate running commands, opening new tabs, etc. The thing is when doing it on the current window, I've to specifically sleep for some time or use xdotool keyup Return before doing anything or else xdotool won't press the enter key. kartik@kartikpc:~/junk/xdotool$ cat automate #!/bin/bash # Release the Return key # xdotool keyup Return # Or sleep 1 xdotool type --delay 1 --clearmodifiers "clear" xdotool key --clearmodifiers Return kartik@kartikpc:~/junk/xdotool$ source

Can I keep the terminal as the active window, even if it's in the background? - Python 3.3

二次信任 提交于 2019-12-11 13:17:26
问题 G'day, I've just posted this question here. Following on from that, is there a means to lock keyboard user input to the terminal, when it's running behind another window? My system requires a user to scan their barcode (barcode scanner acts as a keyboard. ie. outputs a string of letters and presses enter) inside the terminal. However, the system also requires that a log CSV file be displayed on the attached monitor. As such, with the terminal in the background, the cursor automatically

How to prohibit user to change OS window focus/type keys for several seconds on Linux

浪子不回头ぞ 提交于 2019-12-08 02:07:46
问题 I write automated tests for a website. One of the tests needs to press Ctrl + S and type some letters to save a webpage including CSS/JS. The test should require Firefox to have window focus for those several seconds to be able to type the filename and click "Save" (currently XDoTool is used for pressing keys and clicking the mouse). Sometimes I run the tests on my computer. I don't want to occasionally type something or change the window focus while the page is being saved, so I want to

How to prohibit user to change OS window focus/type keys for several seconds on Linux

筅森魡賤 提交于 2019-12-06 11:27:41
I write automated tests for a website. One of the tests needs to press Ctrl + S and type some letters to save a webpage including CSS/JS. The test should require Firefox to have window focus for those several seconds to be able to type the filename and click "Save" (currently XDoTool is used for pressing keys and clicking the mouse). Sometimes I run the tests on my computer. I don't want to occasionally type something or change the window focus while the page is being saved, so I want to prohibit changing focus for those several seconds when those mouse clicks/key presses are running. It's not

Sending Keystrokes to a X Window

非 Y 不嫁゛ 提交于 2019-12-06 05:44:10
问题 I am currently experimenting with xdotool to send keys to a process (I understand that it may not work for all processes that does not set _NET_WM_PID). I have trouble sending keystrokes to windows other from the focus. It does work if you are sending keystrokes to the CURRENTWINDOW . Below is the snippet that I used to test xdotool's functionality. extern "C"{ #include <xdo.h> } //extern "C" xdo_window_search #include <iostream> #include <string.h> using namespace std; int main(){ xdo_t* p

Get X/Y position of caret (input text cursor) under Xorg?

痴心易碎 提交于 2019-12-05 01:58:49
I'd like to display a popover right above where the user is typing, in any Linux app (GTK, Qt, Electron, etc.), running on X. I figured out creating the popover, now I'm trying to figure out how to get the coordinates of the input text cursor (what blinks while you type, not sure if it's called "caret"?) relative to the screen. I know I can get info on where the mouse with xdotool : xdotool getmouselocation I would need the same thing but for the text cursor, in the currently focused window. I have no idea how to achieve this. I would love if someone could point me in the right direction. So,

Sending Keystrokes to a X Window

可紊 提交于 2019-12-04 13:59:02
I am currently experimenting with xdotool to send keys to a process (I understand that it may not work for all processes that does not set _NET_WM_PID). I have trouble sending keystrokes to windows other from the focus. It does work if you are sending keystrokes to the CURRENTWINDOW . Below is the snippet that I used to test xdotool's functionality. extern "C"{ #include <xdo.h> } //extern "C" xdo_window_search #include <iostream> #include <string.h> using namespace std; int main(){ xdo_t* p_xdo = xdo_new(NULL); // Allocate memory for search query. xdo_search_t s; // Clear the allocated memory.

How to enable “Preserve Log” in Network tab in Chrome developer tools by default?

我怕爱的太早我们不能终老 提交于 2019-12-03 06:11:55
问题 How to enable "Preserve Log" in Network tools in Chrome developer tools by default? Everytime I press F12 and then select Network tab, I need to click preserve log checkbox to make it preserve request/responses. Is it possible to have it checked all the time by default? By the way this feature works in "Firefox Developer" edition. When I click "Persist Logs" and close and then open the browser & DEV tools window again, it is still checked. UPDATE - 6th March 2019 This will be fixed in Chrome

xdotool commands bound to key shortcuts doesnot work

不想你离开。 提交于 2019-12-03 03:40:14
I like VIM a lot and I wanted to use it's keybindings everywhere. There are many IDE plugins that can emulate this but I wanted more, maybe VIM keybindings in Minecraft? :D or VIM keybindings everywhere without the need to download any plugin. I noticed that every single editor implements this keys: Home , End , Ctrl + End , Ctrl + Left , Ctrl + Backspace and so on... I used these keys as a building blocks and I came up with this config for i3wm: mode "VIM MODE NORMAL" { bindsym --release h exec "xdotool key --clearmodifiers Left" bindsym --release j exec "xdotool key --clearmodifiers Down"