hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.44k stars 897 forks source link

Expose cursor activity in hyprctl #6720

Open wwaltb opened 4 months ago

wwaltb commented 4 months ago

Description

Is there a way to check if the cursor is active (shown on screen) using hyprctl? I am wanting to use this information to add a keyboard layer whenever the cursors is active.

fufexan commented 4 months ago

You can check where the cursor is with hyprctl cursorpos, which gives you x, y coordinates of the entire screen (all outputs combined). Depending on how you've laid out the monitors, you can make a script to check which screen the cursor is on.

An alternative/easier solution is to listen on the socket for focusedmon events.