hl.dsp.focus

hl.dsp.focus(spec)

Create a focus dispatcher.

Signature

hl.dsp.focus(spec: table): HL.Dispatcher

Parameters

spectable

Focus operation table. Must contain one recognized focus field.

Accepted fields

directionstring, optional

Direction to move focus.

Accepted values:

  • left

  • right

  • up

  • down

Short aliases are also accepted by the shared direction parser.

monitorHL.MonitorSelector, optional

Focus the selected monitor.

workspaceHL.WorkspaceSelector, optional

Focus the selected workspace.

on_current_monitorboolean, optional

Only used with workspace. If true, changes to the selected workspace on the current monitor.

windowHL.WindowSelector, optional

Focus the selected window.

urgent_or_lastboolean, optional

If true, focus the urgent window, or the last window if no urgent window is available.

lastboolean, optional

If true, focus the current or last window.

Returns

dispatcherHL.Dispatcher

Dispatcher object that performs the focus operation when executed.

Examples

hl.bind("SUPER + H", hl.dsp.focus({
    direction = "left",
}))

hl.dispatch(hl.dsp.focus({
    monitor = "DP-1",
}))

hl.dispatch(hl.dsp.focus({
    workspace = 3,
    on_current_monitor = true,
}))

Notes

If multiple recognized fields are present, the first matching field in this order is used: direction, monitor, workspace, window, urgent_or_last, last.

See also

HL.Dispatcher

Dispatcher object returned by this function.

hl.bind()

Bind a dispatcher to a key.

hl.dispatch()

Execute a dispatcher immediately.