hyprwm / hyprlang

The official implementation library for the hypr config language.
https://wiki.hyprland.org/Hypr-Ecosystem/hyprlang/
GNU Lesser General Public License v3.0
137 stars 16 forks source link

[Feat Req] Optional sourced file #57

Closed kRHYME7 closed 2 weeks ago

kRHYME7 commented 2 weeks ago

52 Conditionals is very flexible, but might be too much. So I will start from this part.

Is it possible to have a flag for source to tell hyprlang to skip or not give errors if file do not exist. Explicit sourcing is robust, but having this option opens a new window of customization.

Examples are ( q for quiet )

sourceq = /path/that/exist
sourceq = /path/that/may/not/exist
sourceq = /maybe/a/path/where/users/can/add/overrides

This can also be used to have a fallback configuration when a distro or a DE wants to have defaults without the USER touching this file.

vaxerski commented 2 weeks ago

hyprlang does not provide source. Source is implemented by users of the library as a keyword. See https://github.com/hyprwm/Hyprland/blob/0e630e9e74ad34683194a07cfe6afe55a2c0685f/src/config/ConfigManager.cpp#L289-L299

vaxerski commented 2 weeks ago

not give errors if file do not exist

# hyprlang noerror true

bind = MOD, KEY, something, amogus
someoption = blah

# hyprlang noerror false

https://wiki.hyprland.org/Configuring/

kRHYME7 commented 2 weeks ago

Thanks, I honestly forgot about this.