qi3pc 0.1.2
Qt based library to communicate with i3wm via its IPC API
Loading...
Searching...
No Matches
qi3pc Class Reference

Class mapping to the to the i3wm IPC interface. More...

#include <qi3pc.h>

Inheritance diagram for qi3pc:

Public Types

enum class  IpcEvent : quint32 {
  Workspace = I3_IPC_EVENT_WORKSPACE ,
  Output = I3_IPC_EVENT_OUTPUT ,
  Mode = I3_IPC_EVENT_MODE ,
  Window = I3_IPC_EVENT_WINDOW ,
  BarUpdate = I3_IPC_EVENT_BARCONFIG_UPDATE ,
  Binding = I3_IPC_EVENT_BINDING ,
  Shutdown = I3_IPC_EVENT_SHUTDOWN ,
  Tick = I3_IPC_EVENT_TICK
}
 Enum holding the types of events offered by the i3wm's IPC API.
 
enum class  IpcType : quint32 {
  Command = I3_IPC_REPLY_TYPE_COMMAND ,
  Workspaces = I3_IPC_REPLY_TYPE_WORKSPACES ,
  Subscribe = I3_IPC_REPLY_TYPE_SUBSCRIBE ,
  Outputs = I3_IPC_REPLY_TYPE_OUTPUTS ,
  Tree = I3_IPC_REPLY_TYPE_TREE ,
  Marks = I3_IPC_REPLY_TYPE_MARKS ,
  BarConfig = I3_IPC_REPLY_TYPE_BAR_CONFIG ,
  Version = I3_IPC_REPLY_TYPE_VERSION ,
  BindingModes = I3_IPC_REPLY_TYPE_BINDING_MODES ,
  Config = I3_IPC_REPLY_TYPE_CONFIG ,
  Tick = I3_IPC_REPLY_TYPE_TICK ,
  Sync = I3_IPC_REPLY_TYPE_SYNC
}
 Enum holding the types of messages the API expect to send and receive replies for from i3.
 
enum class  WorkspaceChange {
  Focus ,
  Init ,
  Empty ,
  Urgent ,
  Reload ,
  Rename ,
  Restored ,
  Move ,
  Unknown
}
 Enum holding the types of change a workspace event can have. More...
 
enum class  OutputChange {
  Unspecified ,
  Unknown
}
 Enum holding the types of change an output event can have. More...
 
enum class  WindowChange {
  New ,
  Close ,
  Focus ,
  Title ,
  Fullscreen ,
  Move ,
  Floating ,
  Urgent ,
  Mark ,
  Unknown
}
 
enum class  ShutdownChange {
  Restart ,
  Exit ,
  Unknown
}
 Enum holding the types of change a shutdown event can have. More...
 
enum class  BindingChange {
  Run ,
  Unknown
}
 
using DataObject = std::optional<std::pair<QJsonObject, qint64>>
 
using DataArray = std::optional<std::pair<QJsonArray, qint64>>
 
using Error = std::optional<QString>
 
using Message = std::optional<std::pair<QJsonDocument, quint32>>
 

Signals

void commandRan (bool success, qi3pc::Error error)
 Signal emitted when a command have been ran by i3.
 
void tickSent (bool success)
 Signal emitted when a tick have been processed by i3.
 
void synced (bool success)
 Signal emitted when a sync message have been replied to by i3.
 
void subscribed (bool success)
 Signal emitted when a subscribe message have been replied to.
 
void workspaceEvent (qi3pc::WorkspaceChange change, const QJsonObject &current, const QJsonObject &old)
 Signal emitted with a workspace event's data preprocessed.
 
void outputEvent (qi3pc::OutputChange change)
 Signal emitted when the output(s) change.
 
void modeEvent (QString change, bool pango)
 Signal emitted when the binding mode changes.
 
void windowEvent (qi3pc::WindowChange change, const QJsonObject &container)
 Signal emitted when a window changes.
 
void barUpdateEvent (const QJsonObject &doc)
 Signal emitted when a bar's configuration have been updated.
 
void bindingEvent (qi3pc::BindingChange change, const QJsonObject &binding)
 Signal emitteed when a binding have been triggered to run a command.
 
void shutdownEvent (qi3pc::ShutdownChange change)
 Signal emitted when the ipc socket i about to shutdown.
 
