{"id":13998291,"url":"https://github.com/niw/WindowAlignment","last_synced_at":"2025-07-23T06:31:10.124Z","repository":{"id":179390274,"uuid":"663415304","full_name":"niw/WindowAlignment","owner":"niw","description":"A simple application to align windows on macOS.","archived":false,"fork":false,"pushed_at":"2023-11-25T00:36:51.000Z","size":947,"stargazers_count":35,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-11-18T17:51:12.015Z","etag":null,"topics":["macos","swiftui"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/niw.png","metadata":{"files":{"readme":"README.md","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,"governance":null}},"created_at":"2023-07-07T08:36:22.000Z","updated_at":"2024-11-02T04:46:15.000Z","dependencies_parsed_at":"2023-11-25T01:29:48.766Z","dependency_job_id":"aaee2eae-6432-4179-b772-d5dc7f9b48fc","html_url":"https://github.com/niw/WindowAlignment","commit_stats":null,"previous_names":["niw/windowalignment"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niw%2FWindowAlignment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niw%2FWindowAlignment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niw%2FWindowAlignment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/niw%2FWindowAlignment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/niw","download_url":"https://codeload.github.com/niw/WindowAlignment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227245144,"owners_count":17753239,"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":["macos","swiftui"],"created_at":"2024-08-09T19:01:32.958Z","updated_at":"2024-11-30T00:31:22.957Z","avatar_url":"https://github.com/niw.png","language":"Swift","readme":"WindowAlignment\n===============\n\n\u003cimg src=\"Applications/WindowAlignment/Resources/Assets.xcassets/AppIcon.appiconset/512x512.png\" width=256 height=256\u003e\n\nA simple macOS application to align the active window by the keyboard\nshortcut in the screen.\n\nUsage\n-----\n\nDownload the latest pre-build application binary from [Releases](https://github.com/niw/WindowAlignment/releases)\npage or build it from the source code by following instruction.\n\nNote that the pre-build application binary is only ad-hoc signed.\nTherefore, you need to click Open Anyway to execute it on\nSecurity \u0026 Privacy settings in System Settings.\n\nThe application is also need your approval to Accessibility access.\nFollow the instruction appears on the dialog.\n\n\nConfiguration\n-------------\n\nCurrently the application has no settings user interface.\nInstead, it reads a configuration JSON file at `~/.window_alignment.json`\n(If there is no such file, the app creates it with example configurations.)\nThe configuration file contains list of hot key (keyboard shortcut) and\nalignment script.\n\nTo configure the behavior, manually change the configuration JSON\nfile and select Reload Configuration in the application menu.\n\nThis is an example configuration contains one alignment action that can\nbe triggered by `Shift` + `Command` + `Up` which align the active window\nto the middle of screen.\n\n```jsonc\n{\n  \"actions\" : [\n    // Each action have \"hot_key\" and \"move\" and/or \"resize\" alignment scripts.\n    {\n      \"hot_key\" : {\n        // Use macOS virtual key code used for Carbon API.\n        \"key_code\" : 126,\n        // Combination of \"shift\", \"control\", \"option\", or \"command\"\n        \"modifiers\" : [\n          \"shift\",\n          \"command\"\n        ]\n      },\n      // Alignment script to set window position. Optional.\n      \"move\" : {\n        \"x\" : \"screen.x + screen.width * 0.125\",\n        \"y\" : \"screen.y\"\n      },\n      // Alignment script to set window size. Optional.\n      \"resize\" : {\n        \"width\" : \"screen.width - (screen.width * 0.125) * 2\",\n        \"height\" : \"screen.height\"\n      }\n    }\n  ]\n}\n```\n\n### Alignment Script\n\nThe alignment script is a simple regular math syntax with following\nvariables.\n\n|Name|Description|\n|----|-----------|\n|`screen.x`|Horizontal screen position.|\n|`screen.y`|Vertical screen position.  |\n|`screen.width` |Screen width.|\n|`screen.height`|Screen height.|\n|`window.x`|Horizontal window position.|\n|`window.y`|Vertical window position.  |\n|`window.width` |Window width.|\n|`window.height`|Window height.|\n\n\nBuild\n-----\n\nYou need to use the latest macOS and Xcode to build the app.\nOpen `Applications/WindowAlignment.xcodeproj` and build `WindowAlignment`\nscheme for running.\n\nIf you have used another binary, next time when you launch the new binary,\nit will shows an dialog to approve Accessibility access again.\nHowever, often it doesn't work as expected for the new binary.\nTherefore, use following command before launching the new binary to reset\nAccessibility access.\n\n```bash\ntccutil reset Accessibility at.niw.WindowAlignment\n```\n","funding_links":[],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniw%2FWindowAlignment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniw%2FWindowAlignment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniw%2FWindowAlignment/lists"}