-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Migrate the config to hyprlang #4656
Conversation
build fail by use meson success by use cmake |
@DreamMaoMao meson should work now. |
I can test once you have a way for me to add plugin settings. Normal workflow does not work without hy3. |
@outfoxxed done. Check the PluginAPI header for API changes. |
from my testing this is ready to review. |
seems to have removed case insensitivity. not sure if intended or not.
has to be
now |
true, hyprlang is case-sensitive. IDK, never was meant to be capitalized, tbh |
This also breaks multiple |
nice catch. Needs a fix in hyprlang. |
should be fixed. @DreamMaoMao Your plugin's code is wrong, though. static const auto *pEnable_hotarea_config = (Hyprlang::INT *const *)HyprlandAPI::getConfigValue(PHANDLE, "plugin:hycov:enable_hotarea"); no, read the API signature... static const auto *pEnable_hotarea_config = (Hyprlang::INT *const *)(HyprlandAPI::getConfigValue(PHANDLE, "plugin:hycov:enable_hotarea")->getDataStaticPtr()); Note: the fix I committed requires hyprlang-git to work |
The plug-in is loaded successfully |
don't forget to mention that no multiline |
Crashes when I create a string value, then the plugin loader eats the error message.
Happens at #define CONF(NAME, TYPE, VALUE) \
HyprlandAPI::addConfigValue(PHANDLE, "plugin:hy3:" NAME, Hyprlang::CConfigValue((Hyprlang::TYPE) VALUE))
// general
CONF("no_gaps_when_only", INT, 0);
CONF("node_collapse_policy", INT, 2);
CONF("group_inset", INT, 10);
CONF("tab_first_window", INT, 0);
// tabs
CONF("tabs:height", INT, 15);
CONF("tabs:padding", INT, 5);
CONF("tabs:from_top", INT, 0);
CONF("tabs:rounding", INT, 3);
CONF("tabs:render_text", INT, 1);
CONF("tabs:text_center", INT, 0);
CONF("tabs:text_font", STRING, "Sans");
CONF("tabs:text_height", INT, 8);
CONF("tabs:text_padding", INT, 3);
CONF("tabs:col.active", INT, 0xff32b4ff);
CONF("tabs:col.urgent", INT, 0xffff4f4f);
CONF("tabs:col.inactive", INT, 0x80808080);
CONF("tabs:col.text.active", INT, 0xff000000);
CONF("tabs:col.text.urgent", INT, 0xff000000);
CONF("tabs:col.text.inactive", INT, 0xff000000);
// autotiling
CONF("autotile:enable", INT, 0);
CONF("autotile:ephemeral_groups", INT, 1);
CONF("autotile:trigger_height", INT, 0);
CONF("autotile:trigger_width", INT, 0);
CONF("autotile:workspaces", STRING, "all");
#undef CONF |
was this supported in hl? @DreamMaoMao You're reading the initial values and storing them, why would you expect them to be updated? If you want to keep track of the actual values, store the static pointers. @outfoxxed odd, code above in maomao's case has strings too and it works. Where can I find your code? |
@outfoxxed to me it seems like the bug that I fixed yesterday. Update hyprlang to git and recompile latest commit from this branch. |
static const auto *pEnable_hotarea_config = (Hyprlang::INT *const *)(HyprlandAPI::getConfigValue(PHANDLE, "plugin:hycov:enable_hotarea")->getDataStaticPtr()); Why not update when it is available in the configuration file as before, and use the default value in the code when the option is not found in the configuration. I don't want to keep track of the latest changes but I just want to get the values in the configuration file once in this code, which I could have done in the previous code. |
would be horribly inefficient and I can't see how that has worked before. The config needs to be parsed for the values in the config to propagate. If that was done every time you queried getConfigValue that's like 30 parses just in your handler... If you wanna do this once for whatever reason (instead of grabbing the static ptr and in your uses just use |
This is a bit different from my design, I have to get the value configured in the actual configuration file before doing everything to decide whether to hook functions and register events to avoid unnecessary hooks, is there no way for me to actively get the actual value on the configuration file? |
if you really want to you can call |
thanks it work now. |
Works for hy3 now. |
Nix: update hyprlang
set to merge once arc lonix updates to 0.3.2 |
* Migrate to hyprlang * pop up errors * fix swapped args * Meson & Nix: build with hyprlang * CI: add hyprlang to setup action * add infra for plugin stuff * fix hyprctl getoption * fix hyprctl getoption with json * format * fix post parse logic * fix autogen config * oops missed exec-once * fmt * fix ws rules * require 0.3.0 for hyprlang * nix: flaek * minor type fixes * fix cfg usages in swipe * use cvarlist for ws rules * fix throw in addPluginConfigVar * Nix: update hyprlang * minor fixes * fix disableLogs * mention hyprlang docs * bump hyprlang dep in cmake * Meson: bump min hyprlang version Nix: update hyprlang * minor fix * Nix: update meson patch --------- Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
* Migrate to hyprlang * pop up errors * fix swapped args * Meson & Nix: build with hyprlang * CI: add hyprlang to setup action * add infra for plugin stuff * fix hyprctl getoption * fix hyprctl getoption with json * format * fix post parse logic * fix autogen config * oops missed exec-once * fmt * fix ws rules * require 0.3.0 for hyprlang * nix: flaek * minor type fixes * fix cfg usages in swipe * use cvarlist for ws rules * fix throw in addPluginConfigVar * Nix: update hyprlang * minor fixes * fix disableLogs * mention hyprlang docs * bump hyprlang dep in cmake * Meson: bump min hyprlang version Nix: update hyprlang * minor fix * Nix: update meson patch --------- Co-authored-by: Mihai Fufezan <fufexan@protonmail.com>
cc @fufexan @MightyPlaza @DreamMaoMao @outfoxxed @horriblename @thejch
Breaking: everything internally (all plugins)
This MR migrates hyprland's config to hyprlang. PLEASE NOTE this requires latest hyprlang-git. Once this mr is gtg, I'll bump ver to 0.3.0.
Please test this, some parts have been written at 3AM and I'll be surprised if I havent missed some
*PVAR
->**PVAR
occurrences.TODO:
List of breaking changes for end users:
hyprctl getoption
has a new return syntaxdevice
sections takename = ...
instead ofdevice:... {