Action

Enum Action 

Source
pub enum Action {
Show 139 variants Quit { skip_confirmation: bool, }, PowerOffMonitors {}, PowerOnMonitors {}, Spawn { command: Vec<String>, }, SpawnSh { command: String, }, DoScreenTransition { delay_ms: Option<u16>, }, Screenshot { show_pointer: bool, }, ScreenshotScreen { write_to_disk: bool, show_pointer: bool, }, ScreenshotWindow { id: Option<u64>, write_to_disk: bool, }, ToggleKeyboardShortcutsInhibit {}, CloseWindow { id: Option<u64>, }, FullscreenWindow { id: Option<u64>, }, ToggleWindowedFullscreen { id: Option<u64>, }, FocusWindow { id: u64, }, FocusWindowInColumn { index: u8, }, FocusWindowPrevious {}, FocusColumnLeft {}, FocusColumnRight {}, FocusColumnFirst {}, FocusColumnLast {}, FocusColumnRightOrFirst {}, FocusColumnLeftOrLast {}, FocusColumn { index: usize, }, FocusWindowOrMonitorUp {}, FocusWindowOrMonitorDown {}, FocusColumnOrMonitorLeft {}, FocusColumnOrMonitorRight {}, FocusWindowDown {}, FocusWindowUp {}, FocusWindowDownOrColumnLeft {}, FocusWindowDownOrColumnRight {}, FocusWindowUpOrColumnLeft {}, FocusWindowUpOrColumnRight {}, FocusWindowOrWorkspaceDown {}, FocusWindowOrWorkspaceUp {}, FocusWindowTop {}, FocusWindowBottom {}, FocusWindowDownOrTop {}, FocusWindowUpOrBottom {}, MoveColumnLeft {}, MoveColumnRight {}, MoveColumnToFirst {}, MoveColumnToLast {}, MoveColumnLeftOrToMonitorLeft {}, MoveColumnRightOrToMonitorRight {}, MoveColumnToIndex { index: usize, }, MoveWindowDown {}, MoveWindowUp {}, MoveWindowDownOrToWorkspaceDown {}, MoveWindowUpOrToWorkspaceUp {}, ConsumeOrExpelWindowLeft { id: Option<u64>, }, ConsumeOrExpelWindowRight { id: Option<u64>, }, ConsumeWindowIntoColumn {}, ExpelWindowFromColumn {}, SwapWindowRight {}, SwapWindowLeft {}, ToggleColumnTabbedDisplay {}, SetColumnDisplay { display: ColumnDisplay, }, CenterColumn {}, CenterWindow { id: Option<u64>, }, CenterVisibleColumns {}, FocusWorkspaceDown {}, FocusWorkspaceUp {}, FocusWorkspace { reference: WorkspaceReferenceArg, }, FocusWorkspacePrevious {}, MoveWindowToWorkspaceDown { focus: bool, }, MoveWindowToWorkspaceUp { focus: bool, }, MoveWindowToWorkspace { window_id: Option<u64>, reference: WorkspaceReferenceArg, focus: bool, }, MoveColumnToWorkspaceDown { focus: bool, }, MoveColumnToWorkspaceUp { focus: bool, }, MoveColumnToWorkspace { reference: WorkspaceReferenceArg, focus: bool, }, MoveWorkspaceDown {}, MoveWorkspaceUp {}, MoveWorkspaceToIndex { index: usize, reference: Option<WorkspaceReferenceArg>, }, SetWorkspaceName { name: String, workspace: Option<WorkspaceReferenceArg>, }, UnsetWorkspaceName { reference: Option<WorkspaceReferenceArg>, }, FocusMonitorLeft {}, FocusMonitorRight {}, FocusMonitorDown {}, FocusMonitorUp {}, FocusMonitorPrevious {}, FocusMonitorNext {}, FocusMonitor { output: String, }, MoveWindowToMonitorLeft {}, MoveWindowToMonitorRight {}, MoveWindowToMonitorDown {}, MoveWindowToMonitorUp {}, MoveWindowToMonitorPrevious {}, MoveWindowToMonitorNext {}, MoveWindowToMonitor { id: Option<u64>, output: String, }, MoveColumnToMonitorLeft {}, MoveColumnToMonitorRight {}, MoveColumnToMonitorDown {}, MoveColumnToMonitorUp {}, MoveColumnToMonitorPrevious {}, MoveColumnToMonitorNext {}, MoveColumnToMonitor { output: String, }, SetWindowWidth { id: Option<u64>, change: SizeChange, }, SetWindowHeight { id: Option<u64>, change: SizeChange, }, ResetWindowHeight { id: Option<u64>, }, SwitchPresetColumnWidth {}, SwitchPresetColumnWidthBack {}, SwitchPresetWindowWidth { id: Option<u64>, }, SwitchPresetWindowWidthBack { id: Option<u64>, }, SwitchPresetWindowHeight { id: Option<u64>, }, SwitchPresetWindowHeightBack { id: Option<u64>, }, MaximizeColumn {}, SetColumnWidth { change: SizeChange, }, ExpandColumnToAvailableWidth {}, SwitchLayout { layout: LayoutSwitchTarget, }, ShowHotkeyOverlay {}, MoveWorkspaceToMonitorLeft {}, MoveWorkspaceToMonitorRight {}, MoveWorkspaceToMonitorDown {}, MoveWorkspaceToMonitorUp {}, MoveWorkspaceToMonitorPrevious {}, MoveWorkspaceToMonitorNext {}, MoveWorkspaceToMonitor { output: String, reference: Option<WorkspaceReferenceArg>, }, ToggleDebugTint {}, DebugToggleOpaqueRegions {}, DebugToggleDamage {}, ToggleWindowFloating { id: Option<u64>, }, MoveWindowToFloating { id: Option<u64>, }, MoveWindowToTiling { id: Option<u64>, }, FocusFloating {}, FocusTiling {}, SwitchFocusBetweenFloatingAndTiling {}, MoveFloatingWindow { id: Option<u64>, x: PositionChange, y: PositionChange, }, ToggleWindowRuleOpacity { id: Option<u64>, }, SetDynamicCastWindow { id: Option<u64>, }, SetDynamicCastMonitor { output: Option<String>, }, ClearDynamicCastTarget {}, ToggleOverview {}, OpenOverview {}, CloseOverview {}, ToggleWindowUrgent { id: u64, }, SetWindowUrgent { id: u64, }, UnsetWindowUrgent { id: u64, }, LoadConfigFile {},
}
Expand description

