Comments (7)
X11 is old and has some confusing concepts like a human would say “I have three screens” about a 3-monitor setup but with Xinerama, the display system says “I have one screen and it is huge” to encompass all 3 physical displays.
i am in favor of adding Xinerama (aka: better multi-display support) support to the commands listed in this issue 👍🏻
from xdotool.
@lanrat Sorry for the delays. Are you using Xinerama to achieve multiple screens? Or not?
from xdotool.
If you aren't using Xinerama, youc an try specifying a screen specifically with the DISPLAY:SCREEN
notation:
# Get the mouse location according to screen 2
DISPLAY=:0.2 xdotool getmouselocation
from xdotool.
I am using Xinerama, here is the output of xrandr (so that you can see my screen setup).
Screen 0: minimum 320 x 200, current 5120 x 1080, maximum 16384 x 16384
DisplayPort-0 connected 1920x1080+1280+0 (normal left inverted right x axis y axis) 477mm x 268mm
1920x1080 60.00*+
1280x1024 60.02
1440x900 59.90
1280x800 59.91
1152x864 75.00
1024x768 70.07 60.00
800x600 60.32 56.25
640x480 66.67 60.00
720x400 70.08
DisplayPort-1 connected 1920x1080+3200+0 (normal left inverted right x axis y axis) 477mm x 268mm
1920x1080 60.00*+
1680x1050 59.88
1280x1024 60.02
1440x900 59.90
1280x800 59.91
1152x864 75.00
1024x768 70.07 60.00
800x600 60.32 56.25
640x480 66.67 60.00
720x400 70.08
HDMI-0 disconnected (normal left inverted right x axis y axis)
DVI-0 connected 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm
1280x1024 60.02*+ 75.02
1152x864 75.00
1024x768 75.08 60.00
800x600 75.00 60.32
640x480 75.00 60.00
720x400 70.08
getmouselocation always returns screen 0, although the offset seems correct.
$ xdotool getmouselocation
x:1778 y:776 screen:0 window:10903159
getdisplaygeometry always returns this, regardless of which monitor the active window is on.
$ xdotool getdisplaygeometry
1920 1080
from xdotool.
Hi @jordansissel ! Can I pick up on this discussion? Is there a way to use xdotool getdisplaygeometry
with accurate results when using Xinerama? I'm using dwm which I believe uses Xinerama.
from xdotool.
DISPLAY=:0 for most people nowadays: if you have multiple monitors, you rather use xrandr --output ... --mode ... --pos ... to arrange them to form a virtual desktop. (At least that's the most common setup with open-source drivers: AMD or Intel or Nouveau, but proprietary nVidia drivers have alternative ways, so you might instead set it up so that xrandr sees one big virtual screen.) (I generally run on Radeon graphics and use arandr, which is a graphical control panel that detects monitors and helps to write those xrandr scripts.) And xrandr with no arguments shows the outputs.
xdotool apparently doesn't have code to query which output the mouse is on, which indeed makes this less than useful for most people. It should be added.
BTW that's not the end of it either, because the newest thing is yet another abstraction: "monitor" https://keithp.com/blogs/MST-monitors/ I'm not using MST so I don't care, but some users probably will.
What I was hoping to do is run a script to open several terminals on the screen on which the mouse is located at the time I run it (from an openbox menu entry).
from xdotool.
This might not be the same issue but I came to report something similarish where in xdotool always gives me NOT where my mouse is but rather where the most recent active window is. I use this to launch applications on the correct XScreen but this often fails because I have to click on a window on the desired XScreen before xdotool gives me the correct result.
Now there is a curious caveat to this issue. So for example if I say am on XScreen 0.0, move to 0.2 then use a keybind to launch something on 0.2 it will launch on 0.0. However if I say run this (line below) as a test in a term and move my mouse around it will track correctly...
while true; do xdotool getmouselocation ; sleep 2 ; done
Xinerama is for combining screens which is the opposite of what you want when you are separating GPU's workloads etc. xrandr can not run this correctly (yet) as the provider syntax was just added and has serious problems basically making a brutally crippled xinerama style config. Two GPU 8 screens split into 2 (3 technically) XScreens so I can delegate/segregate GPU workloads.
As a note it might be good to change the OP title to multi XScreen because you can have many screens without an XScreen, or without Xinerama. The key here is XScreens be them on a single GPU or several. As a note on my "technical" 3 XScreens I have to further separate a few screens with the third XScreen to counter some fun geometry issues with software KVM. So while 0.1 and 0.2 reside on the same GPU I still need to separate things and be able to launch on the right screen denoted by mouse position.
Given this is open and 9 years old I'm guessing this will never be addressed. There is a degree of irony in returning the XScreen when it can't...hehe.
from xdotool.
Related Issues (20)
- Impossible to chain "open thunderbird" + "resize window" HOT 2
- xdotool mousemove does not work on fc38
- Random mistake with type command
- Trouble getting xdo_click_window() function to work
- xdotool will not launch on Mint 21.2 Cinnamon
- xdotool key Alt+Tab on Ubuntu, not switch app window
- xdotool sets _NET_WM_NAME as a STRING when it needs to be set as UTF8_STRING
- Extremely strange bug - see attached video. HOT 2
- Add various random timing capabilities
- [Feature] Ability to query and change desktop names
- [Feature] Search for windows that are unmapped or visible on all desktops HOT 1
- Latest xdotool version in Ubuntu 22 repos silently fails on Wayland :sob: apt can't upgrade it, and manual doesn't help HOT 2
- Segfault when running over an ssh connection
- set_desktop --relative does not work for -1 HOT 2
- xdotool cannot send key combinations to Qt-based applications HOT 5
- XGetInputFocus returned the focused window of 1. This is likely a bug in the X server. HOT 1
- Search not seeing Steam Input On-Screen Keyboard HOT 7
- The character ":" is typed as "Q" in VM window HOT 1
- Xdotool works in Firefox but not Brave HOT 1
- behave_screen_edge only works with certain open windows
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xdotool.