input: emit Lua signal for switch toggle events#624
Conversation
|
Oh this is great! Will test later today or tomorrow hopefully. |
|
Tested. Works for me as advertised. Thank you so much! Code looks clean (within the limits of my ability to review it 😄 ) I'm a bit sad we can't support |
|
It compiles locally for me supporting |
|
If you compile the current PR with newer wlroots it should register that device as |
|
Oh yeah! I wasn't aware they backported it to 0.19.x! I only followed it up to the time it was accepted in 0.20. I guess we shall bump the version in CI then @trip-zip to the latest 0.19.x release so we can have all libinput supported switches 😄 |
|
this commit should pass once they update the CI. |
Description
This adds support for libinput switch devices, including laptop lid switches, tablet mode switches, and keypad slide switches.
When wlroots reports a switch toggle event, somewm now emits the global Lua signal
switch::togglewith a table payload:device_name: the switch device nametype:"lid","tablet_mode", or"unknown"(WLR_SWITCH_TYPE_KEYPAD_SLIDEcan be added if wlr 0.19.x version is increased)state:"on"or"off"Closes #519
Test Plan
I tested with the following code and my laptop lid switch. It would be difficult to write a unit test as I don't see an easy way to spoof switch inputs.
Checklist
lua/awful/,lua/gears/,lua/wibox/,lua/naughty/) are not modified — if a bug surfaces in Lua, the fix belongs in Cmake test-unit && make test-integration)