Actions that niri can perform.

Variants§

§

Quit

Exit niri.

Fields

§skip_confirmation: bool

Skip the “Press Enter to confirm” prompt.

§

PowerOffMonitors

Power off all monitors via DPMS.

§

PowerOnMonitors

Power on all monitors via DPMS.

§

Spawn

Spawn a command.

Fields

§command: Vec<String>

Command to spawn.

§

SpawnSh

Spawn a command through the shell.

Fields

§command: String

Command to run.

§

DoScreenTransition

Do a screen transition.

Fields

§delay_ms: Option<u16>

Delay in milliseconds for the screen to freeze before starting the transition.

§

Screenshot

Open the screenshot UI.

Fields

§show_pointer: bool

Whether to show the mouse pointer by default in the screenshot UI.

§

ScreenshotScreen

Screenshot the focused screen.

Fields

§write_to_disk: bool

Write the screenshot to disk in addition to putting it in your clipboard.

The screenshot is saved according to the screenshot-path config setting.

§show_pointer: bool

Whether to include the mouse pointer in the screenshot.

§

ScreenshotWindow

Screenshot a window.

Fields

§id: Option<u64>

Id of the window to screenshot.

If None, uses the focused window.

§write_to_disk: bool

Write the screenshot to disk in addition to putting it in your clipboard.

The screenshot is saved according to the screenshot-path config setting.

§

ToggleKeyboardShortcutsInhibit

Enable or disable the keyboard shortcuts inhibitor (if any) for the focused surface.

§

CloseWindow

Close a window.

Fields

§id: Option<u64>

Id of the window to close.

If None, uses the focused window.

§

FullscreenWindow

Toggle fullscreen on a window.

Fields

§id: Option<u64>

Id of the window to toggle fullscreen of.

If None, uses the focused window.

§

ToggleWindowedFullscreen

Toggle windowed (fake) fullscreen on a window.

Fields

§id: Option<u64>

Id of the window to toggle windowed fullscreen of.

If None, uses the focused window.

§

FocusWindow

Focus a window by id.

Fields

§id: u64

Id of the window to focus.

§

FocusWindowInColumn

Focus a window in the focused column by index.

Fields

§index: u8

Index of the window in the column.

The index starts from 1 for the topmost window.

§

FocusWindowPrevious

Focus the previously focused window.

§

FocusColumnLeft

Focus the column to the left.

§

FocusColumnRight

Focus the column to the right.

§

