5

There are many similar questions (e. g. here, and on the forums), but all the answers are outdated - they are for xserver, lightdm, lxde etc., and not for Bookworm/Wayland.

So, how can we hide the mouse cursor in the latest Bookworm RPi OS? unclutter from apt doesn't work, it does nothing (the cursor never hides).

Violet Giraffe
  • 195
  • 2
  • 5
  • 14

3 Answers3

3

I've had success with installing the hideaway plugin for Interception Tools using the script below.

Adapted from https://forums.raspberrypi.com/viewtopic.php?t=358285#p2176499

#!/bin/bash
# hide mouse in wayland raspbian

sudo apt install -y interception-tools interception-tools-compat sudo apt install -y cmake cd ~ git clone https://gitlab.com/interception/linux/plugins/hideaway.git cd hideaway cmake -B build -DCMAKE_BUILD_TYPE=Release cmake --build build sudo cp /home/$USER/hideaway/build/hideaway /usr/bin sudo chmod +x /usr/bin/hideaway

cd ~ wget https://raw.githubusercontent.com/ugotapi/wayland-pagepi/main/config.yaml sudo cp /home/$USER/config.yaml /etc/interception/udevmon.d/config.yaml sudo systemctl restart udevmon

markd
  • 131
  • 2
2

wayfire itself doesn't come with this feature bundled, but can be easily extended through its complementary wayfire-plugins-extra package. Unfortunately, it is not available in the Bookworm repos.

I (very) recently had a similar requirement for a project and came up with a solution. You can find my full entry here. I'll pick what is relevant for your question:

Hide mouse pointer

1) Install wayfire-plugins-extra

Compiled Library:

  1. Download the correct library for your architecture from here (Compiled by me. Feel free to build from source)
  2. Decompress with tar xf /path/to/wayfire-plugins-extra-raspbian-<your-arch>.tar.xz
  3. Each plugin comes with .so and .xml files. You will need to copy those to their correct paths:
    sudo cp <desired-plugin>.so /usr/lib/<your-arch-linux-gnu>/wayfire/<desired-plugin>.so
    sudo cp <desired-plugin>.xml /usr/share/wayfire/metadata/<desired-plugin>.xml

Build from Source:

  1. Follow the instructions in https://github.com/seffs/wayfire-plugins-extra/. Install all required dev packages with
    sudo apt install libglibmm-2.4-dev libglm-dev libxml2-dev libpango1.0-dev libcairo2-dev wayfire-dev libwlroots-dev libwf-config-dev meson ninja-build
  2. Each plugin comes with .so and .xml files. meson should take care of the installation. Otherwise check if the following path exists for any new extra plugin:
    ls /usr/lib/<your-arch-linux-gnu>/wayfire/<new-extra-plugin>.so
    ls /usr/share/wayfire/metadata/<new-extra-plugin>.xml

2) Activate your plugin(s)

I was only interested in hiding the mouse pointer. This can be accomplished with the hide_cursor plugin. The same concept applies to the rest of plugins.

Open your ~/.config/wayfire.init file and adjust the following:

[core]
plugins = \
        autostart \
        ### We need to add the extra plugin to the list ###
        hide-cursor

Launch wayfire once again. You'll notice that the mouse pointer disappeared.

seffs
  • 36
  • 3
2

I used ydotool (similar to xdotool for X11) to move the mouse pointer off screen, on my RPi4.

The HOWTO is described here: https://askubuntu.com/questions/1470593/how-can-i-write-a-program-to-press-keys-such-as-windows-d-in-wayland-repla/1473061#1473061

And below the summary + some additions:

1/ Obtain build tools

sudo apt install git cmake scdoc

2/ Get the latest version off GitHub (note: ydotool on the RPi apt sources will not work) and build

git clone https://github.com/ReimuNotMoe/ydotool.git
cd ydotool
mkdir build
cd build
cmake ..
time make -j "$(nproc)"
sudo make install

4/ Verify version:

$ ydotoold --version
v1.0.4-33-gb0c5da3

3/ Run the daemon and connect to the socket, to test

sudo -b /usr/local/bin/ydotoold --socket-path="$HOME/.ydotool_socket" --socket-own="$(id -u):$(id -g)"
YDOTOOL_SOCKET="$HOME/.ydotool_socket" /usr/local/bin/ydotool mousemove -a -x 1800 -y 1000

4/ Allow ydotoold to execute without the need for entering the sudo password

sudo visudo /etc/sudoers
myuser ALL=(ALL)NOPASSWD: /usr/local/bin/ydotoold

5/ Use systemd or similar to start ydotoold at boot and move the mouse pointer (using the two commands under step 3).

SaeX
  • 123
  • 4