Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #248061

Re: which program can show X/Y position of mouse pointer

From David Wright <deblis@lionunicorn.co.uk>
Newsgroups linux.debian.user
Subject Re: which program can show X/Y position of mouse pointer
Date 2022-05-10 03:50 +0200
Message-ID <ElnaF-errV-3@gated-at.bofh.it> (permalink)
References <El9hn-ej4N-1@gated-at.bofh.it> <El9Kp-ejts-7@gated-at.bofh.it> <Eladr-ejCA-9@gated-at.bofh.it> <ElbMd-ekEk-3@gated-at.bofh.it> <ElkZb-eqhF-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Mon 09 May 2022 at 19:20:25 (-0400), lou wrote:
> 
> On 5/9/22 9:21 AM, Dan Ritter wrote:
> > No, I've never used twm. fvwm, sawmill/sawfish, and xfwm can all
> > do that. Probably most others.
> > 
> 
> Thanks! i have success with icewm, not with fvwm
> 
> xeyes knows mouse movement, it's too bad it doesn't show X/Y coordinates

It works just fine in fvwm. I ran this script in an xterm:

while /bin/true
do
    printf '%s ' "$(date +%H:%M:%S)" >> /tmp/mousey-pos
    xdotool getmouselocation >> /tmp/mousey-pos
    sleep 1
done

I ran this command in another xterm:

$ tail -f /tmp/mousey-pos

I then moved the mouse around the corners of the screen, and then
the corners of the xterm window on the screen. I shifted to another
viewport¹ and repeated (screen, then xterm). Then I switched back
to the original viewport to interrupt the script. The mousey-pos
output is attached.

The coordinates are always for the screen that you are staring at,
not the entire virtual desktop. When you move viewports, the window
numbers naturally all change (except for the clocks/pager/xconsole),
but the X/Y values don't.

There's no need to keep any xterm in view while it's running, if
you're recording the output in a file.

If it really doesn't work for you, there may be some dependency on
the way you start fvwm in .xsession which affects the parent-child
relationships, but that's just a guess.

I also tested using it from a bound keystroke, borrowing the
contortionist's keystroke for re-execing my xinput configuration,
Shift-Ctrl-Alt-/, thus:

#Key    slash           A       CMS     Exec exec xinput-xsession quiet
Key     slash           A       CMS     Exec exec xdotool getmouselocation

$ tail -f .xsession-fvwm-0-log

confirmed that this works too:

[fvwm][Echo]: Reading /home/david/.fvwm/main-menu-pre.hook Last edited 2003 July 21
[fvwm][Echo]: Reading /home/david/.fvwm/post.hook Last edited 2022-04-02
[fvwm][Echo]: Reading /home/david/.fvwm/last-post.hook-axis-0 Last edited 2020-04-04
[fvwm][Echo]: Reading /home/david/.fvwm/kbd-base.hook Last edited 2021-11-27
[fvwm][Echo]: Reading /home/david/.fvwm/kbd-axis.hook Last edited 2021-06-18
x:740 y:461 screen:0 window:16777248
x:118 y:83 screen:0 window:16777248
x:1385 y:739 screen:0 window:65011750

I must bind it to a better key. It's a much more controllable
output than xev, John, but I can see virtues in both.

¹ viewport: I have a desktop that's five times wider and four times
higher than the screen, and I switch between these twenty viewports
with clicks in the pager window, or with WindowsKey-arrows or with
Ctrl-Alt-arrows.

A few of the window numbers: root is 1707, …561 and …409 are
swissclocks for two timezones, …761 is the pager, …750 the xconsole,
and all of these are the same in every viewport. …248 is where I ran
the program, started and finished (obviously), and drew the (2nd)
outline round. …400 is an identical xterm on the viewport "next door"
for the 4th outline to go round.

Cheers,
David.

Back to linux.debian.user | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

which program can show X/Y position of mouse pointer lou <loushanguan2015@sina.com> - 2022-05-09 13:00 +0200
  Re: which program can show X/Y position of mouse pointer Dan Ritter <dsr@randomstring.org> - 2022-05-09 13:30 +0200
    Re: which program can show X/Y position of mouse pointer lou <loushanguan2015@sina.com> - 2022-05-09 14:00 +0200
      Re: which program can show X/Y position of mouse pointer Dan Ritter <dsr@randomstring.org> - 2022-05-09 15:40 +0200
        Re: which program can show X/Y position of mouse pointer lou <loushanguan2015@sina.com> - 2022-05-10 01:30 +0200
          Re: which program can show X/Y position of mouse pointer David Wright <deblis@lionunicorn.co.uk> - 2022-05-10 03:50 +0200
    Re: which program can show X/Y position of mouse pointer Michael Lange <klappnase@freenet.de> - 2022-05-11 11:30 +0200
      Re: which program can show X/Y position of mouse pointer lou <loushanguan2015@sina.com> - 2022-05-12 04:40 +0200
        Re: which program can show X/Y position of mouse pointer Michael Lange <klappnase@freenet.de> - 2022-05-12 11:00 +0200
  Re: which program can show X/Y position of mouse pointer John Hasler <john@sugarbit.com> - 2022-05-10 02:50 +0200

csiph-web