Sweets
Configuration

Input

Configure libinput pointer devices globally or per-device — sweets.input.

sweets.input(...) configures physical libinput pointer devices.

On startup, on reload, and for newly connected devices, Sweets resets configurable fields to libinput defaults, applies the global block, then applies matching selector blocks in config order.

sweets.input({
  accel_speed = 0.0,
})

sweets.input("touchpad", {
  tap = true,
  natural_scroll = true,
  disable_while_typing = true,
})

sweets.input("mouse", {
  natural_scroll = false,
  accel_profile = "flat",
})

sweets.input("name:ELAN", {
  accel_speed = -0.25,
})

Selectors

Call sweets.input({ ... }) with no selector to target every device, or pass a selector to target a subset.

SelectorMatches
pointerAny physical libinput pointer device
touchpadTapping-capable pointers, normally laptop touchpads
mousePointers not detected as touchpads
name:TEXTCase-insensitive device-name substring

sweetctl inputs lists connected devices and pointer types. sweetctl input TEXT shows one device's supported, current, and default libinput settings.

This keeps natural scrolling on the touchpad only:

sweets.input({
  accel_speed = 0.0,
})

sweets.input("touchpad", { natural_scroll = true })
sweets.input("mouse", { natural_scroll = false })

Live tuning

Tune a setting without reloading:

sweetctl input ELAN accel_speed -0.25
sweetctl input ELAN natural_scroll true
sweetctl input "Logitech USB Optical Mouse" accel_profile flat

Setting names and values match the options below. Changes are temporary — a reload, reconnect, or restart resets them. Once a value feels right, add it to the matching sweets.input(...) block.

Options

KeyTypeDefaultDescription
tapboollibinputEnable tap-to-click
tap_dragboollibinputEnable tap-and-drag
tap_drag_lockboollibinputEnable tap-drag-lock
natural_scrollboollibinputReverse scroll direction
left_handedboollibinputSwap left/right buttons
middle_emulationboollibinputEmulate middle click from left+right
disable_while_typingboollibinputDisable touchpad motion while typing
accel_speednumberlibinputPointer acceleration, -1.0 to 1.0
accel_profilestringlibinputadaptive or flat

These settings are skipped for virtual pointers and non-libinput nested devices. Unsupported settings are ignored per device, so one block works across a mouse, touchpad, and trackpoint.

On this page