hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
20.98k stars 880 forks source link

Plugin-registered config values never change past initialization #1681

Closed Duckonaut closed 1 year ago

Duckonaut commented 1 year ago

While making plugins I ran into an issue with plugin-registered config values. I can't tell why it would be happening, but they don't seem to ever be read from the config file, staying only at the value defined as the default.

Here's an example of the usage:

  1. Definition: https://github.com/Duckonaut/hyprload/blob/96a575dae08ba47124b8533db626669416195099/src/main.cpp#L64
  2. Access: https://github.com/Duckonaut/hyprload/blob/96a575dae08ba47124b8533db626669416195099/src/Hyprload.cpp#L31
  3. Usage: https://github.com/Duckonaut/hyprload/blob/96a575dae08ba47124b8533db626669416195099/src/HyprloadPlugin.cpp#L90

With the default value set as an empty string, despite having this section in my hyprland.conf, it will always throw the "No hyprland headers" error there.

plugin {
    hyprload {
        debug = 0
        quiet = 0
        hyprland_headers=/home/duckonaut/repos/Hyprland
    }
}
vaxerski commented 1 year ago

strValue of "" means the type of the variable is not str. Use STRVAL_EMPTY.

vaxerski commented 1 year ago

https://github.com/hyprwm/Hyprland/blob/489ef7c51c7d33eeba6d6a66b6697f52441ddf45/src/config/ConfigManager.cpp#L126-L132

Duckonaut commented 1 year ago

Ok, will try to see if that fixes it. I observed similar issues with the other values but maybe it's a fluke