Carousel: Gestures somewm-only
You will learn
- How to enable 3-finger swipe viewport panning
- How the gesture tracking and snap behavior works
- How to set up gestures for the vertical variant
- How to adjust scroll animation speed
- How to remove a gesture binding
Enable 3-Finger Swipe
One line in your rc.lua enables touchpad gesture scrolling:
awful.layout.suit.carousel.make_gesture_binding()
This creates a 3-finger swipe binding that pans the carousel viewport horizontally. Place it after your keybinding setup.
How It Works
The gesture has three phases:
- Trigger. When a 3-finger swipe begins on a screen using the carousel layout, the current animation is stopped and the starting scroll position is recorded.
- Track. During the swipe, the viewport follows your fingers 1:1. Moving three fingers left scrolls the strip to the right (revealing columns on the right).
- Snap. On release, the viewport animates to center the column nearest to the viewport's center and focuses that column's first client.
The snap animation uses the same scroll_duration and easing curve as keyboard-driven scrolling.
Vertical Variant
For the vertical carousel, use the vertical gesture binding:
awful.layout.suit.carousel.vertical.make_gesture_binding()
This responds to vertical 3-finger swipes (dy axis) instead of horizontal.
You can enable both if you use both carousel orientations:
local carousel = awful.layout.suit.carousel
carousel.make_gesture_binding()
carousel.vertical.make_gesture_binding()
Adjust Animation Speed
The snap animation on release uses carousel.scroll_duration. To make it faster or slower:
-- Snappy 100ms snap
awful.layout.suit.carousel.scroll_duration = 0.1
-- Slower 400ms snap
awful.layout.suit.carousel.scroll_duration = 0.4
-- Instant snap (no animation)
awful.layout.suit.carousel.scroll_duration = 0
This also affects keyboard-driven scroll animations.
Remove a Gesture Binding
make_gesture_binding() returns a gesture binding object. Store it and call :remove() to unbind:
local carousel = awful.layout.suit.carousel
local binding = carousel.make_gesture_binding()
-- Later, to remove it:
binding:remove()
See Also
- Carousel API Reference - Full property and function documentation
- Centering Modes Guide - Control how the viewport follows focus
- Scrollable Tiling - How the animation system works