I3Connection

Struct I3Connection 

Source
pub struct I3Connection { /* private fields */ }
Expand description

Abstraction over an ipc socket to i3. Handles messages/replies.

Implementations§

Source§

impl I3Connection

Source

pub fn connect() -> Result<I3Connection, EstablishError>

Establishes the IPC connection.

Source

pub fn command(&mut self, string: &str) -> Result<Command, MessageError>

👎Deprecated since 0.8.0: Renamed to run_command
Source

pub fn run_command(&mut self, string: &str) -> Result<Command, MessageError>

The payload of the message is a command for i3 (like the commands you can bind to keys in the configuration file) and will be executed directly after receiving it.

Source

pub fn get_workspaces(&mut self) -> Result<Workspaces, MessageError>

Gets the current workspaces.

Source

pub fn get_outputs(&mut self) -> Result<Outputs, MessageError>

Gets the current outputs.

Source

pub fn get_tree(&mut self) -> Result<Node, MessageError>

Gets the layout tree. i3 uses a tree as data structure which includes every container.

Source

pub fn get_marks(&mut self) -> Result<Marks, MessageError>

Gets a list of marks (identifiers for containers to easily jump to them later).

Source

pub fn get_bar_ids(&mut self) -> Result<BarIds, MessageError>

Gets an array with all configured bar IDs.

Source

pub fn get_bar_config(&mut self, id: &str) -> Result<BarConfig, MessageError>

Gets the configuration of the workspace bar with the given ID.

Source

pub fn get_version(&mut self) -> Result<Version, MessageError>

Gets the version of i3. The reply will include the major, minor, patch and human-readable version.

Source

pub fn get_binding_modes(&mut self) -> Result<BindingModes, MessageError>

Available on crate feature i3-4-13 only.

Gets the list of currently configured binding modes.

Source

pub fn get_config(&mut self) -> Result<Config, MessageError>

Available on crate feature i3-4-14 only.

Returns the last loaded i3 config.

Trait Implementations§

Source§

impl Debug for I3Connection

Source§

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

Formats the value using the given formatter. Read more

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> 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, 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.