{"id":20092390,"url":"https://github.com/rubixdev/kwin-typescript-template","last_synced_at":"2026-03-08T16:38:06.600Z","repository":{"id":112918167,"uuid":"429913397","full_name":"RubixDev/kwin-typescript-template","owner":"RubixDev","description":"A template kwinscript for typescript","archived":false,"fork":false,"pushed_at":"2023-02-06T18:29:42.000Z","size":17,"stargazers_count":16,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-25T23:36:23.514Z","etag":null,"topics":["kwin","kwin-script","template","typescript"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RubixDev.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":{"ko_fi":"rubixdev"}},"created_at":"2021-11-19T19:33:49.000Z","updated_at":"2025-05-19T23:40:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"d855d0a8-cd1f-4d9e-962c-727c73b4c347","html_url":"https://github.com/RubixDev/kwin-typescript-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/RubixDev/kwin-typescript-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixDev%2Fkwin-typescript-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixDev%2Fkwin-typescript-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixDev%2Fkwin-typescript-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixDev%2Fkwin-typescript-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RubixDev","download_url":"https://codeload.github.com/RubixDev/kwin-typescript-template/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RubixDev%2Fkwin-typescript-template/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266828731,"owners_count":23991220,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["kwin","kwin-script","template","typescript"],"created_at":"2024-11-13T16:37:00.398Z","updated_at":"2026-03-08T16:38:06.560Z","avatar_url":"https://github.com/RubixDev.png","language":"Shell","readme":"# KWin TypeScript Template\nA template for creating KWin scripts in typescript, because the official docs [here](https://develop.kde.org/docs/plasma/kwin/) and [here](https://develop.kde.org/docs/plasma/kwin/api/) aren't *quite* perfect.\n\nIt uses [my type declarations](https://github.com/RubixDev/kwin-types), that I created based mainly by looking through [KWin's source code](https://github.com/KDE/kwin) and the docs mentioned above.\n\n## Usage\n### Setup\n#### Step 1\nClone the repo:\n```bash\ngit clone https://github.com/RubixDev/kwin-typescript-template.git\n```\n\n#### Step 2\nEdit the following things in the `package.json`\n- `name`\n- `displayName`\n- `version`\n- `description`\n- `author`\n\nand if you really want, also the `license`.\n\n#### Step 3\nEdit the `metadata.desktop` file. For convenience you can run `npm run update-metadata` to copy the the information from the `package.json` automatically. However you still have to edit these properties manually:\n- `X-KDE-PluginInfo-Email`\n- `X-KDE-PluginInfo-License`\n\n#### Step 4\nRun `npm i` to install the required dependencies.\n\n#### Step 5\nWrite your script in the `contents/src/main.ts` file. You can also add more files and import them with the typical `import { stuff } from 'elsewhere'` syntax.\n\nThere are a few global properties and functions:\n- Functions (refer to the JSDoc for more information)\n  - `print()`\n  - `readConfig()`\n  - `callDBus()`\n  - `registerShortcut()`\n  - `registerScreenEdge()`\n  - `unregisterScreenEdge()`\n  - `registerTouchScreenEdge()`\n  - `unregisterTouchScreenEdge()`\n  - `registerUserActionsMenu()`\n  - `assert()`\n  - `assertTrue()`\n  - `assertFalse()`\n  - `assertNull()`\n  - `assertNotNull()`\n  - `assertEquals()`\n- `workspace`: An instance of `KWin.QtScriptWorkspaceWrapper`\n- `options`: An instance of `KWin.Options`\n- `KWin`: has the following properties, that provide access to the properties of the `KWin.WorkspaceWrapper.ClientAreaOption` and `KWin.WorkspaceWrapper.ElectricBorder` enums:\n  - `PlacementArea`\n  - `MovementArea`\n  - `MaximizeArea`\n  - `MaximizeFullArea`\n  - `FullScreenArea`\n  - `WorkArea`\n  - `FullArea`\n  - `ScreenArea`\n  - `ElectricTop`\n  - `ElectricTopRight`\n  - `ElectricRight`\n  - `ElectricBottomRight`\n  - `ElectricBottom`\n  - `ElectricBottomLeft`\n  - `ElectricLeft`\n  - `ElectricTopLeft`\n  - `ELECTRIC_COUNT`\n  - `ElectricNone`\n- `QTimer`: A class, for calling a function repeatedly with an interval, or just once with a delay.\n\nKeep in mind async/await won't work. It seems like any call to `setTimeout()` or similar functions results in an internal error and cancels further execution of that scope.\n\n### NPM Scripts\n#### lint\nChecks the source files for errors using `tsc`\n\n#### compile\nCompiles the TypeScript source files to a single `main.js` without checking for errors\n\n#### package\nPackages the compiled script to a single `.kwinscript` file. Use the `.pkgignore` file to specify files and folders of the root level to exclude\n\n#### install\nInstalls the packaged script to your system\n\n#### run\nEnables the installed script and starts it. The output can be seen via `journalctl -f`\n\n#### publish\nExecutes these scripts:\n1. `lint`\n2. `compile`\n3. `package`\n\n#### start\nExecutes these scripts:\n1. `lint`\n2. `compile`\n3. `package`\n4. `install`\n5. `run`\n\n#### uninstall\nFully stops and removes the installed script from your system\n\n#### update-metadata\nCopies following information from the `package.json` to the `metadata.desktop`:\n- `displayName`\n- `description`\n- `main`\n- `author`\n- `name`\n- `version`\n","funding_links":["https://ko-fi.com/rubixdev"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubixdev%2Fkwin-typescript-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frubixdev%2Fkwin-typescript-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frubixdev%2Fkwin-typescript-template/lists"}