void tickEvent (bool first, const QJsonObject &payload)
 Signal emitted when subscribing to tick events or when a tick message have been sent to the ipc connection.
 
void fetchWorkspaces ()
 Signal to emit to trigger an update of the list of workspace cache.
 
void workspacesUpdated (const qi3pc::DataArray &workspaces)
 Signal emitted when the (cached) list of workspaces have been updated.
 
void fetchTree ()
 Signal to emit to trigger an update of the (cached) layout tree.
 
void treeUpdated (const qi3pc::DataObject &tree)
 Signal emitted when the layout tree cache have been updated.
 
void fetchOutputs ()
 Signal to emit to trigger an update of the (cached) outputs.
 
void outputsUpdated (const qi3pc::DataArray &outputs)
 Signal emitted when (cached) outputs have been updated.
 
void fetchMarks ()
 Signal to emit to trigger an update of the (cached) list of marks.
 
void marksUpdated (const qi3pc::DataArray &marks)
 Signal emitted when the (cached) list of marks have been updated.
 
void fetchBarConfig (const QString &id)
 Signal to emit to update the (cached) configuration of a certain bar.
 
void fetchBarConfigs ()
 Signal to emit to update the list of bar configurations.
 
void barConfigUpdated (const QJsonObject &config)
 Signal emitted when a specific bar's (cached) config have been updated.
 
void newBarConfig (const QString &id)
 Signal emitted when a new bar config have been added to the cache.
 
void fetchVersion ()
 Signal to emit to trigger a cache update for the i3wm version.
 
void versionUpdated (const qi3pc::DataObject &version)
 Signal emitted when the (cached) i3 version have been updated.
 
void fetchModes ()
 Signal to emit to trigger an update of the (cached) list of modes.
 
void modesUpdated (const qi3pc::DataArray &modes)
 Signal emitted when the (cached) list of modes have been updated.
 
void fetchConfig ()
 Signal to emit to trigger an update of the (cached) config.
 
void configUpdated (const qi3pc::DataObject &config)
 Signal emitted when the (cached) config have been updated.
 

Public Member Functions

 qi3pc (QObject *parent=nullptr)
 Construct an qi3pc object.
 
virtual ~qi3pc ()
 Simple destructor for the qi3pc class.
 
bool connect ()
 Connect to the unix socket.
 
bool connected ()
 Check if the connection to the ipc socket is established.
 
bool disconnect ()
 Disconnect from the ipc.
 
void subscribe (const QStringList &events)
 Subscribe to a list of events.
 
QString socketPath () const
 Get the path to the i3 ipc local unix socket.
 
void sendMessage (IpcType type, const QByteArray &payload=QByteArray())
 Send a message with the specified type and payload to i3.
 
DataArray workspaces () const
 Get the list of (cached) worksaces.
 
DataObject tree () const
 Get the (cached) i3 layout tree.
 
DataArray outputs () const
 Get the (cached) list of outputs.
 
DataArray marks () const
 Get the (cached) list of set marks.
 
DataObject barConfigs () const
 Get the (cached) list of all bar configurations.
 
DataObject version () const
 Get the (cached) i3 version object.
 
DataArray modes () const
 Get the (cached) list of binding modes.
 
DataObject config () const
 Get the (cached) data read from the config file.
 

Static Public Attributes

static constexpr auto IpcMagicString = I3_IPC_MAGIC
 
static constexpr auto IpcMagicLength = 6
 

Private Member Functions

Message processMessage (QLocalSocket &socket)
 Read one message using the socket parameter.
 
void processEvent ()
 Read data from the event socket.
 
void processReply ()
 Read data from the message socket.
 
void processWorkspaceEvent (const QJsonDocument &doc)
 Handle data received from a workspace event.
 
void processOutputEvent (const QJsonDocument &doc)
 Handle data received from an output event.
 
void processModeEvent (const QJsonDocument &doc)
 Handle data received from a mode event.
 
void processWindowEvent (const QJsonDocument &doc)
 Handle data received from a window event.
 
void processBarUpdateEvent (const QJsonDocument &doc)
 Handle data received from an update event.
 
void processBindingEvent (const QJsonDocument &doc)
 Handle data received from a binding event.
 
void processShutdownEvent (const QJsonDocument &doc)
 Handle data received from a shutdowm event.
 
void processTickEvent (const QJsonDocument &doc)
 Handle data received from a tick event.
 
