{"id":16384575,"url":"https://github.com/nashaofu/display-info","last_synced_at":"2026-04-02T15:23:38.582Z","repository":{"id":46902359,"uuid":"480846450","full_name":"nashaofu/display-info","owner":"nashaofu","description":"Cross-platform get display info for MacOS、Windows、Linux, Like electron Display Object.","archived":false,"fork":false,"pushed_at":"2025-02-02T04:47:24.000Z","size":84,"stargazers_count":31,"open_issues_count":2,"forks_count":16,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T23:16:13.135Z","etag":null,"topics":["display","display-info","rust","screen","x11"],"latest_commit_sha":null,"homepage":"https://docs.rs/display-info","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nashaofu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["nashaofu"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"lfx_crowdfunding":null,"polar":null,"buy_me_a_coffee":null,"custom":null}},"created_at":"2022-04-12T14:30:48.000Z","updated_at":"2025-03-10T12:46:29.000Z","dependencies_parsed_at":"2023-12-20T15:11:29.969Z","dependency_job_id":"46a9d370-89e2-4399-8687-34f85a90d5b4","html_url":"https://github.com/nashaofu/display-info","commit_stats":{"total_commits":34,"total_committers":3,"mean_commits":"11.333333333333334","dds":0.1470588235294118,"last_synced_commit":"78c4b20fdf7dd47e92d9f8afaa7f43ec2233d6f8"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashaofu%2Fdisplay-info","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashaofu%2Fdisplay-info/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashaofu%2Fdisplay-info/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nashaofu%2Fdisplay-info/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nashaofu","download_url":"https://codeload.github.com/nashaofu/display-info/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248125591,"owners_count":21051770,"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":["display","display-info","rust","screen","x11"],"created_at":"2024-10-11T04:11:47.239Z","updated_at":"2026-04-02T15:23:38.577Z","avatar_url":"https://github.com/nashaofu.png","language":"Rust","funding_links":["https://github.com/sponsors/nashaofu"],"categories":[],"sub_categories":[],"readme":"# display-info\n\nCross-platform get display info for MacOS、Windows、Linux. Like [electron Display Object](https://www.electronjs.org/docs/latest/api/structures/display)\n\n## Example\n\n```rust\nuse display_info::DisplayInfo;\nuse std::time::Instant;\n\nfn main() {\n  let start = Instant::now();\n\n  let display_infos = DisplayInfo::all().unwrap();\n  for display_info in display_infos {\n    println!(\"display_info {display_info:?}\");\n  }\n  let display_info = DisplayInfo::from_point(100, 100).unwrap();\n  println!(\"display_info {display_info:?}\");\n  println!(\"运行耗时: {:?}\", start.elapsed());\n}\n```\n\n## DisplayInfo struct\n\n- `id` u32 - Unique identifier associated with the display.\n- `name` String - The name of the display\n- `friendly_name` String - The display friendly name,\n- `raw_handle` CGDisplay/HMONITOR/Output - Native display raw handle\n- `x` i32 - The display x coordinate.\n- `y` i32 - The display y coordinate.\n- `width` u32 - The display pixel width.\n- `height` u32 - The display pixel height.\n- `width_mm` i32 - The width of a display in millimeters. This value may be 0.\n- `height_mm` i32 - The height of a display in millimeters. This value may be 0.\n- `rotation` f32 - Can be 0, 90, 180, 270, represents screen rotation in clock-wise degrees.\n- `scale_factor` f32 - Output device's pixel scale factor.\n- `frequency` f32 - The display refresh rate.\n- `is_primary` bool - Whether the screen is the main screen\n- `is_builtin` bool - Whether the screen is builtin\n\n## Linux requirements\n\nOn Linux, you need to install `libxcb`、`libxrandr`\n\nDebian/Ubuntu:\n\n```sh\napt-get install libxcb1 libxrandr2\n```\n\nAlpine:\n\n```sh\napk add libxcb libxrandr\n```\n\nArchLinux:\n\n```sh\npacman -S libxcb libxrandr\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnashaofu%2Fdisplay-info","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnashaofu%2Fdisplay-info","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnashaofu%2Fdisplay-info/lists"}