{"id":15168585,"url":"https://github.com/ciavash/sway-config","last_synced_at":"2025-10-01T00:32:19.627Z","repository":{"id":147482296,"uuid":"421846992","full_name":"CIAvash/Sway-Config","owner":"CIAvash","description":"A Raku library and script for parsing Sway window manager's config","archived":true,"fork":false,"pushed_at":"2022-02-21T11:58:26.000Z","size":61,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-30T17:36:43.823Z","etag":null,"topics":["app","cli","command-line","config","library","module","parser","raku","raku-module","rakulang","sway","sway-config","swaywm"],"latest_commit_sha":null,"homepage":"https://codeberg.org/CIAvash/Sway-Config","language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CIAvash.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","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":"2021-10-27T14:16:18.000Z","updated_at":"2024-03-30T12:40:57.000Z","dependencies_parsed_at":"2023-07-24T19:18:10.902Z","dependency_job_id":null,"html_url":"https://github.com/CIAvash/Sway-Config","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"a9c2cba41c6d247af5e9e551b1921e901bbb630b"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FSway-Config","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FSway-Config/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FSway-Config/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CIAvash%2FSway-Config/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CIAvash","download_url":"https://codeload.github.com/CIAvash/Sway-Config/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234803486,"owners_count":18889263,"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":["app","cli","command-line","config","library","module","parser","raku","raku-module","rakulang","sway","sway-config","swaywm"],"created_at":"2024-09-27T06:23:19.987Z","updated_at":"2025-10-01T00:32:19.287Z","avatar_url":"https://github.com/CIAvash.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"NAME\n====\n\nSway::Config - A [Raku](https://www.raku-lang.ir/en) library and script for parsing [Sway](https://swaywm.org/) window manager's config.\n\nDESCRIPTION\n===========\n\nSway::Config is a module and program for parsing [Sway](https://swaywm.org/) window manager's config, and getting the raw `Match`, configs, variables, modes and key bindings, either as Raku data structures or as JSON.\n\nINSTALLATION\n============\n\nYou need to have [Raku](https://www.raku-lang.ir/en) and [zef](https://github.com/ugexe/zef), then run:\n\n```console\nzef install --/test \"Sway::Config:auth\u003czef:CIAvash\u003e\"\n```\n\nor if you have cloned the repo:\n\n```console\nzef install .\n```\n\nTESTING\n=======\n\n```console\nprove -ve 'raku -I.' --ext rakutest\n```\n\nCLI\n===\n\n## SYNOPSIS\n```\nsway-config - Parses Sway config and prints the specified section\n\nBy default gets the config from sway, unless config or config path is provided via stdin or command option.\n\nThen parses the config and prints the requested output as JSON.\n\nUsage:\n  bin/sway-config -v|--version -- Prints version\n  bin/sway-config all [-i|--stdin] [-c|--config-path=\u003cStr\u003e] -- Prints configs, variables, modes and key_bindings as JSON\n  bin/sway-config configs [-i|--stdin] [-c|--config-path=\u003cStr\u003e] -- Prints configs as JSON\n  bin/sway-config match [-i|--stdin] [-c|--config-path=\u003cStr\u003e] -- Prints raw match as JSON\n  bin/sway-config variable [-i|--stdin] [-c|--config-path=\u003cStr\u003e] -- Prints variables as JSON\n  bin/sway-config mode [-i|--stdin] [-c|--config-path=\u003cStr\u003e] -- Prints modes as JSON\n  bin/sway-config key_binding [-i|--stdin] [-c|--config-path=\u003cStr\u003e] -- Prints key bindings as JSON (Object/Hash)\n  bin/sway-config key_bindings [-i|--stdin] [-c|--config-path=\u003cStr\u003e] -- Prints key bindings as JSON (Array)\n```\n\n## COPYRIGHT\n\nCopyright © 2021 Siavash Askari Nasr\n\n## LICENSE\n\nsway-config is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nsway-config is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License along with sway-config. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\nLIBRARY\n=======\n\n## SYNOPSIS\n\n```raku\nuse Sway::Config:auth\u003czef:CIAvash\u003e;\n\n# By default Sway::Config gets the config from Sway\nmy $config = Sway::Config.new;\n\n# Giving the config content to Sway::Config\nmy $config2 = Sway::Config.new: :config('Your Config Here');\n\n# Giving path of a config file to Sway::Config\nmy $config3 = Sway::Config.new: :config_path\u003cPath to config file\u003e;\n\nput $config.match;\n\nput $config.mode\u003cresize\u003e;\n\nput $config.configs: :json;\n```\n\n## ATTRIBUTES\n\n### has Str $.config\n\nContent of the config to parse\n\n### has IO() $.config_path\n\nPath to the config file\n\n## METHODS\n\n### multi method match\n\n```raku\nmulti method match() returns Match\n```\n\nReturns the raw match object\n\n### multi method match\n\n```raku\nmulti method match(\n    Bool:D :json($)\n) returns Str\n```\n\nReturns the raw `Match` object as JSON\n\n### multi method configs\n\n```raku\nmulti method configs() returns Array\n```\n\nReturns the parsed confis as an `Array`\n\n### multi method configs\n\n```raku\nmulti method configs(\n    Bool:D :json($)\n) returns Str\n```\n\nReturns the parsed confis as JSON\n\n### multi method variable\n\n```raku\nmulti method variable() returns Hash\n```\n\nReturns the parsed variables as a `Hash`\n\n### multi method variable\n\n```raku\nmulti method variable(\n    Bool:D :json($)\n) returns Str\n```\n\nReturns the parsed variables as JSON\n\n### multi method mode\n\n```raku\nmulti method mode() returns Hash\n```\n\nReturns the parsed modes as a `Hash`\n\n### multi method mode\n\n```raku\nmulti method mode(\n    Bool:D :json($)\n) returns Str\n```\n\nReturns the parsed modes as JSON\n\n### multi method key_binding\n\n```raku\nmulti method key_binding() returns Hash\n```\n\nReturns the parsed key bindings as a `Hash`\n\n### multi method key_binding\n\n```raku\nmulti method key_binding(\n    Bool:D :json($)\n) returns Str\n```\n\nReturns the parsed key bindings as JSON (Object/Hash)\n\n### multi method key_bindings\n\n```raku\nmulti method key_bindings() returns List\n```\n\nReturns the parsed key bindings as a `List`\n\n### multi method key_bindings\n\n```raku\nmulti method key_bindings(\n    Bool:D :json($)\n) returns Str\n```\n\nReturns the parsed key bindings as JSON (Array)\n\n### multi method all\n\n```raku\nmulti method all() returns Hash\n```\n\nReturns the parsed configs, variables, modes and key bindings as a `Hash`\n\n### multi method all\n\n```raku\nmulti method all(\n    Bool:D :json($)\n) returns Str\n```\n\nReturns the parsed configs, variables, modes and key bindings as JSON\n\n## COPYRIGHT\n\nCopyright © 2021 Siavash Askari Nasr\n\n## LICENSE\n\nSway::Config is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.\n\nSway::Config is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License along with Sway::Config. If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n\nREPOSITORY\n==========\n\n[https://github.com/CIAvash/Sway-Config/](https://github.com/CIAvash/Sway-Config/)\n\nBUG\n===\n\n[https://github.com/CIAvash/Sway-Config/issues](https://github.com/CIAvash/Sway-Config/issues)\n\nAUTHOR\n======\n\nSiavash Askari Nasr - [https://www.ciavash.name](https://www.ciavash.name)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciavash%2Fsway-config","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fciavash%2Fsway-config","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fciavash%2Fsway-config/lists"}