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

[WIP] C++ port Proof of Concept #3

Draft
wants to merge 36 commits into
base: reintegrate-v2
Choose a base branch
from

Conversation

Nekotekina
Copy link

@Nekotekina Nekotekina commented Dec 15, 2024

Not for merge.
Fixes issues with capslock indicator being reset (in Wayland, for example) (feel free to cherry-pick).
Fixes cursed issues with C fixed arrays by using C++ (partially).
The fact these issues exist is infuriating. Fixing this in pure C will only waste a lot of time.

@Nekotekina Nekotekina force-pushed the master branch 4 times, most recently from b57afba to 78f83a5 Compare December 15, 2024 11:35
@Nekotekina Nekotekina force-pushed the master branch 20 times, most recently from 1496ffb to f50af0e Compare December 18, 2024 06:44
@rhansen rhansen marked this pull request as draft December 18, 2024 09:19
@rhansen rhansen changed the base branch from main to reintegrate-v2 December 18, 2024 09:21
@rhansen
Copy link
Contributor

rhansen commented Dec 18, 2024

I haven't looked at the commits but in general I'm a fan of the idea of switching to C++. It doesn't look like upstream is willing to switch, so this would have to be done in a permanent fork.

@Nekotekina
Copy link
Author

I don't really see any reason against. Maybe I was too rude after all. If it's memory usage on some embedded system, dynamic allocations in C++ only work in favor on C++. I have already significantly reduced static memory usage. Because with dynamic alloc you only pay more memory as your config grows bigger.

Also allow includes to have non-.conf extensions.
Also split table to reduce memory size.
Improve indicator on Wayland (resist forced changes).
Optimize layer_indicator performance.
Fix previous unnecessary LED setting.
Compatible with previous settings because CAPS_LOCK equals 1.
Based on pull-request initially proposed by @plague-spreader
Macro no longer allowes "words" (char sequences without delimiters).
In order to write "Hello" it must be written as macro(H e l l o).
Alternatively, it can be t(Hello) or type(Hello).
Shell commands can't execute via `keyd do`.
Example: macro(cmd(echo 1))
Also allow implicit layer creation on bindings.
Add leftctrl/leftsuper-alike key aliases.
Allow ctrl as layer name equal to control.
Allow multiname aliases in alias section.
@Nekotekina Nekotekina force-pushed the master branch 6 times, most recently from 0a1b768 to 4ee374b Compare December 24, 2024 22:34
Refactor config_backup class.
Also use C++20 'using enum class'.
`keyd do` or `keyd bind` will copy user's credentials.
Loaded .conf file will use keyd process credentials.
Don't kill child processes in systemd config.
Allow a train of IPC messages for optimization.
Remove full `*` wildcard support.
Initially `m:*` was proposed by @jyn514
Additional wildcard `a:` to include abs pointer devices.
When using `m:` those devices are excluded.
@Nekotekina Nekotekina force-pushed the master branch 9 times, most recently from 80e8208 to 5b5aa2d Compare December 26, 2024 09:38
These commands may be useful to execute at user session startup.
User bindings are loaded by explicit calling `keyd reload` from user.
User bindings are located at `~/.config/keyd/bindings.conf`.
Implement file_reader class (simple fd->container).
Implement concat class for simple formatting strings.
Some options allow significantly reduce executable size.
Static part of libstdc++ now is only 130~150 Kb.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants