{"id":28165017,"url":"https://github.com/anotherhadi/hyprlang-parser","last_synced_at":"2025-05-15T12:10:48.066Z","repository":{"id":215291301,"uuid":"738579895","full_name":"anotherhadi/hyprlang-parser","owner":"anotherhadi","description":"A Golang implementation library for the hypr config language (Hyprlang).","archived":false,"fork":false,"pushed_at":"2024-02-11T15:06:47.000Z","size":14,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-06-21T17:54:14.430Z","etag":null,"topics":["golang","hyprland","hyprlang","parser"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/anotherhadi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-03T14:57:09.000Z","updated_at":"2024-06-05T17:10:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"ee141c76-7efe-4f3b-8228-701c6e6a6408","html_url":"https://github.com/anotherhadi/hyprlang-parser","commit_stats":null,"previous_names":["anotherhadi/hyprlang_parser","anotherhadi/hyprlang-parser"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anotherhadi%2Fhyprlang-parser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anotherhadi%2Fhyprlang-parser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anotherhadi%2Fhyprlang-parser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/anotherhadi%2Fhyprlang-parser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/anotherhadi","download_url":"https://codeload.github.com/anotherhadi/hyprlang-parser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254337583,"owners_count":22054254,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["golang","hyprland","hyprlang","parser"],"created_at":"2025-05-15T12:10:47.526Z","updated_at":"2025-05-15T12:10:48.047Z","avatar_url":"https://github.com/anotherhadi.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hyprlang Parser\n\n\u003cp\u003e\n    \u003ca href=\"https://github.com/anotherhadi/hyprlang-parser/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/anotherhadi/hyprlang-parser.svg\" alt=\"Latest Release\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://pkg.go.dev/github.com/anotherhadi/hyprlang-parser?tab=doc\"\u003e\u003cimg src=\"https://godoc.org/github.com/golang/gddo?status.svg\" alt=\"GoDoc\"\u003e\u003c/a\u003e\n    \u003ca href=\"https://goreportcard.com/report/github.com/anotherhadi/hyprlang-parser\"\u003e\u003cimg src=\"https://goreportcard.com/badge/github.com/anotherhadi/hyprlang-parser\" alt=\"GoReportCard\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\nA Golang implementation library for the hypr config language.\n\n## Installation\n\n```bash\ngo get https://github.com/anotherhadi/hyprlang-parser@latest\n```\n\n## Functions\n\n**Understanding Section and Variable Parameters:**\n\nFor most functions, you'll need to provide a \"section\" and a \"variable\" parameter.\n\n- The \"section\" represents the name of the section, which is separated by forward slashes (/).\n- The main section can be represented by either an empty string (\"\") or a single forward slash (\"/\").\n- A decoration section could be \"decoration\" (or \"/decoration/\", as per your preference).\n\nSo, for example, to retrieve the enabled variable in the decoration section for blur:\n\n- Set `section=\"decoration/blur\"`\n- Set `variable=\"enabled\"`\n\n---\n\n| Function         | Explanation                                    | Example                                         |\n|------------------|------------------------------------------------|-------------------------------------------------|\n| LoadConfig       | Loads a configuration file at the specified path and returns a Config struct. It also adds the sourced configuration files. | ```config, err := LoadConfig(\"~/.config/hypr/hyprland.conf\")``` |\n| WriteConfig      | Writes/saves changed configurations.          | ```err := config.WriteConfig()```            |\n| GetFirst         | Returns the first value for the specified variable in the given section. | ```value := config.GetFirst(\"input\", \"kb_layout\")``` |\n| GetAll           | Returns all the values for the specified variable in the given section. | ```values := config.GetAll(\"\", \"exec-once\")``` |\n| EditFirst        | Changes the value of the first occurrence of the specified variable in the given section to the provided value. Returns an error if the variable was not found. | ```err := config.EditFirst(\"input/touchpad\", \"natural_scroll\", \"true\")``` |\n| EditN            | Changes the value of the nth occurrence of the specified variable in the given section to the provided value. Returns an error if the variable was not found. | ```err := config.EditN(\"animations\", \"bezier\", \"winIn, 0.05, 0.9, 0.1, 1.1\", 2)``` |\n| Add              | Creates a new variable with the provided value in the specified section. It creates the sections if they don't exist. If sections are not found, it will add the sections and the variable to the first config file. | ```config.Add(\"decoration/blur\", \"size\", \"3\")``` |\n| RemoveFirst      | Removes the first occurrence of the specified variable in the given section. Returns an error if the variable is not found. | ```err := config.RemoveFirst(\"\", \"exec-once\")``` |\n| RemoveN          | Removes the nth occurrence of the specified variable in the given section. Returns an error if the variable is not found. | ```err := config.RemoveN(\"\", \"exec-once\", 2)``` |\n\n## Example:\n\nYou can find more examples and usage in [`hyprlang_parser_test.go`](hyprlang_parser_test.go).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanotherhadi%2Fhyprlang-parser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fanotherhadi%2Fhyprlang-parser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fanotherhadi%2Fhyprlang-parser/lists"}