应用程序将显示鼠标光标的当前坐标?

我希望能够在X显示器上显示指针的当前位置。 有没有这样做的应用程序?

有一个名为xdotool的软件包,它有一个名为getmouselocation的应用程序,可以从ubuntu存储库sudo apt-get install xdotool并带有sudo apt-get install xdotool 。 运行命令

 xdotool getmouselocation 

将输出

 x:1285 y:10 screen:0 
  1. 安装xdotool
  2. 打开一个终端并粘贴它:

     while true; do clear; xdotool getmouselocation; sleep 0.1; done 

将光标移动到屏幕上,您将在终端上看到实时坐标更新。

这是一个python脚本:

 #!/usr/bin/python from Xlib import display c = display.Display().screen().root.query_pointer()._data x = c["root_x"] y = c["root_y"] print x, y 

将它保存到文件, chmod +x it ,并看到它给出。

命令行中的xev显示了这一点。 请尝试以下方法。

 xev 

当前坐标显示为root:(,)

不是原生Linux解决方案,但如果您安装了Wine, Pixie是一款免费(如啤酒)小应用程序,它将以几种格式向您显示光标坐标和其下方像素的颜色。