1.8 KiB
1.8 KiB
swaystick
swaystick reads input from a DualSense controller and binds its buttons to actions in the Sway window manager.
Could possibly work with previous DualShock models and perhaps even other gamepads. I've only tested it with a regular DualSense pad.
Uses the limited Linux joystick API. Based on Jason White's joystick demo.
usage
Compile with cc -o swaystick swaystick.c, and start it up with
./swaystick. With one joystick/controller plugged in it should work
fine but if it doesn't or if the wrong keys are being picked up,
specify a custom joystick device with ./swaystick /dev/input/jsX.
binds
Reference "DualSense wireless controller part names" for the names of any buttons listed here.
| Button | Action |
|---|---|
| Left stick | Move focused window |
| Cross | Kill focused window |
| Circle | Toggle between tiled windows and floating windows |
| Triangle | Teleport focused window to cursor |
| Square | Toggle whether the focused window is floating |
| L1 | Switch to previous workspace |
| R1 | Switch to next workspace |
| L2 | Focus previous window |
| R2 | Focus next window |
| Create | Collapse all windows |
| Options | Expand all windows |
| PS | Spawn an Emacs window (customizable) |