{"id":19321304,"url":"https://github.com/leshow/tokio-i3ipc","last_synced_at":"2025-04-10T03:52:21.011Z","repository":{"id":34636286,"uuid":"174661476","full_name":"leshow/tokio-i3ipc","owner":"leshow","description":"i3 IPC in tokio + sync + standalone types crate","archived":false,"fork":false,"pushed_at":"2024-08-15T08:47:35.000Z","size":303,"stargazers_count":36,"open_issues_count":1,"forks_count":20,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-10T03:52:05.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leshow.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-09T07:15:51.000Z","updated_at":"2024-11-04T04:28:05.000Z","dependencies_parsed_at":"2024-11-10T01:36:51.717Z","dependency_job_id":"1917a0e0-8536-450f-baf7-b687abe5bf03","html_url":"https://github.com/leshow/tokio-i3ipc","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshow%2Ftokio-i3ipc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshow%2Ftokio-i3ipc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshow%2Ftokio-i3ipc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leshow%2Ftokio-i3ipc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leshow","download_url":"https://codeload.github.com/leshow/tokio-i3ipc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248154998,"owners_count":21056542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T01:36:42.228Z","updated_at":"2025-04-10T03:52:20.979Z","avatar_url":"https://github.com/leshow.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# i3ipc\n\n## tokio-i3ipc\n\n**Now with tokio 1.0 support!** Use version 0.12.0 and up for tokio 1.0\n\n[![Build Status](https://github.com/leshow/tokio-i3ipc/workflows/Actions/badge.svg)](https://github.com/leshow/tokio-i3ipc/actions)\n[![Crate](https://img.shields.io/crates/v/tokio-i3ipc.svg)](https://crates.io/crates/tokio-i3ipc)\n[![API](https://docs.rs/tokio-i3ipc/badge.svg)](https://docs.rs/tokio-i3ipc)\n\nThis crate provides types and functions for working with i3's IPC protocol (and some basic sway support) within tokio. It re-exports the subcrate `i3ipc-types` because it is also used for a synchronous version of the code.\n\nsee [here](https://github.com/leshow/tokio-i3ipc/tree/master/tokio-i3ipc) for tokio runtime specific i3\n\n## async-i3ipc\n\n[![Crate](https://img.shields.io/crates/v/async-i3ipc.svg)](https://crates.io/crates/async-i3ipc)\n[![API](https://docs.rs/async-i3ipc/badge.svg)](https://docs.rs/async-i3ipc)\n\nsee [here](https://github.com/leshow/tokio-i3ipc/tree/master/async-i3ipc) for async-std specific i3 ipc (and sway-- not all fields supported)\n\n## std synchronous IO i3ipc\n\n[![Crate](https://img.shields.io/crates/v/i3_ipc.svg)](https://crates.io/crates/i3_ipc)\n[![API](https://docs.rs/i3_ipc/badge.svg)](https://docs.rs/i3_ipc)\n\nsee [here](https://github.com/leshow/tokio-i3ipc/tree/master/i3-ipc) for synchronous specific i3 ipc (and sway-- not all fields supported)\n\n### Using tokio-i3ipc\n\nI expect the most common use case will be to subscribe to some events and listen:\n\n```rust\nuse std::io;\nuse tokio::stream::StreamExt;\nuse tokio_i3ipc::{\n    event::{Event, Subscribe},\n    I3,\n};\n\n#[tokio::main(flavor = \"current_thread\")]\nasync fn main() -\u003e io::Result\u003c()\u003e {\n    let mut i3 = I3::connect().await?;\n    let resp = i3.subscribe([Subscribe::Window]).await?;\n\n    println!(\"{:#?}\", resp);\n    let mut listener = i3.listen();\n    while let Some(event) = listener.next().await {\n        match event? {\n            Event::Workspace(ev) =\u003e println!(\"workspace change event {:?}\", ev),\n            Event::Window(ev) =\u003e println!(\"window event {:?}\", ev),\n            Event::Output(ev) =\u003e println!(\"output event {:?}\", ev),\n            Event::Mode(ev) =\u003e println!(\"mode event {:?}\", ev),\n            Event::BarConfig(ev) =\u003e println!(\"bar config update {:?}\", ev),\n            Event::Binding(ev) =\u003e println!(\"binding event {:?}\", ev),\n            Event::Shutdown(ev) =\u003e println!(\"shutdown event {:?}\", ev),\n            Event::Tick(ev) =\u003e println!(\"tick event {:?}\", ev),\n        }\n    }\n    Ok(())\n}\n```\n\n### Contributing\n\nContributions PRs, issues, comments, are all welcome!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleshow%2Ftokio-i3ipc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleshow%2Ftokio-i3ipc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleshow%2Ftokio-i3ipc/lists"}