Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TCP socket in addition to Unix Domain? #176

Closed
SF-300 opened this issue Jul 12, 2022 · 3 comments
Closed

TCP socket in addition to Unix Domain? #176

SF-300 opened this issue Jul 12, 2022 · 3 comments
Assignees
Labels
early access Feature-in-progress available to GitHub Sponsors enhancement New feature or request

Comments

@SF-300
Copy link

SF-300 commented Jul 12, 2022

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!

@LGUG2Z LGUG2Z self-assigned this Jul 23, 2022
@LGUG2Z LGUG2Z added the enhancement New feature or request label Jul 23, 2022
@LGUG2Z
Copy link
Owner

LGUG2Z commented 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 LGUG2Z added the early access Feature-in-progress available to GitHub Sponsors label Aug 11, 2022
@LGUG2Z
Copy link
Owner

LGUG2Z commented 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 LGUG2Z closed this as completed in d3dc193 Aug 15, 2022
@LGUG2Z
Copy link
Owner

LGUG2Z commented 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 up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
early access Feature-in-progress available to GitHub Sponsors enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants