DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’» is a community of 964,423 amazing developers

We're a place where coders share, stay up-to-date and grow their careers.

Create account Log in
Cason Adams
Cason Adams

Posted on • Updated on

Global hidden mouse pointer when typing

Lately I have been trying to focus on using the keyboard for all the things rather then constantly switching from mouse to keyboard and back. As I have tip toed down this path I realized one thing. I really don’t like it when the mouse pointer is hovering over where I am trying to interact with the screen. Whether it be typing a post or jamming out some code, talk about annoying to have to reach over and move the mouse pointer out of the way! Without further elaboration here is what I did.

Requirements

Fedora 32 Linux running X11
xbanish

Install libs for build

This command will be different if running Ubuntu pretty much just change devel to dev

dnf install \
 make \
 libXi-devel \
 libXfixes-devel \
 libXt-devel \
 libX11-devel \
 ;
Enter fullscreen mode Exit fullscreen mode

Clone, Build, Copy

git clone https://github.com/jcs/xbanish ~
cd ~/xbanish
make
cp xbanish /usr/local/bin/
Enter fullscreen mode Exit fullscreen mode

Create Systemd Service Unit File

open ~/.config/systemd/user/xbanish.service
Enter fullscreen mode Exit fullscreen mode

And paste this into the file

[Unit]
Description=xbanish
After=default.target

[Service]
Type=simple
ExecStart=/usr/local/bin/xbanish
Restart=on-failure
StartLimitBurst=10
RestartSec=30

[Install]
WantedBy=default.target
Enter fullscreen mode Exit fullscreen mode

Tell the system about the new service

systemctl daemon-reload
Enter fullscreen mode Exit fullscreen mode

Enable the service as a user service

systemctl --user enable xbanish
Enter fullscreen mode Exit fullscreen mode

Start the service as a user service

systemctl --user start xbanish
Enter fullscreen mode Exit fullscreen mode

Now when you type your mouse pointer will hide, and when need your mouse pointer just move the mouse and it will show up right where you left it!

Cheers!

Optional steps needing to remove and or stop the service

If needed stopping the service

systemctl --user stop xbanish
Enter fullscreen mode Exit fullscreen mode

If needed removing the service

systemctl --user disable xbanish
Enter fullscreen mode Exit fullscreen mode

Top comments (1)

Collapse
 
ayoubelmhamdi profile image
ayoubelmhamdi

you are intelligent as usually

🌚 Browsing with dark mode makes you a better developer.

It's a scientific fact.