0

I installed xdotool in Ubuntu. But it says segmentation fault (core dumped) when I inputted command xdotool getmouselocation. How to solve it?

8
  • What version of Ubuntu are you using? Are you actually running X, or another system like Wayland or Mir?
    – wjandrea
    May 11, 2018 at 18:47
  • my ubuntu version is ubuntu 16.04.What is the X?
    – shen xu
    May 12, 2018 at 13:52
  • en.wikipedia.org/wiki/X_Window_System
    – wjandrea
    May 12, 2018 at 18:24
  • How to install X_Window_System in ubuntu 16.04?
    – shen xu
    May 13, 2018 at 12:50
  • I had install X Window System use the command as follows: # apt-get install xserver-xorg # apt-get install x-window-system-core # dpkg-reconfigure xserver-xorg # apt-get install gnome-core # apt-get install gdm xscreensaver # apt-get install ttf-arphic* # startx .And input command "export DISPLAY=:0".Than xdotool can work now.
    – shen xu
    May 13, 2018 at 23:39

2 Answers 2

0

You might be using not real display. To correct this, do:

export DISPLAY=:0  
xdotool getmouselocation

If it did not work, this link might be useful.

5
  • I had correct this: export DISPLAY=:0 xdotool getmouselocation. But it says "Error:Can't open display:(null) Failed creating new xdo instance" now.
    – shen xu
    May 12, 2018 at 13:57
  • try to use export DISPLAY=:1, then try again
    – Olimjon
    May 12, 2018 at 14:24
  • I had try to use "export DISPLAY=:1",But it says "segmentation fault (core dumped)" now.
    – shen xu
    May 13, 2018 at 12:15
  • I had install X Window System use the command as follows: # apt-get install xserver-xorg # apt-get install x-window-system-core # dpkg-reconfigure xserver-xorg # apt-get install gnome-core # apt-get install gdm xscreensaver # apt-get install ttf-arphic* # startx And input command "export DISPLAY=:0".Than xdotool can work now.
    – shen xu
    May 13, 2018 at 23:41
  • But it has another question.Please look at the link "youtube.com/watch?v=25OTHjiVHZg".The value is x:512 y:384 of the screen coordinates,But the coordinates value is x:512 y:384 still when i change the location of mouse pointer in screen.Why the coordinates value do not change?I want get the screen coordinates current value of mouse pointer.
    – shen xu
    May 13, 2018 at 23:41
0

I had to install X Window System using the commands as follows:

# apt-get install xserver-xorg 
# apt-get install x-window-system-core 
# dpkg-reconfigure xserver-xorg 
# apt-get install gnome-core 
# apt-get install gdm xscreensaver 
# apt-get install ttf-arphic*
# startx

And input command export DISPLAY=:0. xdotool works now.

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .