You are not logged in.

#1 2008-09-20 03:56:58

Statix
Member
From: Hangzhou, China
Registered: 2008-02-16
Posts: 240

[Solved] Finding mouse position in bash

I'm looking for the simplest way posible to find the absolute current mouse position for X in bash (or with a simple cli program, hopefully possible with plain X!).

If there is no KISS way to do this I'll make my own program, but that probably shouldn't be necessary. I'm just trying to make gmrun start at the mouse cursor position.

Last edited by Statix (2008-09-21 02:05:20)


Madly in love with Arch64, Openbox, DotA, and of course... penguins!
Happy to help if you're not a Help Vampire. Use your wonderful resources like ArchWiki, Google, and our wonderful search page.

Offline

#2 2008-09-20 06:31:12

fflarex
Member
Registered: 2007-09-15
Posts: 466

Re: [Solved] Finding mouse position in bash

Maybe you could do it with xev? It can give you mouse position info, but it may not be a good format for use in a script (for example, I'm not sure if you can do it without opening a new window for a short time).

Offline

#3 2008-09-20 06:42:51

Lord Illidan
Member
From: Malta
Registered: 2007-10-25
Posts: 248

Re: [Solved] Finding mouse position in bash

I found this thread, could be useful to you?

http://ubuntuforums.org/showthread.php?t=562087

Offline

#4 2008-09-20 10:29:02

foutrelis
Developer
From: Athens, Greece
Registered: 2008-07-28
Posts: 705
Website

Re: [Solved] Finding mouse position in bash

You could give xdotool a try:

[foutrelis@foutboxd ~]$ xdotool getmouselocation
x:1047 y:552 screen:0

Offline

#5 2008-09-20 10:36:02

moljac024
Member
From: Serbia
Registered: 2008-01-29
Posts: 2,676

Re: [Solved] Finding mouse position in bash

Check out this thread:

http://bbs.archlinux.org/viewtopic.php?id=47833

It has exactly what you need.


The day Microsoft makes a product that doesn't suck, is the day they make a vacuum cleaner.
--------------------------------------------------------------------------------------------------------------
But if they tell you that I've lost my mind, maybe it's not gone just a little hard to find...

Offline

#6 2008-09-21 02:04:53

Statix
Member
From: Hangzhou, China
Registered: 2008-02-16
Posts: 240

Re: [Solved] Finding mouse position in bash

Thanks all. Moljac's link was exactly what I was looking for.


Madly in love with Arch64, Openbox, DotA, and of course... penguins!
Happy to help if you're not a Help Vampire. Use your wonderful resources like ArchWiki, Google, and our wonderful search page.

Offline

Board footer

Powered by FluxBB