void processCommandReply (const QJsonDocument &doc)
 Handle data received from a run command reply.
 
void processWorkspaceReply (const QJsonDocument &doc)
 Handle data received from a workspace reply.
 
void processOutputReply (const QJsonDocument &doc)
 Handle data received from an output reply.
 
void processTreeReply (const QJsonDocument &doc)
 Handle data received from a tree reply.
 
void processMarkReply (const QJsonDocument &doc)
 Handle data received from a mark reply.
 
void processBarConfigReply (const QJsonDocument &doc)
 Handle data received from a bar config reply.
 
void processVersionReply (const QJsonDocument &doc)
 Handle data received from a version reply.
 
void processModeReply (const QJsonDocument &doc)
 Handle data received from a mode reply.
 
void processConfigReply (const QJsonDocument &doc)
 Handle data received from a config reply.
 
void processTickReply (const QJsonDocument &doc)
 Handle data received from a tick reply.
 
void processSyncReply (const QJsonDocument &doc)
 Handle data received from a sync reply.
 
WorkspaceChange workspaceChangeFromString (const QString &s) const
 Convert a string into a workspace change object.
 
WindowChange windowChangeFromString (const QString &s) const
 Convert a string into a window change object.
 
ShutdownChange shutdownChangeFromString (const QString &s) const
 Convert a string into a shutdown change object.
 
OutputChange outputChangeFromString (const QString &s) const
 Convert a string into an output change object.
 
BindingChange bindingChangeFromString (const QString &s) const
 Convert a string into a binding change object.
 

Private Attributes

QString m_socketPath
 
QLocalSocket m_eventSocket
 
QLocalSocket m_messageSocket
 
DataObject m_tree
 
DataArray m_workspaces
 
DataArray m_outputs
 
DataArray m_marks
 
DataObject m_barConfigs
 
DataObject m_version
 
DataArray m_modes
 
DataObject m_config
 

Detailed Description

Class mapping to the to the i3wm IPC interface.

This class is an intuitive layer over the API offered by the i3wm IPC interface.

Member Typedef Documentation

◆ DataObject

using qi3pc::DataObject = std::optional<std::pair<QJsonObject, qint64>>

Alias used for cached JSON objects.

◆ DataArray

using qi3pc::DataArray = std::optional<std::pair<QJsonArray, qint64>>

Alias used for cached JSON arrays.

Member Enumeration Documentation

◆ WorkspaceChange

enum class qi3pc::WorkspaceChange
strong

Enum holding the types of change a workspace event can have.

Enum holding the types of change a binding event can have.

Enum holding the types of change a window event can have.

This information is taken from the change (a string) received with the event.

◆ OutputChange

enum class qi3pc::OutputChange
strong

Enum holding the types of change an output event can have.

This information is taken from the change (a string) received with the event.

Enumerator
Unspecified 

see i3 docs.

Unknown 

Unsupported change.

◆ WindowChange

enum class qi3pc::WindowChange
strong
Enumerator
New 

A new window is created.

Close 

A window is closed.

Focus 

A window gained focus.

Title 

A window's title changed.

Fullscreen 

A window as entered/leave fullscreen mode.

Move 

A window have been moved.

Urgent 

A window has entered/leaved floating mode.

Mark 

A window gained/lost urgent status.

Unknown 

A mark have been added/remvoed from a window. Unsupported change.

◆ ShutdownChange

enum class qi3pc::ShutdownChange
strong

Enum holding the types of change a shutdown event can have.

This information is taken from the change (a string) received with the event.

Enumerator
Restart 

The window mananger is restarted.

Exit 

The window manager is exiting.

Unknown 

Unsupported change.

◆ BindingChange

enum class qi3pc::BindingChange
strong
Enumerator
Run 

A binding was run.

Unknown 

Unsupported change.

Constructor & Destructor Documentation

◆ qi3pc()

qi3pc::qi3pc ( QObject * parent = nullptr)
explicit

◆ ~qi3pc()

qi3pc::~qi3pc ( )
virtual

Simple destructor for the qi3pc class.

Disconnects the used sockets.

See also
qi3pc::disconnect

References m_eventSocket, and m_messageSocket.

Member Function Documentation

◆ connect()

bool qi3pc::connect ( )

Connect to the unix socket.

Returns
The success of the operation

