krasenyp
This is an i3 IPC client implementation, written in Erlang, with zero dependencies. All the messages and events exposed by i3 and Sway are currently supported.
It’s a very early release but it’s fully featured. My next two priorities are improving the test coverage and extending the documentation with examples. Nevertheless, I’ll be happy to hear from early users.
Notable features
- Variant negotiation - rudimentary capability checks but the fundamentals are ther
- Automatic reconnection - opt-in but nice to have
- Multiplexing - a single connection can handle request-response and out-of-band events.
Example
The following example shows how to start a client connection, subscribe to events and run commands. All using the same connection, all idiomatic OTP behaviour.
iex> {:ok, pid} = :i3_client.start_link([])
iex> {:ok, ref} = :i3_client.subscribe(pid, ["window"])
iex> {:ok, _} = :i3_client.run_command(pid, "focus right")
iex> flush()
{:i3_event, ^pid, ^ref, "window", "..."} # Pseudocode but you get the idea
Hex: i3_client | Hex
Source:
Trending in Announcing
Flop is an Elixir library that applies filtering, ordering and pagination parameters to your Ecto queries.
offset-based pagination with...
New
I needed to reuse React components from my Chrome extension in my Phoenix/LiveView backend. I noticed that for Svelte/Vue, there are live...
New
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Hello
Published a new library - ProcessHub!
ProcessHub is a library designed to manage process distribution within the Elixir cluster. ...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
It’s not that it’s vocabulary is too advanced. It’s something worse.
I get lost trying to follow even a paragraph written by Claude. It’...
New
This showed up on my feed.. anyone heard of it? Just hype?
Ox Alpha is a reasoning model designed for coding, sustained ag...
New
Today we’re releasing Oban for Python. Not an Oban client in Python. Not a pythonx wrapper embedded in Elixir. Nope, it’s a fully operati...
New
@hugobarauna, Dr. Dimitrios Koutmos (my brother) and I (Alex Koutmos) have been hard at work on writing a book on how you can use Elixir ...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #ai
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 6 to 1- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
krasenyp
I’m happy to announce that v0.3.0 was just released.
This version brings a new module -
i3_client_treeswhich includes functions for processing i3 layout trees. Currently, it holds only two functions -table/1,2. The functions return QLC handle which allows for iterator style traversal. For example, you can very easily find the focused node:krasenyp
Nothing special on my side, I’m just using the swaybar protocol. I use
i3_clientto keep track of various pieces of state. For example, I’m subscribed toinputevents and update the bar accordingly whenever I change the keyboard layout.MaxRu
Very cool! How do you render the status bar to the screen? I also do have a self built status bar but currently its in python and uses gtk bindings.
From my search i did not find a great way to render this with the beam.
krasenyp
I’m using the client in two places. One is my own S atstatus bar because I daily drive FreeBSD and most status bars don’t work.
The other is an integration daemon. I intercept Sway commands and, for example, depending on the currently focused window I handle the commands differently.
MaxRu
Very cool stuff!
I’m currently also working on a client like this but for wayland protocols because i am building a WM in elixir.
Whats your use case for an i3 client in erlang?
krasenyp
I’m happy to announce that v0.2.0 was just released.
This version brings one user-facing change - first tick events, the ones received right after a subscription to tick events is made, are treated as unicast events. They used to be broadcast events, like any other type of event, but it was an incorrect behaviour. I knowingly left it that way in the initial version because it was tolerable but now it’s time for correct and predictable handling of this special kind of event.