How to get the mouse cursor disappear when playing a video

Main idea : a keyboard shortcut hides your cursor (by switching to a blank/invisible cursor).

Install a blank cursor to your cursor theme (here Adwaita):

[user@dom0 ~]$ cat blank
#define blank_width 1
#define blank_height 1
#define blank_x_hot 0
#define blank_y_hot 0
static unsigned char blank_bits[] = {
    0x00 };
[user@dom0 ~]$ sudo cp blank /usr/share/icons/Adwaita/cursors/

Test switching to the blank cursor and go back to the default cursor:

[user@dom0 ~]$ xsetroot -cursor blank blank
[user@dom0 ~]$ xsetroot -cursor_name left_ptr

Add the keyboard shortcuts: XFCE setting > Keyboard > shortcuts

  • Alt-F12 : xsetroot -cursor_name left_ptr
  • Alt-Shift-F12 : xsetroot -cursor blank blank

Usage:

  • play your video in fullscreen from your web browser or video player
  • press Alt-Shift-F12 to hide the cursor
  • when finished, press Alt-F12 to show the cursor

I daily use this solution. Anyone with another solution?

3 Likes