This method may wait up to 3 seconds for the connection to be established. If it takes more than 3 seconds to connect, the connection might be established later, but the returned value will not reflect that.

See also
qi3pc::connected

References m_eventSocket, m_messageSocket, and m_socketPath.

◆ connected()

bool qi3pc::connected ( )

Check if the connection to the ipc socket is established.

Returns
Return if the connection to the two QLocalSocket object's used are connected.
See also
qi3pc::connected

References m_eventSocket, and m_messageSocket.

◆ disconnect()

bool qi3pc::disconnect ( )

Disconnect from the ipc.

Returns
Return if the socket connection have been closed.
See also
qi3pc::connected

References m_eventSocket, and m_messageSocket.

◆ subscribe()

void qi3pc::subscribe ( const QStringList & events)

Subscribe to a list of events.

Parameters
eventsA list of string with the events to subscribe to.

References m_eventSocket.

◆ socketPath()

QString qi3pc::socketPath ( ) const

Get the path to the i3 ipc local unix socket.

Returns
The path to the unix socket

◆ sendMessage()

void qi3pc::sendMessage ( IpcType type,
const QByteArray & payload = QByteArray() )

Send a message with the specified type and payload to i3.

Parameters
typeThe type of the message to send.
payloadThe content of the message.

Available message types.

Do not use this method to send messages, use qi3pc::subscribe instead.

References m_messageSocket.

◆ workspaces()

qi3pc::DataArray qi3pc::workspaces ( ) const

Get the list of (cached) worksaces.

Returns
The list of workspaces with their last update time.
See also
qi3pc::fetchWorkspaces

References m_workspaces.

◆ tree()

qi3pc::DataObject qi3pc::tree ( ) const

Get the (cached) i3 layout tree.

Returns
The layout tree with their last update time
See also
qi3pc::fetchTree

References m_tree.

◆ outputs()

qi3pc::DataArray qi3pc::outputs ( ) const

Get the (cached) list of outputs.

Returns
The list of outputs with their last update time.
See also
qi3pc::fetchOutputs

References m_outputs.

◆ marks()

qi3pc::DataArray qi3pc::marks ( ) const

Get the (cached) list of set marks.

Returns
The list of marks and their last update time.
See also
qi3pc::fetchMarks

References m_marks.

◆ barConfigs()

qi3pc::DataObject qi3pc::barConfigs ( ) const

Get the (cached) list of all bar configurations.

Returns
A map of bar configuration and their last update time.
See also
qi3pc::fetchBarConfig
qi3pc::barConfigUpdated
qi3pc::newBarConfig

References m_barConfigs.

◆ version()

qi3pc::DataObject qi3pc::version ( ) const

Get the (cached) i3 version object.

Returns
The i3 version and the last time it was updated.
See also
qi3pc::fetchVersion
qi3pc::versionUpdated

References m_version.

◆ modes()

qi3pc::DataArray qi3pc::modes ( ) const

Get the (cached) list of binding modes.

Returns
The list of binding modes and their last update time.
See also
qi3pc::fetchModes
qi3pc::modesUpdated

References m_modes.

◆ config()

qi3pc::DataObject qi3pc::config ( ) const

Get the (cached) data read from the config file.

Returns
The config and the last time it was updated.
See also
qi3pc::fetchConfig
qi3pc::configUpdated

References m_config.

◆ processMessage()

qi3pc::Message qi3pc::processMessage ( QLocalSocket & socket)
private

Read one message using the socket parameter.

Parameters
socketLocal unix socket from which the message is read
Returns
An optional json doc and the type of the message read

◆ processWorkspaceEvent()

void qi3pc::processWorkspaceEvent ( const QJsonDocument & doc)
private

Handle data received from a workspace event.

Parameters
docDocument containing the data

References workspaceChangeFromString(), and workspaceEvent().

◆ processOutputEvent()

void qi3pc::processOutputEvent ( const QJsonDocument & doc)
private

Handle data received from an output event.

Parameters
docDocument containing the data

References outputChangeFromString(), outputEvent(), and Unknown.

◆ processModeEvent()

void qi3pc::processModeEvent ( const QJsonDocument & doc)
private

Handle data received from a mode event.

Parameters
docDocument containing the data

References modeEvent().

◆ processWindowEvent()

void qi3pc::processWindowEvent ( const QJsonDocument & doc)
private

