{"id":17652683,"url":"https://github.com/sidorares/xrandr-parse","last_synced_at":"2025-07-06T20:37:59.423Z","repository":{"id":13045680,"uuid":"15725650","full_name":"sidorares/xrandr-parse","owner":"sidorares","description":"parse the output of the `xrandr` command","archived":false,"fork":false,"pushed_at":"2014-01-05T06:07:16.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-30T09:13:06.614Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"substack/xrandr-parse","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sidorares.png","metadata":{"files":{"readme":"readme.markdown","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}},"created_at":"2014-01-08T04:42:21.000Z","updated_at":"2022-09-17T20:07:48.000Z","dependencies_parsed_at":"2022-10-03T06:00:13.145Z","dependency_job_id":null,"html_url":"https://github.com/sidorares/xrandr-parse","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/sidorares/xrandr-parse","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidorares%2Fxrandr-parse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidorares%2Fxrandr-parse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidorares%2Fxrandr-parse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidorares%2Fxrandr-parse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sidorares","download_url":"https://codeload.github.com/sidorares/xrandr-parse/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sidorares%2Fxrandr-parse/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263969178,"owners_count":23537381,"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":[],"created_at":"2024-10-23T11:47:40.509Z","updated_at":"2025-07-06T20:37:59.390Z","avatar_url":"https://github.com/sidorares.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# xrandr-parse\n\nparse the output of the `xrandr` command\n\n# example\n\n``` js\nvar parse = require('xrandr-parse');\nvar exec = require('child_process').exec;\n\nexec('xrandr', function (err, stdout) {\n    var query = parse(stdout);\n    console.log(JSON.stringify(query, null, 2));\n});\n```\n\nthe `xrandr` command produced this output:\n\n```\nScreen 0: minimum 320 x 200, current 1366 x 768, maximum 3360 x 2048\nLVDS connected 1366x768+0+0 (normal left inverted right x axis y axis) 256mm x 144mm\n   1366x768       60.0*+   50.0  \n   1360x768       60.0     50.0  \n   1280x768       60.0     50.0  \n   1280x720       60.0     50.0  \n   1024x768       60.0     50.0  \n   1024x600       60.0     50.0  \n   800x600        60.0     50.0  \n   800x480        60.0     50.0  \n   640x480        60.0     50.0  \nDFP1 disconnected (normal left inverted right x axis y axis)\nCRT1 disconnected (normal left inverted right x axis y axis)\n```\n\nand the parsed query was:\n\n```\n{\n  \"LVDS\": {\n    \"connected\": true,\n    \"width\": 1366,\n    \"height\": 768,\n    \"modes\": [\n      {\n        \"width\": \"1366\",\n        \"height\": \"768\",\n        \"rate\": 60\n      },\n      {\n        \"width\": \"1360\",\n        \"height\": \"768\",\n        \"rate\": 60\n      },\n      {\n        \"width\": \"1280\",\n        \"height\": \"768\",\n        \"rate\": 60\n      },\n      {\n        \"width\": \"1280\",\n        \"height\": \"720\",\n        \"rate\": 60\n      },\n      {\n        \"width\": \"1024\",\n        \"height\": \"768\",\n        \"rate\": 60\n      },\n      {\n        \"width\": \"1024\",\n        \"height\": \"600\",\n        \"rate\": 60\n      },\n      {\n        \"width\": \"800\",\n        \"height\": \"600\",\n        \"rate\": 60\n      },\n      {\n        \"width\": \"800\",\n        \"height\": \"480\",\n        \"rate\": 60\n      },\n      {\n        \"width\": \"640\",\n        \"height\": \"480\",\n        \"rate\": 60\n      }\n    ],\n    \"index\": 0,\n    \"native\": {\n      \"width\": \"1366\",\n      \"height\": \"768\",\n      \"rate\": 60\n    },\n    \"current\": {\n      \"width\": \"1366\",\n      \"height\": \"768\",\n      \"rate\": 60\n    }\n  },\n  \"DFP1\": {\n    \"connected\": false,\n    \"modes\": [],\n    \"index\": 1\n  },\n  \"CRT1\": {\n    \"connected\": false,\n    \"modes\": [],\n    \"index\": 2\n  }\n}\n```\n\n# methods\n\n``` js\nvar parse = require('xrandr-parse')\n```\n\n## parse(xrandrOutput)\n\nReturn the parsed output from a string full of the output from `xrandr`,\n`xrandrOutput`.\n\nThe return object is keyed by each output name.\n\n# install\n\nWith [npm](https://npmjs.org) do:\n\n```\nnpm install xrandr-parse\n```\n\n# license\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidorares%2Fxrandr-parse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsidorares%2Fxrandr-parse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsidorares%2Fxrandr-parse/lists"}