Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto Mouse Hiding Enhancement #23

Open
andiohn opened this issue Jul 22, 2024 · 8 comments
Open

Auto Mouse Hiding Enhancement #23

andiohn opened this issue Jul 22, 2024 · 8 comments
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Milestone

Comments

@andiohn
Copy link

andiohn commented Jul 22, 2024

Seems like this would be a good option here:

https://raspberrypi.stackexchange.com/questions/145382/remove-hide-mouse-cursor-when-idle-on-rasbperry-pi-os-bookworm/145390#145390

2

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
@debloper
Copy link
Owner

Thank you... let's make it part of 3.0 release!

@debloper debloper modified the milestones: v3.0.0, .NEXT Jul 23, 2024
@debloper
Copy link
Owner

On a second thought, going to postpone this feature to round back at later.

None of the existing solutions are up to the mark in terms of quality of implementation. They have all sorts of issues - from dependencies to distributions & everything in-between. They do not follow the "do one thing, and one thing well" methodology & hence suffer from the feature overloading problem. Half of them are also tied to specific display server or compositor, even though this can be done by directly talking to the Kernel.

The one that comes closest is ydotool, but aptitude installs an older broken version v0.1.8, and the new versions (v1.0.x) don't have ARM release. So, we'll have to build/distribute it ourselves, and potentially risk becoming a (supply chain exploit vector), which is on the rise recently. So I am not walking into that.

If I really have to build C code anyway, I'd rather write a better/leaner implementation.

All that's needed is to send input_event to kernel to proper device/stream... something like:

// NOTE: IT'S NOT VALIDATED & SHOUDN'T WORK
// THIS IS JUST A REFERENCE, NOT AN EXAMPLE
// I NEED TO FIND THE DEVICE TO fwrite() TO

#include <linux/input.h>

void main (int argc, char *argv[]) {
    struct input_event ie;

    ie.type = EV_REL;
    ie.code = REL_X;
    ie.value = 1000;

    fwrite(&ie, sizeof ie, 1, THE_INPUT_DEVICE_TO_HANDLE_THIS);
    // you can include stdio.h & use `stdout` to fwrite to
    // that should allow you to compile & run it
    // and spit event bytecode in terminal... xP

    return;
}

But we'll come back to it at a later point. Meanwhile, 👍 the issue to flag it as important, to help me prioritize this.

@debloper debloper added enhancement New feature or request help wanted Extra attention is needed labels Jul 29, 2024
@andiohn
Copy link
Author

andiohn commented Oct 3, 2024

I wonder if all it had to do was to send the mouse into the bottom right or something after 10 minutes of boot up. Do that once. Easy, effective :)

@andiohn
Copy link
Author

andiohn commented Oct 3, 2024

Holy crap, I might have found a solution:
https://gabrielstaples.com/ydotool-tutorial/#gsc.tab=0

ydotool

@andiohn
Copy link
Author

andiohn commented Oct 3, 2024

"ydotool mousemove -x 0 -y 0" should put it to the top left. Might be good enough...

@andiohn
Copy link
Author

andiohn commented Oct 3, 2024

https://askubuntu.com/questions/956640/equivalent-to-xdotool-for-wayland

wtype and evemu might be better even. No need to reinvent the wheel, just move the mouse. :)

@debloper
Copy link
Owner

debloper commented Oct 7, 2024

As mentioned before, the problem here is:

The one that comes closest is ydotool, but aptitude installs an older broken version v0.1.8, and the new versions (v1.0.x) don't have ARM release. So, we'll have to build/distribute it ourselves, and potentially risk becoming a (supply chain exploit vector), which is on the rise recently. So I am not walking into that.

Which means, I don't wanna take responsibility for building and distributing binary of a third party solution... but, you (and anyone else needing this feature) can totally use it for themselves.

If you can please write down the method you've followed to make it work for yourself, then I can mark that as the solution and close this issue for now.

@debloper debloper added the question Further information is requested label Oct 7, 2024
@andiohn
Copy link
Author

andiohn commented Oct 10, 2024

Ya, good point. I used the solution from the first one. I just found that "Wayfire extra plugins" has a hide cursor plugin, perhaps that would be a good starting point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants