https://github.com/hyprwm/hyprlang
The official implementation library for the hypr config language.
https://github.com/hyprwm/hyprlang
hyprland language parser
Last synced: 7 months ago
JSON representation
The official implementation library for the hypr config language.
- Host: GitHub
- URL: https://github.com/hyprwm/hyprlang
- Owner: hyprwm
- License: lgpl-3.0
- Created: 2023-12-28T16:01:03.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-15T16:45:28.000Z (over 1 year ago)
- Last Synced: 2024-05-16T05:29:46.203Z (over 1 year ago)
- Topics: hyprland, language, parser
- Language: C++
- Homepage: https://hyprland.org/hyprlang
- Size: 159 KB
- Stars: 102
- Watchers: 4
- Forks: 11
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# hyprlang
The hypr configuration language is an extremely efficient, yet easy to work with, configuration language
for linux applications.
It's user-friendly, easy to grasp, and easy to implement.
## Building and installation
Building is done via CMake:
```sh
cmake --no-warn-unused-cli -DCMAKE_BUILD_TYPE:STRING=Release -DCMAKE_INSTALL_PREFIX:PATH=/usr -S . -B ./build
cmake --build ./build --config Release --target hyprlang -j`nproc 2>/dev/null || getconf _NPROCESSORS_CONF`
```
Install with:
```sh
sudo cmake --install ./build
```
## Example config
```ini
bakery {
counter_color = rgba(ee22eeff) # color by rgba()
door_color = rgba(122, 176, 91, 0.1) # color by rgba()
dimensions = 10 20 # vec2
employees = 3 # int
average_time_spent = 8.13 # float
hackers_password = 0xDEADBEEF # int, as hex
# nested categories
secrets {
password = hyprland # string
}
}
# variable
$NUM_ORDERS = 3
cakes {
number = $NUM_ORDERS # use a variable
colors = red, green, blue # string
}
# keywords, invoke your own handler with the parameters
add_baker = Jeremy, 26, Warsaw
add_baker = Andrew, 21, Berlin
add_baker = Koichi, 18, Morioh
```
## Docs
Visit [hyprland.org/hyprlang](https://hyprland.org/hyprlang) to see the documentation.
### Example implementation
For an example implementation, take a look at the `tests/` directory.