SubCommand

Enum SubCommand 

Source
pub enum SubCommand {
Show 21 variants Border(Border), Exit, Floating(EnDisTog), Focus(Focus), Fullscreen(EnDisTog, FullscreenGlobal), Gaps(GapsDirection, GapsWorkspaces, GapsModification, u32), InhibitIdle(InhibitIdle), Layout(Layout), MaxRenderTime(MaxRenderTime), Move(Move), Nop(Option<String>), Reload, RenameWorkspace(String, String), RenameFocusedWorkspace(String), Resize(Resize), ScratchpadShow, ShortcutsInhibitor(EnDisable), Split(Split), Sticky(EnDisTog), Swap(Swap), TitleFormat(String),
}
Expand description

A command that can be called with a criteria

Variants§

§

Border(Border)

Set border style for focused window

Default is normal with border thickness 2.

§

Exit

Exit sway and end your Wayland session

§

Floating(EnDisTog)

Make focused view floating, non-floating, or the opposite of what it is now

§

Focus(Focus)

Changes focused node

§

Fullscreen(EnDisTog, FullscreenGlobal)

Makes focused view fullscreen, non-fullscreen, or the opposite of what it is now.

If global is specified, the view will be fullscreen across all outputs.

§

Gaps(GapsDirection, GapsWorkspaces, GapsModification, u32)

Changes the inner or outer gaps for either all workspaces (true) or the current workspace (false). outer gaps can be altered per side with top, right, bottom, and left or per direction with horizontal and vertical.

§

InhibitIdle(InhibitIdle)

Set/unset an idle inhibitor for the view

This can also be used with criteria to set an idle inhibitor for any existing view or with for_window to set idle inhibitors for future views.

§

Layout(Layout)

Sets the layout mode of the focused container

§

MaxRenderTime(MaxRenderTime)

Controls when the relevant application is told to render this window, as a positive number of milliseconds before the next time sway composites the output. A smaller number leads to fresher rendered frames being composited by sway and lower perceived input latency, but if set too low, the application may not finish rendering before sway composites the output, leading to delayed frames.

When set to off, the relevant application is told to render this window immediately after display refresh. How much time is left for rendering before sway composites the output at that point depends on the output max_render_time setting.

To set this up for optimal latency:

  1. Set up output max_render_time (see sway-output(5)).
  2. Put the target application in full-screen and have it continuously render something.
  3. Start by setting max_render_time 1. If the application drops frames, increment by 1.

This setting only has an effect if a per-output max_render_time is in effect on the output the window is currently on. See sway-output(5) for further details.

§

Move(Move)

Move a window, container or workspace

§

Nop(Option<String>)

A no operation command that can be used to override default behaviour. The optional comment argument is ignored, but logged for debugging purposes.

§

Reload

Reloads the sway config file and applies any changes. The config file is located at path specified by the command line arguments when started, otherwise according to the priority stated in sway(1).

§

RenameWorkspace(String, String)

Rename either <old_name> workspace to the <new_name>

§

RenameFocusedWorkspace(String)

Rename the focused workspace to the <new_name>

§

Resize(Resize)

§

ScratchpadShow

Shows a window from the scratchpad

Repeatedly using this command will cycle through the windows in the scratchpad.

§

ShortcutsInhibitor(EnDisable)

Enables or disables the ability of clients to inhibit keyboard shortcuts for a view. This is primarily useful for virtualization and remote desktop software. It affects either the currently focused view or a set of views selected by criteria. Subcommand disable additionally deactivates any active inhibitors for the given view(s). Criteria are particularly useful with the for_window command to configure a class of views differently from the per-seat defaults established by the seat subcommand of the same name. See sway-input(5) for more ways to affect inhibitors.

§

Split(Split)

Splits the current container, vertically or horizontally.

§

Sticky(EnDisTog)

“Sticks” a floating window to the current output so that it shows up on all workspaces

§

Swap(Swap)

Swaps the position, geometry, and fullscreen status of two containers.

The first container can be selected either by criteria or focus. The second container can be selected by id, con_id, or mark. id can only be used with xwayland views. If the first container has focus, it will retain focus unless it is moved to a different workspace or the second container becomes fullscreen on the same workspace as the first container. In either of those cases, the second container will gain focus.

§

TitleFormat(String)

Sets the format of window titles. The following placeholders may be used:

  • %title - The title supplied by the window
  • %app_id - The wayland app ID (applicable to wayland windows only)
  • %class - The X11 classname (applicable to xwayland windows only)
  • %instance - The X11 instance (applicable to xwayland windows only)
  • %shell - The protocol the window is using (typically xwayland or xdg_shell)

This command is typically used with for_window criteria. For example:

for_window [title=“.”] title_format “%title (%app_id)”

Note that markup requires pango to be enabled via the font command.

The default format is “%title”.

Trait Implementations§

Source§

impl Clone for SubCommand

Source§

fn clone(&self) -> SubCommand

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 Display for SubCommand

Source§

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

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

impl From<SubCommand> for Command

Source§

fn from(original: SubCommand) -> Command

Converts to this type from the input type.
Source§

impl From<SubCommand> for CriteriaCommand

Source§

fn from(cmd: SubCommand) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.