Handle data received from a window event.

Parameters
docDocument containing the data

References Unknown, windowChangeFromString(), and windowEvent().

◆ processBarUpdateEvent()

void qi3pc::processBarUpdateEvent ( const QJsonDocument & doc)
private

Handle data received from an update event.

Parameters
docDocument containing the data

References barUpdateEvent().

◆ processBindingEvent()

void qi3pc::processBindingEvent ( const QJsonDocument & doc)
private

Handle data received from a binding event.

Parameters
docDocument containing the data

References bindingChangeFromString(), bindingEvent(), and Unknown.

◆ processShutdownEvent()

void qi3pc::processShutdownEvent ( const QJsonDocument & doc)
private

Handle data received from a shutdowm event.

Parameters
docDocument containing the data

References shutdownChangeFromString(), shutdownEvent(), and Unknown.

◆ processTickEvent()

void qi3pc::processTickEvent ( const QJsonDocument & doc)
private

Handle data received from a tick event.

Parameters
docDocument containing the data

References tickEvent().

◆ processCommandReply()

void qi3pc::processCommandReply ( const QJsonDocument & doc)
private

Handle data received from a run command reply.

Parameters
docDocument containing the data

References commandRan().

◆ processWorkspaceReply()

void qi3pc::processWorkspaceReply ( const QJsonDocument & doc)
private

Handle data received from a workspace reply.

Parameters
docDocument containing the data

References m_workspaces, and workspacesUpdated().

◆ processOutputReply()

void qi3pc::processOutputReply ( const QJsonDocument & doc)
private

Handle data received from an output reply.

Parameters
docDocument containing the data

References m_outputs, and outputsUpdated().

◆ processTreeReply()

void qi3pc::processTreeReply ( const QJsonDocument & doc)
private

Handle data received from a tree reply.

Parameters
docDocument containing the data

References m_tree, and treeUpdated().

◆ processMarkReply()

void qi3pc::processMarkReply ( const QJsonDocument & doc)
private

Handle data received from a mark reply.

Parameters
docDocument containing the data

References m_marks, and marksUpdated().

◆ processBarConfigReply()

void qi3pc::processBarConfigReply ( const QJsonDocument & doc)
private

Handle data received from a bar config reply.

Parameters
docDocument containing the data

References barConfigUpdated(), config(), m_barConfigs, and newBarConfig().

◆ processVersionReply()

void qi3pc::processVersionReply ( const QJsonDocument & doc)
private

Handle data received from a version reply.

Parameters
docDocument containing the data

References m_version, and versionUpdated().

◆ processModeReply()

void qi3pc::processModeReply ( const QJsonDocument & doc)
private

Handle data received from a mode reply.

Parameters
docDocument containing the data

References m_modes, and modesUpdated().

◆ processConfigReply()

void qi3pc::processConfigReply ( const QJsonDocument & doc)
private

Handle data received from a config reply.

Parameters
docDocument containing the data

References configUpdated(), and m_config.

◆ processTickReply()

void qi3pc::processTickReply ( const QJsonDocument & doc)
private

Handle data received from a tick reply.

Parameters
docDocument containing the data

References tickSent().

◆ processSyncReply()

void qi3pc::processSyncReply ( const QJsonDocument & doc)
private

Handle data received from a sync reply.

Parameters
docDocument containing the data

References synced().

◆ workspaceChangeFromString()

qi3pc::WorkspaceChange qi3pc::workspaceChangeFromString ( const QString & s) const
private

Convert a string into a workspace change object.

Parameters
sThe string to convert
Returns
A qi3pc::WorkspaceChange value.

◆ windowChangeFromString()

qi3pc::WindowChange qi3pc::windowChangeFromString ( const QString & s) const
private

Convert a string into a window change object.

Parameters
sThe string to convert
Returns
A qi3pc::WindowChange value.

References Close, Focus, Fullscreen, Mark, Move, New, Title, Unknown, and Urgent.

◆ shutdownChangeFromString()

qi3pc::ShutdownChange qi3pc::shutdownChangeFromString ( const QString & s) const
private

Convert a string into a shutdown change object.

Parameters
sThe string to convert
Returns
A qi3pc::ShutdownChange value.

References Exit, Restart, and Unknown.

◆ outputChangeFromString()

qi3pc::OutputChange qi3pc::outputChangeFromString ( const QString & s) const
private

