i3ipc++
An C++ implementaiton of the i3 IPC
|
Connection to the i3. More...
#include <ipc.hpp>
Public Member Functions | |
connection (const std::string &socket_path=get_socketpath()) | |
Connect to the i3. More... | |
bool | send_command (const std::string &command) const |
Send a command to i3. More... | |
std::vector< std::shared_ptr < workspace_t > > | get_workspaces () const |
Request a list of workspaces. More... | |
std::vector< std::shared_ptr < output_t > > | get_outputs () const |
Request a list of outputs. More... | |
version_t | get_version () const |
Request a version of i3. More... | |
std::shared_ptr< container_t > | get_tree () const |
Request a tree of windows. More... | |
std::vector< std::string > | get_bar_configs_list () const |
Request a list of names of available barconfigs. More... | |
std::shared_ptr< bar_config_t > | get_bar_config (const std::string &name) const |
Request a barconfig. More... | |
bool | subscribe (const int32_t events) |
Subscribe on an events of i3. More... | |
void | handle_event () |
Handle an event from i3. More... | |
int32_t | get_main_socket_fd () |
Get the fd of the main socket. More... | |
int32_t | get_event_socket_fd () |
Get the fd of the event socket. More... | |
Public Attributes | |
sigc::signal< void, const workspace_event_t & > | signal_workspace_event |
Workspace event signal. | |
sigc::signal< void > | signal_output_event |
Output event signal. | |
sigc::signal< void > | signal_mode_event |
Output mode event signal. | |
sigc::signal< void, const window_event_t & > | signal_window_event |
Window event signal. | |
sigc::signal< void, const bar_config_t & > | signal_barconfig_update_event |
Barconfig update event signal. | |
sigc::signal< void, const binding_t & > | signal_binding_event |
Binding event signal. | |
sigc::signal< void, EventType, const std::shared_ptr< const buf_t > & > | signal_event |
i3 event signal More... | |
Protected Member Functions | |
void | prepare_to_event_handling () |
Connection to the i3.
i3ipc::connection::connection | ( | const std::string & | socket_path = get_socketpath() | ) |
Connect to the i3.
socket_path | path to a i3 IPC socket |
std::shared_ptr<bar_config_t> i3ipc::connection::get_bar_config | ( | const std::string & | name | ) | const |
Request a barconfig.
name | name of barconfig |
std::vector<std::string> i3ipc::connection::get_bar_configs_list | ( | ) | const |
Request a list of names of available barconfigs.
int32_t i3ipc::connection::get_event_socket_fd | ( | ) |
Get the fd of the event socket.
int32_t i3ipc::connection::get_main_socket_fd | ( | ) |
Get the fd of the main socket.
std::vector< std::shared_ptr<output_t> > i3ipc::connection::get_outputs | ( | ) | const |
Request a list of outputs.
std::shared_ptr<container_t> i3ipc::connection::get_tree | ( | ) | const |
Request a tree of windows.
version_t i3ipc::connection::get_version | ( | ) | const |
Request a version of i3.
std::vector< std::shared_ptr<workspace_t> > i3ipc::connection::get_workspaces | ( | ) | const |
Request a list of workspaces.
void i3ipc::connection::handle_event | ( | ) |
Handle an event from i3.
bool i3ipc::connection::send_command | ( | const std::string & | command | ) | const |
Send a command to i3.
command | command |
bool i3ipc::connection::subscribe | ( | const int32_t | events | ) |
Subscribe on an events of i3.
If connection isn't handling events at the moment, event numer will be added to subscription list. Else will also send subscripe request to i3
Example:
events | event type (EventType enum) |
i3 event signal