TCP socket in addition to Unix Domain? #108

Closed
opened 2026-01-05 14:48:22 +01:00 by adam · 3 comments
Owner

Originally created by @SF-300 on GitHub (Jul 12, 2022).

Originally assigned to: @LGUG2Z on GitHub.

Hello,

First of all thanks to the author and all the contributors for this wonderful piece of software! Indeed it's the best tiling manager implementatin for Windows I've seen to the day!

I'm using komorebi with custom input handler written in Python and based on Interception driver. All is great but there is small, (mostly) Python-specific issue: for UDS on Windows there is neither stdlib support, nor any well-known third-party implementation (at least I wasn't able to find one). There are some workarounds (like using Cython or ctypes to interact directly with WinAPI) but it's too much work for me to resort to them right now.
As for now I just spawn komorebic process from my python code to interact with UDS socket. Problem is, there is some noticable ovehead related to spawning new process on Windows OSes. And as I mostly live on battery-powered notebook burning any extra CPU cycles for each lesser navigation operation is the thing I would like to avoid.

So I was wondering: is there any chance for komorebi to use localhost-bound TCP socket in addtion to (or instead of - as older and more widely-supported solution) UDS socket? Right now I have no desire to learn Rust to contribute this myself so just bringing this to spotlight with this issue =)

Cheers!

Originally created by @SF-300 on GitHub (Jul 12, 2022). Originally assigned to: @LGUG2Z on GitHub. Hello, First of all thanks to the author and all the contributors for this wonderful piece of software! Indeed it's the best tiling manager implementatin for Windows I've seen to the day! I'm using komorebi with custom input handler written in Python and based on [Interception driver](https://github.com/oblitum/Interception). All is great but there is small, (mostly) Python-specific issue: for UDS on Windows there is neither [stdlib support](https://bugs.python.org/issue33408), nor any well-known third-party implementation (at least I wasn't able to find one). There are some workarounds (like using Cython or ctypes to interact directly with WinAPI) but it's too much work for me to resort to them right now. As for now I just spawn komorebic process from my python code to interact with UDS socket. Problem is, there is some noticable ovehead related to spawning new process on Windows OSes. And as I mostly live on battery-powered notebook burning any extra CPU cycles for each lesser navigation operation is the thing I would like to avoid. So I was wondering: is there any chance for komorebi to use localhost-bound TCP socket in addtion to (or instead of - as older and more widely-supported solution) UDS socket? Right now I have no desire to learn Rust to contribute this myself so just bringing this to spotlight with this issue =) Cheers!
adam added the enhancement label 2026-01-05 14:48:22 +01:00
adam closed this issue 2026-01-05 14:48:22 +01:00
Author
Owner

@LGUG2Z commented on GitHub (Jul 23, 2022):

This is on my list of things to do, I hope to get around to implementing it next month when I'm home alone. 🤞

@LGUG2Z commented on GitHub (Jul 23, 2022): This is on my list of things to do, I hope to get around to implementing it next month when I'm home alone. 🤞
Author
Owner

@LGUG2Z commented on GitHub (Aug 11, 2022):

For anyone who is interested I have started working on this in the early access repository for monthly sponsors:

https://github.com/LGUG3Z/komorebi-dev/tree/feature/tcp-listener

Start komorebi.exe as a background process

USAGE:
    komorebic.exe start [OPTIONS]

OPTIONS:
    -a, --await-configuration    Wait for 'komorebic complete-configuration' to be sent before processing events
    -f, --ffm                    Allow the use of komorebi's custom focus-follows-mouse implementation
    -h, --help                   Print help information
    -t, --tcp-server             Start a TCP server on port 43663 to allow the direct sending of SocketMessages

Still quite a bit of outstanding work to make the port configurable, track connected and purge disconnected clients, and probably export a JSON Schema of all available socket messages to allow people to generate type-safe code in Python/Node etc to send commands to komorebi over TCP.

@LGUG2Z commented on GitHub (Aug 11, 2022): For anyone who is interested I have started working on this in the early access repository for monthly sponsors: https://github.com/LGUG3Z/komorebi-dev/tree/feature/tcp-listener ``` Start komorebi.exe as a background process USAGE: komorebic.exe start [OPTIONS] OPTIONS: -a, --await-configuration Wait for 'komorebic complete-configuration' to be sent before processing events -f, --ffm Allow the use of komorebi's custom focus-follows-mouse implementation -h, --help Print help information -t, --tcp-server Start a TCP server on port 43663 to allow the direct sending of SocketMessages ``` Still quite a bit of outstanding work to make the port configurable, track connected and purge disconnected clients, and probably export a JSON Schema of all available socket messages to allow people to generate type-safe code in Python/Node etc to send commands to `komorebi` over TCP.
Author
Owner

@LGUG2Z commented on GitHub (Aug 15, 2022):

@SF-300 if you end up sharing what you build on GitHub, let me know and I'll add a link to the README!

@LGUG2Z commented on GitHub (Aug 15, 2022): @SF-300 if you end up sharing what you build on GitHub, let me know and I'll add a link to the README!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#108