0

I would like the login and startup default position of the mouse cursor to be the center of the screen.

Every time I log in and when Ubuntu 20.04 (64 bit) starts up, the mouse cursor's default position is the lower right hand corner of the screen. This is driving me crazy.

Do I need to make a startup script that runs with xdotool?

Please advise.

Thanks, Chris

1 Answer 1

2

I was able to fix this using xdotool

  1. Install xdotool which will be used to move the cursor. In a terminal use:

    sudo apt install xdotool
    
  2. Create a .desktop file to be executed when you login.

    gedit ~/.config/autostart/move_cursor.desktop
    
  3. Paste the following and you can change the Exec line to modify the coordinates to where the cursor will move, this is made to center the cursor in a 1920x1080 resolution screen.

    [Desktop Entry]
    Name=Center Cursor
    Comment=Move the cursor to the center of the screen.
    Type=Application
    Exec=xdotool mousemove 960 540
    X-GNOME-Autostart-enabled=true
    
  4. Save file and reboot to see changes.

This will take effect after the login page on your system, so when you get to the desktop you'll see the cursor in the center of the screen.

1
  • you can use xdotool getmouselocation to determine the top right location where you would manually click. not sure why it is not working. it appears to only work with coordinates within the terminal window. konsole in my case.
    – pierrely
    Oct 14, 2022 at 6:42

You must log in to answer this question.

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