Convert a string into an output change object.

Parameters
sThe string to convert
Returns
A qi3pc::OutputChange value.

References Unknown, and Unspecified.

◆ bindingChangeFromString()

qi3pc::BindingChange qi3pc::bindingChangeFromString ( const QString & s) const
private

Convert a string into a binding change object.

Parameters
sThe string to convert
Returns
A qi3pc::BindingChange value.

References Run, and Unknown.

◆ commandRan

void qi3pc::commandRan ( bool success,
qi3pc::Error error )
signal

Signal emitted when a command have been ran by i3.

Parameters
successCommand exit status (??)
errorOptional human readable string describing an error

Use to run command with the qi3pc::IpcType::Command type.

◆ tickSent

void qi3pc::tickSent ( bool success)
signal

Signal emitted when a tick have been processed by i3.

Parameters
success??

Use to send tick messages with the qi3pc::IpcType::Tick type.

◆ synced

void qi3pc::synced ( bool success)
signal

Signal emitted when a sync message have been replied to by i3.

Parameters
success??

Use to send sync messages with qi3pc::IpcType::Sync type.

◆ subscribed

void qi3pc::subscribed ( bool success)
signal

Signal emitted when a subscribe message have been replied to.

Parameters
success??
See also
qi3pc::subscribe

◆ workspaceEvent

void qi3pc::workspaceEvent ( qi3pc::WorkspaceChange change,
const QJsonObject & current,
const QJsonObject & old )
signal

Signal emitted with a workspace event's data preprocessed.

Parameters
changeThe type of change
currentThe current workspace
oldThe old workspace

◆ outputEvent

void qi3pc::outputEvent ( qi3pc::OutputChange change)
signal

Signal emitted when the output(s) change.

Parameters
changeThe type of change

◆ modeEvent

void qi3pc::modeEvent ( QString change,
bool pango )
signal

Signal emitted when the binding mode changes.

Parameters
changeThe name of the current mode.
pangoBoolean telling whether to display the mode with pango markup.

◆ windowEvent

void qi3pc::windowEvent ( qi3pc::WindowChange change,
const QJsonObject & container )
signal

Signal emitted when a window changes.

Parameters
changeThe type of change.
containerThe parent of the changed window.

◆ barUpdateEvent

void qi3pc::barUpdateEvent ( const QJsonObject & doc)
signal

Signal emitted when a bar's configuration have been updated.

Parameters
docJson object containing the bar configuration.

◆ bindingEvent

void qi3pc::bindingEvent ( qi3pc::BindingChange change,
const QJsonObject & binding )
signal

Signal emitteed when a binding have been triggered to run a command.

Parameters
changeThe type of change.
bindingThe binding that was run.

◆ shutdownEvent

void qi3pc::shutdownEvent ( qi3pc::ShutdownChange change)
signal

Signal emitted when the ipc socket i about to shutdown.

Parameters
changeThe type of change.

◆ tickEvent

void qi3pc::tickEvent ( bool first,
const QJsonObject & payload )
signal

Signal emitted when subscribing to tick events or when a tick message have been sent to the ipc connection.

Parameters
firstBoolean specifying whether this is a subscription
payloadArbitrary payload sent with the tick message. Empty for subscriptions.

◆ fetchWorkspaces

void qi3pc::fetchWorkspaces ( )
signal

Signal to emit to trigger an update of the list of workspace cache.

See also
qi3pc::workspaces
qi3pc::workspacesUpdated

◆ workspacesUpdated

void qi3pc::workspacesUpdated ( const qi3pc::DataArray & workspaces)
signal

Signal emitted when the (cached) list of workspaces have been updated.

Parameters
workspacesThe last list of workspaces with the update time.
See also
qi3pc::fetchWorkspaces

◆ fetchTree

void qi3pc::fetchTree ( )
signal

Signal to emit to trigger an update of the (cached) layout tree.

See also
qi3pc::tree
qi3pc::treeUpdated

◆ treeUpdated

void qi3pc::treeUpdated ( const qi3pc::DataObject & tree)
signal

Signal emitted when the layout tree cache have been updated.

Parameters
treeThe most recent layout tree cached and its update time.
See also
qi3pc::fetchTree

◆ fetchOutputs

void qi3pc::fetchOutputs ( )
signal

Signal to emit to trigger an update of the (cached) outputs.

See also
qi3pc::outputs
qi3pc::outputsUpdated

◆ outputsUpdated

void qi3pc::outputsUpdated ( const qi3pc::DataArray & outputs)
signal

Signal emitted when (cached) outputs have been updated.

Parameters
outputsThe latest list of outputs and their update time.
See also
qi3pc::fetchOutputs

◆ fetchMarks

void qi3pc::fetchMarks ( )
signal

Signal to emit to trigger an update of the (cached) list of marks.

See also
qi3pc::marks
qi3pc::marksUpdated

◆ marksUpdated

void qi3pc::marksUpdated ( const qi3pc::DataArray & marks)
signal

Signal emitted when the (cached) list of marks have been updated.

Parameters
marksThe most recent list of marks and the time when it was updated.
See also
qi3pc::fetchMarks

◆ fetchBarConfig

void qi3pc::fetchBarConfig ( const QString & id)
signal

Signal to emit to update the (cached) configuration of a certain bar.

Parameters
idString identifying to bar to update.
See also
qi3pc::barConfigUpdated
qi3pc::newBarConfig
qi3pc::barConfigs

◆ fetchBarConfigs

void qi3pc::fetchBarConfigs ( )
signal

Signal to emit to update the list of bar configurations.

See also
qi3pc::barConfigUpdated
qi3pc::newBarConfig
qi3pc::barConfigs

◆ barConfigUpdated

void qi3pc::barConfigUpdated ( const QJsonObject & config)
signal

Signal emitted when a specific bar's (cached) config have been updated.

Parameters
configThe relevant bar's configuration.
See also
qi3pc::barConfigs

◆ newBarConfig

void qi3pc::newBarConfig ( const QString & id)
signal

Signal emitted when a new bar config have been added to the cache.

Parameters
idThe id of the new bar.

Only the id is stored at first. Call with the appropriate id to update it.

◆ fetchVersion

void qi3pc::fetchVersion ( )
signal

Signal to emit to trigger a cache update for the i3wm version.

See also
qi3pc::version
qi3pc::versionUpdated

◆ versionUpdated

void qi3pc::versionUpdated ( const qi3pc::DataObject & version)
signal

Signal emitted when the (cached) i3 version have been updated.

Parameters
versionJson object with the latest cached version and the time when it was updated.
See also
qi3pc::version

◆ fetchModes

void qi3pc::fetchModes ( )
signal

Signal to emit to trigger an update of the (cached) list of modes.

See also
qi3pc::modes
qi3pc::modesUpdated

◆ modesUpdated

void qi3pc::modesUpdated ( const qi3pc::DataArray & modes)
signal

Signal emitted when the (cached) list of modes have been updated.

Parameters
modesThe most recent list of modes and the time when it was updated.
See also
qi3pc::modes

◆ fetchConfig

void qi3pc::fetchConfig ( )
signal

Signal to emit to trigger an update of the (cached) config.

See also
qi3pc::config
qi3pc::configUpdated

◆ configUpdated

void qi3pc::configUpdated ( const qi3pc::DataObject & config)
signal

Signal emitted when the (cached) config have been updated.

Parameters
Themost recent config and the time when it was updated.
See also
qi3pc::config

Member Data Documentation

◆ m_socketPath

QString qi3pc::m_socketPath
private

Path of the local unix socket used.

◆ m_eventSocket

QLocalSocket qi3pc::m_eventSocket
private

Socket used to subscribe and handle events.

◆ m_messageSocket

QLocalSocket qi3pc::m_messageSocket
private

Socket used to send messages and handle replies.

◆ m_tree

DataObject qi3pc::m_tree
private

Layout tree cache.

◆ m_workspaces

DataArray qi3pc::m_workspaces
private

Workspace list cache.

◆ m_outputs

DataArray qi3pc::m_outputs
private

Output list cache.

◆ m_marks

DataArray qi3pc::m_marks
private

Mark list cache.

◆ m_barConfigs

DataObject qi3pc::m_barConfigs
private

Bar configuration list cache.

◆ m_version

DataObject qi3pc::m_version
private

Version cache.

◆ m_modes

DataArray qi3pc::m_modes
private

Modes list cache.

◆ m_config

DataObject qi3pc::m_config
private

Configuration cache.


The documentation for this class was generated from the following files: