{"id":16227741,"url":"https://github.com/akryum/window-button-layout","last_synced_at":"2025-03-19T13:31:11.271Z","repository":{"id":66017422,"uuid":"221422930","full_name":"Akryum/window-button-layout","owner":"Akryum","description":"Retrieve OS window buttons layout (close, maximize, minimize...)","archived":false,"fork":false,"pushed_at":"2020-05-25T23:29:55.000Z","size":7,"stargazers_count":21,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T07:21:57.256Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/Akryum.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":["Akryum"]}},"created_at":"2019-11-13T09:36:10.000Z","updated_at":"2021-12-07T07:06:24.000Z","dependencies_parsed_at":"2023-03-10T23:28:38.817Z","dependency_job_id":null,"html_url":"https://github.com/Akryum/window-button-layout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Akryum%2Fwindow-button-layout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Akryum%2Fwindow-button-layout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Akryum%2Fwindow-button-layout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Akryum%2Fwindow-button-layout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Akryum","download_url":"https://codeload.github.com/Akryum/window-button-layout/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244434787,"owners_count":20452254,"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-10T12:53:43.766Z","updated_at":"2025-03-19T13:31:11.265Z","avatar_url":"https://github.com/Akryum.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Akryum"],"categories":[],"sub_categories":[],"readme":"# window-button-layout\nRetrieve OS window buttons layout (close, maximize, minimize...) depending on platform and user preferences. Useful to create a custom window title in Electron that matches the rest of the OS for a more coherent UX.\n\nCurrently supported:\n\n- Windows\n- MacOS\n- KDE\n- Gnome\n- Pantheon (elementaryOS)\n\n## Installation\n\n```bash\nyarn add window-button-layout\n```\n\n## Usage\n\n**Must be used in a Node context!** In an electron app, you can use IPC to send the result to your frontend code.\n\nThe `getWindowButtonLayout` function will return a `WindowButtonLayout` object:\n\n```js\nconst { getWindowButtonLayout } = require('window-button-layout')\n\nconsole.log(getWindowButtonLayout())\n/*\n{\n  start: ['menu'],\n  end: ['minimize', 'maximize', 'close']\n}\n*/\n```\n\nDepending on the OS and user preferences, you will get different arrays for `start` (left-side) and `end` (right-side). All buttons are not necessarily used; for example, on Pantheon (elementaryOS) there are no `menu` and `minimize` window buttons.\n\nInterfaces:\n\n```ts\nenum WindowButton {\n  CLOSE = 'close',\n  MAXIMIZE = 'maximize',\n  MINIMIZE = 'minimize',\n  SPACER = 'spacer',\n  MENU = 'menu',\n}\n\ninterface WindowButtonLayout {\n  start: WindowButton[]\n  end: WindowButton[]\n}\n```\n\nUnkown buttons (that are not in the `WindowButton` enum) will be ignored.\n\n## Sponsors\n\n[![sponsors logos](https://guillaume-chau.info/sponsors.png)](https://guillaume-chau.info/sponsors)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakryum%2Fwindow-button-layout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fakryum%2Fwindow-button-layout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fakryum%2Fwindow-button-layout/lists"}