All Projects → jcs → Xbanish

jcs / Xbanish

Licence: other
banish the mouse cursor when typing, show it again when the mouse moves

Programming Languages

c
50402 projects - #5 most used programming language

Labels

Projects that are alternatives of or similar to Xbanish

gone
Where has my time gone?
Stars: ✭ 46 (-84.97%)
Mutual labels:  x11
tint3
A C++ rewrite of the tint2 panel
Stars: ✭ 39 (-87.25%)
Mutual labels:  x11
Devour
X11 window swallower
Stars: ✭ 253 (-17.32%)
Mutual labels:  x11
docker-ros-x11
A docker environment with ROS, Gazebo, X11 and Tensorflow
Stars: ✭ 29 (-90.52%)
Mutual labels:  x11
desktop-tux
WIP desktop-goose clone for X11/Linux
Stars: ✭ 20 (-93.46%)
Mutual labels:  x11
code
~/code – tools distributed across all of my systems
Stars: ✭ 73 (-76.14%)
Mutual labels:  x11
mcwm
mcwm window manager
Stars: ✭ 34 (-88.89%)
Mutual labels:  x11
Gromit Mpx
Gromit-MPX is an on-screen annotation tool that works with any Unix desktop environment under X11 as well as Wayland.
Stars: ✭ 287 (-6.21%)
Mutual labels:  x11
gobble
Rust rewrite of Devour
Stars: ✭ 23 (-92.48%)
Mutual labels:  x11
gummy
Linux brightness/temperature manager for X11
Stars: ✭ 13 (-95.75%)
Mutual labels:  x11
x11-cr
X11 bindings for Crystal language.
Stars: ✭ 32 (-89.54%)
Mutual labels:  x11
vswm
A very stupid window manager.
Stars: ✭ 28 (-90.85%)
Mutual labels:  x11
simple-opengl-loader
An extensible, cross-platform, single-header C/C++ OpenGL loader library.
Stars: ✭ 71 (-76.8%)
Mutual labels:  x11
x11-clipboard
x11 clipboard support for Rust
Stars: ✭ 28 (-90.85%)
Mutual labels:  x11
Basic wm
An example basic X11 window manager.
Stars: ✭ 271 (-11.44%)
Mutual labels:  x11
HiDPI-Fixer
Qt app that automates fractional scaling configuration on X11 desktops
Stars: ✭ 118 (-61.44%)
Mutual labels:  x11
magic-mirror-raspbian-lite
Magic Mirror for Raspbian Lite (works with Raspberry Pi Zero)
Stars: ✭ 25 (-91.83%)
Mutual labels:  x11
Xwinwrap
My fork of xwinwrap. Xwinwrap allows you to stick most of the apps to your desktop background.
Stars: ✭ 300 (-1.96%)
Mutual labels:  x11
X11vnc
a VNC server for real X displays
Stars: ✭ 272 (-11.11%)
Mutual labels:  x11
X11
A Haskell binding to the X11 graphics library.
Stars: ✭ 96 (-68.63%)
Mutual labels:  x11

xbanish

xbanish hides the mouse cursor when you start typing, and shows it again when the mouse cursor moves or a mouse button is pressed. This is similar to xterm's pointerMode setting, but xbanish works globally in the X11 session.

unclutter's -keystroke mode is supposed to do this, but it's broken. I looked into fixing it, but the unclutter source code is terrible, so I wrote xbanish.

The name comes from ratpoison's "banish" command that sends the cursor to the corner of the screen.

Implementation

If the XInput extension is supported, xbanish uses it to request input from all attached keyboards and mice. If XInput 2.2 is supported, raw mouse movement and button press inputs are requested which helps detect cursor movement while in certain applications such as Chromium.

If Xinput is not available, xbanish recurses through the list of windows starting at the root, and calls XSelectInput() on each window to receive notification of mouse motion, button presses, and key presses.

In response to any available keyboard input events, the cursor is hidden. On mouse movement or button events, the cursor is shown.

xbanish initially hid the cursor by calling XGrabPointer() with a blank cursor image, similar to unclutter's -grab mode, but this had problematic interactions with certain X applications. For example, xlock could not grab the pointer and sometimes didn't lock, xwininfo wouldn't work at all, Firefox would quickly hide the Awesome Bar dropdown as soon as a key was pressed, and xterm required two middle-clicks to paste the clipboard contents.

To avoid these problems and simplify the implementation, xbanish now uses the modern Xfixes extension to easily hide and show the cursor with XFixesHideCursor() and XFixesShowCursor().

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].