FocusColumnFirst

Focus the first column.

§

FocusColumnLast

Focus the last column.

§

FocusColumnRightOrFirst

Focus the next column to the right, looping if at end.

§

FocusColumnLeftOrLast

Focus the next column to the left, looping if at start.

§

FocusColumn

Focus a column by index.

Fields

§index: usize

Index of the column to focus.

The index starts from 1 for the first column.

§

FocusWindowOrMonitorUp

Focus the window or the monitor above.

§

FocusWindowOrMonitorDown

Focus the window or the monitor below.

§

FocusColumnOrMonitorLeft

Focus the column or the monitor to the left.

§

FocusColumnOrMonitorRight

Focus the column or the monitor to the right.

§

FocusWindowDown

Focus the window below.

§

FocusWindowUp

Focus the window above.

§

FocusWindowDownOrColumnLeft

Focus the window below or the column to the left.

§

FocusWindowDownOrColumnRight

Focus the window below or the column to the right.

§

FocusWindowUpOrColumnLeft

Focus the window above or the column to the left.

§

FocusWindowUpOrColumnRight

Focus the window above or the column to the right.

§

FocusWindowOrWorkspaceDown

Focus the window or the workspace below.

§

FocusWindowOrWorkspaceUp

Focus the window or the workspace above.

§

FocusWindowTop

Focus the topmost window.

§

FocusWindowBottom

Focus the bottommost window.

§

FocusWindowDownOrTop

Focus the window below or the topmost window.

§

FocusWindowUpOrBottom

Focus the window above or the bottommost window.

§

MoveColumnLeft

Move the focused column to the left.

§

MoveColumnRight

Move the focused column to the right.

§

MoveColumnToFirst

Move the focused column to the start of the workspace.

§

MoveColumnToLast

Move the focused column to the end of the workspace.

§

MoveColumnLeftOrToMonitorLeft

Move the focused column to the left or to the monitor to the left.

§

MoveColumnRightOrToMonitorRight

Move the focused column to the right or to the monitor to the right.

§

MoveColumnToIndex

Move the focused column to a specific index on its workspace.

Fields

§index: usize

New index for the column.

The index starts from 1 for the first column.

§

MoveWindowDown

Move the focused window down in a column.

§

MoveWindowUp

Move the focused window up in a column.

§

MoveWindowDownOrToWorkspaceDown

Move the focused window down in a column or to the workspace below.

§

MoveWindowUpOrToWorkspaceUp

Move the focused window up in a column or to the workspace above.

§

ConsumeOrExpelWindowLeft

Consume or expel a window left.

Fields

§id: Option<u64>

Id of the window to consume or expel.

If None, uses the focused window.

§

ConsumeOrExpelWindowRight

Consume or expel a window right.

Fields

§id: Option<u64>

Id of the window to consume or expel.

If None, uses the focused window.

§

ConsumeWindowIntoColumn

Consume the window to the right into the focused column.

§

ExpelWindowFromColumn

Expel the focused window from the column.

§

SwapWindowRight

Swap focused window with one to the right.

§

SwapWindowLeft

Swap focused window with one to the left.

§

ToggleColumnTabbedDisplay

Toggle the focused column between normal and tabbed display.

§

SetColumnDisplay

Set the display mode of the focused column.

Fields

§display: ColumnDisplay

Display mode to set.

§

CenterColumn

Center the focused column on the screen.

§

CenterWindow

Center a window on the screen.

Fields

§id: Option<u64>

Id of the window to center.

If None, uses the focused window.

§

CenterVisibleColumns

Center all fully visible columns on the screen.

§

FocusWorkspaceDown

Focus the workspace below.

§

FocusWorkspaceUp

Focus the workspace above.

§

FocusWorkspace

Focus a workspace by reference (index or name).

Fields

§reference: WorkspaceReferenceArg

Reference (index or name) of the workspace to focus.

§

FocusWorkspacePrevious

Focus the previous workspace.

§

MoveWindowToWorkspaceDown

Move the focused window to the workspace below.

Fields

§focus: bool

Whether the focus should follow the target workspace.

If true (the default), the focus will follow the window to the new workspace. If false, the focus will remain on the original workspace.

§

MoveWindowToWorkspaceUp

Move the focused window to the workspace above.

Fields

§focus: bool

Whether the focus should follow the target workspace.

If true (the default), the focus will follow the window to the new workspace. If false, the focus will remain on the original workspace.

§

MoveWindowToWorkspace

Move a window to a workspace.

Fields

