Comments (10)
I quickly put together a rough draft.
It uses for getting information about windows (wayland/sway) which also shows which windows is focused. I searched, but it seems there is no universal way to get this information in wayland, so this only works in sway.swaymsg
Sends a request to change the layer to the current window name.
Needs significant improvements, for example switch to the default layer, if current window is not in the list of application-specific layers.
Here is the code: https://github.com/veyxov/qanata (sorry for the name 😅)
Updates:
Saw the xremap implementation for sway, it looks a lot cleaner. Maybe I can integrate some parts from that.
Now using swayipc to get the window name.
from kanata.
I use SetWinEventHook implemented a simple tool in windows: kanawin.
This is my first code with rust. I referenced ChatGPT and komokana.
This might help a little.
from kanata.
Wow, would you believe that timing! I just finished my own daemon to interact with Kanata's TCP server. I guess it's pretty similar to kanawin with a few pros and cons.
Cons
- It's not Rust :(
- Looping is less efficient than using the Windows event hook (but I've yet to see it break 0% CPU usage in Task Manager)
- No pattern matching for mapping applications to layers
Pros
- For those of us with Rust skill issues, C isn't bad!
- No config file needed. You open firefox.exe, layer "firefox" is activated.
- Additional utility "window_manager" allows you to use hotkeys to save and activate windows. Always find yourself searching for that one browser window? Bind it to a hotkey and refocus it later with a single button press.
- No dependencies
- Doesn't need to run as administrator
While it's still a work in progress, it's 100% working on my end. I'd love feedback if anyone gives it a try!
https://github.com/reidprichard/window_tools
from kanata.
For ease of discovery:
- Windows has the komokana project that integrates with kanata's TCP server
- Linux has no fancy solution, but as 13minutes-yt said, xdotool could be one way to do this
from kanata.
Just a thought. I have been using Espanso as a text expander and noticed they have application aware triggers.
Can't a crate be used in kanata for that purpose?
https://github.com/espanso/espanso/search?q=Appinfo
from kanata.
Yep, that's a good reference to use if one were to implement this in kanata.
https://github.com/espanso/espanso/tree/9f82b4e146e6090897c876a02f5eee697b85e979/espanso-info
from kanata.
Is tcp server needed? In linux xdotool can get the activewindow
xdotool getactivewindow getwindowclassname
and xdotool can also simulate keystroke movements( based on result of getactivewindow)
xdotool keydown n
(can be used to switch to layer)
from kanata.
The TCP server is not necessary for this particular feature as you've shown. There can be workarounds that don't involve inter-process communication.
However, the TCP server is nice to have for software integrations.
from kanata.
espanso offers similar features than autohotkey hotstrings, and similar to ahk hotstrings espanso won't work while kanata is running (at least on windows).
But if we could tell espanso to listen to the kanata ouput instead of the real keyboard it should work?
Is the kanata tcp server the right thing to use to make espanso listen to it?
from kanata.
I think it makes sense to convert this to a discussion instead of an open issue. With the TCP server it makes more sense to me to keep the functionality outside of kanata.
I also now added links to the community projects
from kanata.
Related Issues (20)
- Bug: Release 1.6.1 macos_x86_64 executable isn't what it says. HOT 6
- Feature request: Show keystroke or can let other app know the real key is stroked. HOT 2
- Feature request: Can we have a more flexible unmod? HOT 1
- See if windows shift workaround can be compiled out for winiov2 HOT 1
- Bug: kanata does not work properly with listary HOT 3
- `release-key` releases both sides of a mod and not just one, e.g. `lctl` and `rctl` or `lmet` and `rmet` HOT 7
- Feature request: Compile-time conditional mappings HOT 1
- chordsv2 activation does not trigger early interruption of `tap-hold-press|release` HOT 9
- make macro-release-cancel also cancel virtual keys HOT 1
- Bug: switch's layer logic not recognized HOT 2
- Feature request: remove dependency on AutohotKey for EnableUIAccess
- Feature request: configurable declared bus type for Linux uinput HOT 9
- unable to set linux-use-trackpoint-propety HOT 3
- one-shot shift interferes with defoverrides HOT 5
- Feature request: chord toggle action HOT 1
- Feature request: homebrew HOT 2
- Bug: special buttons on function row not working on macos HOT 2
- Bug: chord v2 overlapping chords HOT 2
- Bug: tray icons change randomly when layer changes by Meta key.
- Bug: S-home does not work as expected HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kanata.