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

Add Touchpad widget #4652

Closed
wants to merge 13 commits into from
Closed

Conversation

serweryn617
Copy link
Contributor

A widget that shows touchpad state and allows to toggle it with mouse click or keybind.

What are your thoughts?

@serweryn617 serweryn617 marked this pull request as draft January 20, 2024 19:59
@serweryn617 serweryn617 marked this pull request as ready for review January 20, 2024 21:43
Copy link
Member

@elParaguayo elParaguayo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. I don't have any particular objections to including in the main repo but have made some comments.

I would like to include a test for this widget, particularly to test the use of custom get/set_state_func functions.

libqtile/widget/touchpad.py Outdated Show resolved Hide resolved
libqtile/widget/touchpad.py Outdated Show resolved Hide resolved
@serweryn617
Copy link
Contributor Author

I've added unit tests, updated everything and tested if it works. Everything looks good.

@elParaguayo
Copy link
Member

You need to ignore the widget in this test:

no_test = [widgets.Mirror, widgets.PulseVolume] # Mirror requires a reflection object
no_test += [widgets.ImapWidget] # Requires a configured username

@serweryn617
Copy link
Contributor Author

serweryn617 commented Jan 21, 2024

Looks like it's only a subprocess call that fails because it requires xinput.
I can also just add an override for the device_id parameter so this call is never executed.
I don't know what would be a better option.

+overrides = [
+    (widgets.Touchpad, {"device_id": "0"}),  # Touchpad requires device id or working xinput
+]

@elParaguayo
Copy link
Member

If you can get it to work with the override, that's better.

@serweryn617
Copy link
Contributor Author

Should be good now. Are there any other tests that run on all widgets? I only checked the ones I've added, not the entire suite

@elParaguayo
Copy link
Member

One other thought, does this work in Wayland?

@serweryn617
Copy link
Contributor Author

The default functions probably not. I don't really have a way to test it.

@elParaguayo
Copy link
Member

Ok. Pinging @jwijenbergh to see if he knows if it can be done on Wayland.

If not, you can set supported_backends = {"x11"} as a class attribute of your widget.

@serweryn617
Copy link
Contributor Author

I suppose I could use libinput on Wayland instead of xinput?

I'll test it tomorrow.

@serweryn617
Copy link
Contributor Author

I've added X11 as the only supported backend.

If you are OK with it, I would like to close this PR. I can create a new one, with Wayland support later, but I need to prepare my environment first and look into how it all works on Wayland.

@serweryn617
Copy link
Contributor Author

Is there anything else I should add/change @elParaguayo ?

Copy link

github-actions bot commented Jul 5, 2024

This PR is stale because it has been open 90 days with no activity. Remove the status: stale label or comment, or this will be closed in 30 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants