{"id":24130213,"url":"https://github.com/glzr-io/glazewm-js","last_synced_at":"2025-09-18T22:33:57.408Z","repository":{"id":187066409,"uuid":"601747754","full_name":"glzr-io/glazewm-js","owner":"glzr-io","description":"JS library for inter-process communication (IPC) with GlazeWM.","archived":false,"fork":false,"pushed_at":"2024-11-30T19:35:03.000Z","size":151,"stargazers_count":24,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-10T15:10:10.247Z","etag":null,"topics":["glazewm","ipc","typescript","window-manager","windows"],"latest_commit_sha":null,"homepage":"","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/glzr-io.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2023-02-14T18:25:52.000Z","updated_at":"2025-01-05T00:51:38.000Z","dependencies_parsed_at":"2024-09-12T06:37:59.022Z","dependency_job_id":"36b79e21-674d-401b-8361-04c99c34a6c2","html_url":"https://github.com/glzr-io/glazewm-js","commit_stats":{"total_commits":94,"total_committers":3,"mean_commits":"31.333333333333332","dds":"0.021276595744680882","last_synced_commit":"c1256089c7e731ec406fd186a77dad22dba09c60"},"previous_names":["lars-berger/glazewm-js","glazerdesktop/glazewm-js","glzr-io/glazewm-js"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glzr-io%2Fglazewm-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glzr-io%2Fglazewm-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glzr-io%2Fglazewm-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/glzr-io%2Fglazewm-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/glzr-io","download_url":"https://codeload.github.com/glzr-io/glazewm-js/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233532204,"owners_count":18690164,"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":["glazewm","ipc","typescript","window-manager","windows"],"created_at":"2025-01-11T20:19:53.807Z","updated_at":"2025-09-18T22:33:52.052Z","avatar_url":"https://github.com/glzr-io.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GlazeWM-js \u0026middot; [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/glzr-io/GlazeWM-js/pulls) [![License](https://img.shields.io/github/license/glzr-io/glazewm-js)](https://github.com/glzr-io/glazewm-js/blob/main/LICENSE.md) [![Discord invite](https://img.shields.io/discord/1041662798196908052.svg?logo=discord\u0026colorB=7289DA)](https://discord.gg/ud6z3qjRvM)\n\nJS library for inter-process communication (IPC) with [GlazeWM](https://github.com/glzr-io/GlazeWM). Programmatically query GlazeWM's state, subscribe to events, and run WM commands with a simple and type-safe API.\n\nThe library is packaged for CommonJS and ESM. Can be used from both NodeJS and the browser (e.g. in an Electron or Tauri application).\n\n## Installation\n\n[ws](https://github.com/websockets/ws) needs to be additionally installed on NodeJS. The built-in [Websocket](https://developer.mozilla.org/en-US/docs/Web/API/WebSocket) API is used on browsers.\n\nUsing npm:\n\n```shell\nnpm i ws\nnpm i glazewm\n```\n\nUsing yarn:\n\n```shell\nyarn add ws\nyarn add glazewm\n```\n\n## Example usage\n\n```typescript\nimport { WmClient } from 'glazewm';\n\nconst client = new WmClient();\n\n// Listen for connection events to the IPC server.\nclient.onConnect(() =\u003e console.log('Connected!'));\nclient.onDisconnect(() =\u003e console.log('Disconnected!'));\nclient.onError(() =\u003e console.log('Connection error!'));\n\n// Get monitors, workspaces, windows, and the currently focused container.\nconst { monitors } = await client.queryMonitors();\nconst { workspaces } = await client.queryWorkspaces();\nconst { windows } = await client.queryWindows();\nconst { focused } = await client.queryFocused();\n\n// Run a WM command.\nawait client.runCommand('focus --workspace 1');\n\n// Run a WM command with a given subject container. This way we can target\n// the container to operate on. If no subject container is specified, it\n// defaults to the currently focused container.\nawait client.runCommand('move --direction left', windows[0].id);\n\n// Listen to a WM event (e.g. whenever the focused container changes).\nawait client.subscribe(\n  WmEventType.FOCUS_CHANGED,\n  (event: FocusChangedEvent) =\u003e console.log(event),\n);\n\n// Listen to multiple WM events.\nawait client.subscribeMany(\n  [WmEventType.WORKSPACE_ACTIVATED, WmEventType.WORKSPACE_DEACTIVATED],\n  (event: WorkspaceActivatedEvent | WorkspaceDeactivatedEvent) =\u003e\n    console.log(event),\n);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglzr-io%2Fglazewm-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fglzr-io%2Fglazewm-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fglzr-io%2Fglazewm-js/lists"}