Hyprland
Hyprland copied to clipboard
Migrate the config to hyprlang
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:
- [x] CI (@fufexan pls)
- [x] Meson (@fufexan pls)
- [x] getOption hyprctl
- [x] plugin config keywords
- [x] more testing
- [x] Better error reporting (keywords do not throw errors at all atm)
List of breaking changes for end users:
hyprctl getoptionhas a new return syntaxdevicesections takename = ...instead ofdevice:... {- All config-related plugin APIs are broken (need updates)
Even updating hyprlang to 0.2.1
this branch of hyprland still fail to build.
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. e.g. it breaks
OpenGL {
nvidia_anti_flicker = true
}
has to be
opengl {
nvidia_anti_flicker = true
}
now
true, hyprlang is case-sensitive. IDK, never was meant to be capitalized, tbh
This also breaks multiple #s
e.g.
## comment throws an error
nice catch. Needs a fix in hyprlang.
fixed in https://github.com/hyprwm/hyprlang/commit/c1f5b0ab485e13dde662e7a320a511c66b2fb386
I found 2 issues :
gapsoutfor my special workspace stopped working, it seems to be ignored.- red config error stripe appears/disapears only when closing hyprland completely and re-running it, not when using hyprctl (found by jappie3)
@fufexan can't get meson to work, also tried putting hyprland and hyprland.dev in shell inputs
Run-time dependency hyprlang found: NO (tried pkgconfig and cmake)
src/meson.build:14:4: ERROR: Dependency "hyprlang" not found, tried pkgconfig and cmake
Commit dac898d69ca8227a3e9eaf1997dedee1f7c76024 (Nix)
- Shadows are not working
decoration {
col.shadow=rgb(2E3440)
drop_shadow=true
shadow_range=25
shadow_render_power=3
}
- Groupbar render_titles=false is not working
group {
groupbar {
render_titles=false
...
}
}
@DreamMaoMao meson should work now.
it work to me now
@fufexan can't get meson to work, also tried putting hyprland and hyprland.dev in shell inputs
Run-time dependency hyprlang found: NO (tried pkgconfig and cmake) src/meson.build:14:4: ERROR: Dependency "hyprlang" not found, tried pkgconfig and cmake
may need to install the latest committed hyprlang
for what is a man, what has he got?
@Vagahbond in what case? gaps_out seems to be working for me normally.
@ErrorNoInternet fixed both :)
@DreamMaoMao hyprlang 0.3.0 needed
I can swipe across multiple workspaces in one swipe using my laptop's trackpad, is this intended?
if you enable it ;)
fixed
@Vagahbond in what case? gaps_out seems to be working for me normally.
Hyprland, built from branch at commit 80ae6dbf754b9773a7375fde7c9d8495732c8e25 ().
Date: 2024-02-10
Tag:
flags: (if any)
My conf bit for this is :
workspace = special:scratchpad, on-created-empty:foot zsh -c 'nitch; zsh -i' & gnome-pomodoro,gapsout:50
gaps out for regular windows work normally but for my scratchpad they're borken.
It used to work before I switch to that PR, is the issue between chair and desk ?
fixed
gotta wait for arc lonix to have hyprlang 0.3 in their standard repos not -testing and this should be gtg
fwiw this should also reduce CPU usage as I found some places where some idiots slipped through my reviews and made very poor decisions as to how the config should be pulled
Adding config variables via HyprlandAPI is segfaulting. Fairly sure I'm using it correctly from reading the mr.
#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
[LOG] Creating the PluginSystem!
[LOG] Loading plugin /home/admin/programming/outfoxxed/hyprland/hy3/build/libhy3.so which is now present in config
[Detaching after vfork from child process 47858]
[Detaching after vfork from child process 47859]
Thread 1 "Hyprland" received signal SIGSEGV, Segmentation fault.
0x00007ffff74a3735 in Hyprlang::CConfigValue::setFrom(std::any) ()
from /nix/store/wb4hl303qyd53anm1d0fp4h426l3gcl1-hyprlang-0.pre+date=2024-02-09_335d0c6/lib/libhyprlang.so.0
(gdb) bt
#0 0x00007ffff74a3735 in Hyprlang::CConfigValue::setFrom(std::any) ()
from /nix/store/wb4hl303qyd53anm1d0fp4h426l3gcl1-hyprlang-0.pre+date=2024-02-09_335d0c6/lib/libhyprlang.so.0
#1 0x00007ffff74a3897 in Hyprlang::CConfigValue::CConfigValue(Hyprlang::CConfigValue const&) ()
from /nix/store/wb4hl303qyd53anm1d0fp4h426l3gcl1-hyprlang-0.pre+date=2024-02-09_335d0c6/lib/libhyprlang.so.0
#2 0x00000000009c86c1 in CConfigManager::addPluginConfigVar(void*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Hyprlang::CConfigValue const&) ()
#3 0x000000000103938f in addConfigValue ()
#4 0x00007fffd0f845da in pluginInit (handle=<optimized out>) at /nix/store/LBAMP822R4DMQ2F7VIZVSWBILK83AWSR-gcc-13.2.0/include/c++/13.2.0/bits/basic_string.tcc:238
#5 0x0000000001061dd8 in CPluginSystem::loadPlugin(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#6 0x00000000010656ed in CPluginSystem::updateConfigPlugins(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool&) ()
#7 0x00000000009c79dc in CConfigManager::handlePluginLoads() ()
#8 0x00000000006dd303 in CCompositor::initManagers(eManagersInitStage) ()
#9 0x00000000006d34bc in CCompositor::initServer() ()
#10 0x0000000000e1dc79 in main ()
There's still an issue in this branch with the config file reloading... @Vagahbond hinted at it earlier (the error not going away when fixing the config) and @ErrorNoInternet also encountered some weird behavior.
If I edit hyprland.conf & add some gibberish to a random word, no error appears & hyprctl reload returns ok like nothing's wrong.
hyprctl version: Hyprland, built from branch at commit d23884e8e70cb5825fef47bd1aa23563aae5095a
Haven't gotten to the bottom of it yet, just posting it here to make sure it doesn't get overlooked.
https://github.com/DreamMaoMao/hycov/blob/hyprlang/src/main.cpp
there are no any errors in build. but hyprland crashed when the plugin was loaded, and neither coredump nor the crash log had any useful information.Did I do something wrong?
@outfoxxed wooops gimme sec
@outfoxxed can you try https://github.com/hyprwm/hyprlang/commit/7c5f672b2fedafd29ea8227862a3b60b743080cf
@DreamMaoMao you too, this should fix stuff.
@Jappie3 can't repro.
adding lines like:
cock
windowrule22222222222222222 = e
bindaaaaaaaaa = eee, e,ee,e ,ee,ee
all throw for me and go away when fixed.
Config?