Skip to content

Commit 52c2d61

Browse files
committed
Merge pull request #4 from notfound4/dev
Added a method to get access to the i3 file descriptor
2 parents fa0faab + d2d9010 commit 52c2d61

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

include/i3ipc++/ipc.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,12 @@ class connection {
246246
*/
247247
void handle_event();
248248

249+
/**
250+
* Get the file descriptor associated to i3.
251+
* @return the file descriptor associated to i3, -1 if not created yet.
252+
*/
253+
int32_t get_file_descriptor();
254+
249255
sigc::signal<void, const workspace_event_t&> signal_workspace_event; ///< Workspace event signal
250256
sigc::signal<void> signal_output_event; ///< Output event signal
251257
sigc::signal<void> signal_mode_event; ///< Output mode event signal

src/ipc.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,4 +410,8 @@ bool connection::send_command(const std::string& command) const {
410410
#undef i3IPC_TYPE_STR
411411
}
412412

413+
int32_t connection::get_file_descriptor() {
414+
return m_event_socket;
415+
}
416+
413417
}

0 commit comments

Comments
 (0)