§window_id: Option<u64>

Id of the window to move.

If None, uses the focused window.

§reference: WorkspaceReferenceArg

Reference (index or name) of the workspace to move the window to.

§focus: bool

Whether the focus should follow the moved window.

If true (the default) and the window to move is focused, the focus will follow the window to the new workspace. If false, the focus will remain on the original workspace.

§

MoveColumnToWorkspaceDown

Move the focused column to the workspace below.

Fields

§focus: bool

Whether the focus should follow the target workspace.

If true (the default), the focus will follow the column to the new workspace. If false, the focus will remain on the original workspace.

§

MoveColumnToWorkspaceUp

Move the focused column to the workspace above.

Fields

§focus: bool

Whether the focus should follow the target workspace.

If true (the default), the focus will follow the column to the new workspace. If false, the focus will remain on the original workspace.

§

MoveColumnToWorkspace

Move the focused column to a workspace by reference (index or name).

Fields

§reference: WorkspaceReferenceArg

Reference (index or name) of the workspace to move the column to.

§focus: bool

Whether the focus should follow the target workspace.

If true (the default), the focus will follow the column to the new workspace. If false, the focus will remain on the original workspace.

§

MoveWorkspaceDown

Move the focused workspace down.

§

MoveWorkspaceUp

Move the focused workspace up.

§

MoveWorkspaceToIndex

Move a workspace to a specific index on its monitor.

Fields

§index: usize

New index for the workspace.

§reference: Option<WorkspaceReferenceArg>

Reference (index or name) of the workspace to move.

If None, uses the focused workspace.

§

SetWorkspaceName

Set the name of a workspace.

Fields

§name: String

New name for the workspace.

§workspace: Option<WorkspaceReferenceArg>

Reference (index or name) of the workspace to name.

If None, uses the focused workspace.

§

UnsetWorkspaceName

Unset the name of a workspace.

Fields

§reference: Option<WorkspaceReferenceArg>

Reference (index or name) of the workspace to unname.

If None, uses the focused workspace.

§

FocusMonitorLeft

Focus the monitor to the left.

§

FocusMonitorRight

Focus the monitor to the right.

§

FocusMonitorDown

Focus the monitor below.

§

FocusMonitorUp

Focus the monitor above.

§

FocusMonitorPrevious

Focus the previous monitor.

§

FocusMonitorNext

Focus the next monitor.

§

FocusMonitor

Focus a monitor by name.

Fields

§output: String

Name of the output to focus.

§

MoveWindowToMonitorLeft

Move the focused window to the monitor to the left.

§

MoveWindowToMonitorRight

Move the focused window to the monitor to the right.

§

MoveWindowToMonitorDown

Move the focused window to the monitor below.

§

MoveWindowToMonitorUp

Move the focused window to the monitor above.

§

MoveWindowToMonitorPrevious

Move the focused window to the previous monitor.

§

MoveWindowToMonitorNext

Move the focused window to the next monitor.

§

MoveWindowToMonitor

Move a window to a specific monitor.

Fields

§id: Option<u64>

Id of the window to move.

If None, uses the focused window.

§output: String

The target output name.

§

MoveColumnToMonitorLeft

Move the focused column to the monitor to the left.

§

MoveColumnToMonitorRight

Move the focused column to the monitor to the right.

§

MoveColumnToMonitorDown

Move the focused column to the monitor below.

§

MoveColumnToMonitorUp

Move the focused column to the monitor above.

§

MoveColumnToMonitorPrevious

Move the focused column to the previous monitor.

§

MoveColumnToMonitorNext

Move the focused column to the next monitor.

§

MoveColumnToMonitor

Move the focused column to a specific monitor.

Fields

§output: String

The target output name.

§

SetWindowWidth

Change the width of a window.

Fields

§id: Option<u64>

Id of the window whose width to set.

If None, uses the focused window.

§change: SizeChange

How to change the width.

§

SetWindowHeight

Change the height of a window.

Fields

§id: Option<u64>

Id of the window whose height to set.

If None, uses the focused window.

§change: SizeChange

How to change the height.

§

ResetWindowHeight

Reset the height of a window back to automatic.

Fields

§id: Option<u64>

Id of the window whose height to reset.

If None, uses the focused window.

§

SwitchPresetColumnWidth

Switch between preset column widths.

§

SwitchPresetColumnWidthBack

Switch between preset column widths backwards.

§

SwitchPresetWindowWidth

Switch between preset window widths.

Fields

§id: Option<u64>

Id of the window whose width to switch.

If None, uses the focused window.

§

SwitchPresetWindowWidthBack

Switch between preset window widths backwards.

Fields

§id: Option<u64>

Id of the window whose width to switch.

If None, uses the focused window.

§

SwitchPresetWindowHeight

Switch between preset window heights.

Fields

§id: Option<u64>

Id of the window whose height to switch.

If None, uses the focused window.

§

SwitchPresetWindowHeightBack

Switch between preset window heights backwards.

Fields

§id: Option<u64>

Id of the window whose height to switch.

If None, uses the focused window.

§

MaximizeColumn

Toggle the maximized state of the focused column.

§

SetColumnWidth

Change the width of the focused column.

Fields

§change: SizeChange

How to change the width.

§

ExpandColumnToAvailableWidth

Expand the focused column to space not taken up by other fully visible columns.

§

SwitchLayout

Switch between keyboard layouts.

Fields

§layout: LayoutSwitchTarget

Layout to switch to.

§

ShowHotkeyOverlay

Show the hotkey overlay.

§

MoveWorkspaceToMonitorLeft

Move the focused workspace to the monitor to the left.

§

MoveWorkspaceToMonitorRight

Move the focused workspace to the monitor to the right.

§

MoveWorkspaceToMonitorDown

Move the focused workspace to the monitor below.

§

MoveWorkspaceToMonitorUp

Move the focused workspace to the monitor above.

§

MoveWorkspaceToMonitorPrevious

Move the focused workspace to the previous monitor.

§

MoveWorkspaceToMonitorNext

Move the focused workspace to the next monitor.

§

MoveWorkspaceToMonitor

Move a workspace to a specific monitor.

Fields

§output: String

The target output name.

§reference: Option<WorkspaceReferenceArg>

If None, uses the focused workspace.

§

ToggleDebugTint

Toggle a debug tint on windows.

§

DebugToggleOpaqueRegions

Toggle visualization of render element opaque regions.

§

DebugToggleDamage

Toggle visualization of output damage.

§

ToggleWindowFloating

Move the focused window between the floating and the tiling layout.

Fields

§id: Option<u64>

Id of the window to move.

If None, uses the focused window.

§

MoveWindowToFloating

Move the focused window to the floating layout.

Fields

§id: Option<u64>

Id of the window to move.

If None, uses the focused window.

§

MoveWindowToTiling

Move the focused window to the tiling layout.

Fields

§id: Option<u64>

Id of the window to move.

If None, uses the focused window.

§

FocusFloating

Switches focus to the floating layout.

§

FocusTiling

Switches focus to the tiling layout.

§

SwitchFocusBetweenFloatingAndTiling

Toggles the focus between the floating and the tiling layout.

§

MoveFloatingWindow

Move a floating window on screen.

Fields

§id: Option<u64>

Id of the window to move.

If None, uses the focused window.

§x: PositionChange

How to change the X position.

§y: PositionChange

How to change the Y position.

§

ToggleWindowRuleOpacity

Toggle the opacity of a window.

Fields

§id: Option<u64>

Id of the window.

If None, uses the focused window.

§

SetDynamicCastWindow

Set the dynamic cast target to a window.

Fields

§id: Option<u64>

Id of the window to target.

If None, uses the focused window.

§

SetDynamicCastMonitor

Set the dynamic cast target to a monitor.

Fields

§output: Option<String>

Name of the output to target.

If None, uses the focused output.

§

ClearDynamicCastTarget

Clear the dynamic cast target, making it show nothing.

§

ToggleOverview

Toggle (open/close) the Overview.

§

OpenOverview

Open the Overview.

§

CloseOverview

Close the Overview.

§

ToggleWindowUrgent

Toggle urgent status of a window.

Fields

§id: u64

Id of the window to toggle urgent.

§

SetWindowUrgent

Set urgent status of a window.

Fields

§id: u64

Id of the window to set urgent.

§

UnsetWindowUrgent

Unset urgent status of a window.

Fields

§id: u64

Id of the window to unset urgent.

§

LoadConfigFile

Reload the config file.

Can be useful for scripts changing the config file, to avoid waiting the small duration for niri’s config file watcher to notice the changes.

Trait Implementations§

Source§

impl Clone for Action

Source§

fn clone(&self) -> Action

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Action

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Action

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Action

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Action

§

impl RefUnwindSafe for Action

§

impl Send for Action

§

impl Sync for Action

§

impl Unpin for Action

§

impl UnwindSafe for Action

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,