1

Recently I installed unclutter to hide the mouse pointer while I'm typing, since there is no option in Ubuntu 14.04 to hide mouse pointer. According to the man pages of unclutter ther is a option -keystroke that wait until a key has been pressed and hides the pointer. But my problem is that it doesn't work by running this command:

unclutter -keystroke &

Another hint in the man pages is that:

LIMITATIONS: The -keystroke option may not work (that is, the cursor will not disappear) with clients that request KeyRelease events. Games and Xt applications using KeyUp in their translation tables are most likely to suffer from this problem. The most feasible solution is to extend unclutter to use the XTest extension to get all keyboard and mouse events, though this of course requires XTest to be in the server too.

The -keystroke option does not distinguish modifier keys from keys which actu‐ ally generate characters. If desired this could be implemented in a simple way by using XLookupString to see if any characters are returned.

I must tell that I wouldn't like a timer for hiding mouse when it's idle. I would like it work like the windows.

0
3

You can use xbanish to do this. It is well known that the unclutter keystroke function has been broken for quite some time. I have tested this solution and it works well.

First, install git if it's not already installed:

sudo apt-get update
sudo apt-get install git build-essential libxtst-dev x11proto-core-dev

Then, clone the repo and install xbanish:

cd
git clone https://github.com/jcs/xbanish.git
cd xbanish
make

Now, set an alias for xbanish:

echo "alias xbanish='~/xbanish/xbanish &'" | tee -a ~/.bashrc
. ~/.bashrc

You can now run xbanish by simply running the following command:

xbanish

or

~/xbanish/xbanish &

Additionally, here's a helpful tip that has helped me so much when it comes to "no such file" errors.

You can use apt-file search to find out what package contains a file you are looking for. Here's an example: apt-file search X11/X.h

However, apt-file needs to be installed and you must run sudo apt-file update before you can use it:

sudo apt-get install apt-file 

and then run:

sudo apt-file update
5
  • I get the following error when I run the make command. I also tried sudo make but the same error: sajad@LoneWalker:~/xbanish$ make cc -O2 -Wall -Wunused -Wmissing-prototypes -Wstrict-prototypes -I/usr/X11R6/include -c xbanish.c -o xbanish.o xbanish.c:35:19: fatal error: X11/X.h: No such file or directory #include <X11/X.h> ^ compilation terminated. make: *** [xbanish.o] Error 1 – Sajjad Hoviegar Oct 7 '15 at 22:17
  • @sh2p Fortunately, this is quite easy to fix. It appears you are missing the file /usr/include/X11/X.h. Run the following commands to install x11proto-core-dev. Then, run: sudo make clean before you run make. Please post any more errors, thanks! – mchid Oct 8 '15 at 3:10
  • @sh2p Also, here's a helpful tip that has helped me so much when it comes to no such file errors. You can use apt-file search to find out what package contains a file you are looking for. Here's an example: apt-file search X11/X.h. However, apt-file needs to be installed and you must run sudo apt-file update before you can use it: sudo apt-get install apt-file and then run: sudo apt-file update – mchid Oct 8 '15 at 3:25
  • Thanks for your help @mchid After installing 4 packages, and adding alias for xbanish it worked correctly. Please edit the first comment where u wrote x11proto-core-dev, it must be sudo apt-get install blah blah... actually the second comment was more helpful and made my life easier! Thanks a lot. – Sajjad Hoviegar Oct 8 '15 at 18:02
  • 1
    I had to install the libxtst-dev package to have Xfixes.h. – Damien Apr 12 '19 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.