@hnode/tidy 0.19.4 → 0.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -5
- package/bin/tidy.js +6 -3
- package/desktop/core.js +112 -0
- package/desktop/index.html +11 -0
- package/desktop/main.js +328 -0
- package/desktop/manage.js +175 -0
- package/desktop/native/macos.swift +110 -0
- package/desktop/native-bridge.js +67 -0
- package/desktop/package-lock.json +161 -0
- package/desktop/package.json +10 -0
- package/desktop/preload.cjs +11 -0
- package/desktop/renderer.js +115 -0
- package/desktop/style.css +25 -0
- package/dist/winubun@winubun.local.shell-extension.zip +0 -0
- package/docs/DEVELOPMENT.md +6 -2
- package/docs/MACOS.md +69 -0
- package/docs/README.en.md +18 -5
- package/docs/RELEASING.md +43 -6
- package/lib/layouts.js +132 -0
- package/lib/translations.json +4 -2
- package/package.json +18 -8
- package/scripts/manage.py +2 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
:root {color-scheme: dark; font: 14px system-ui, sans-serif; color: #eee; background: #252529;}
|
|
2
|
+
* {box-sizing: border-box;}
|
|
3
|
+
body {margin: 0;}
|
|
4
|
+
button, input {font: inherit;}
|
|
5
|
+
button {cursor: pointer; background: #414147; border: 1px solid #626269; border-radius: 7px; color: #fff; padding: 7px 12px;}
|
|
6
|
+
button:hover, button:focus-visible {background: #595962; outline: 2px solid #bbb;}
|
|
7
|
+
h1 {font-size: 24px; margin: 0 0 6px;}
|
|
8
|
+
p {line-height: 1.5; color: #bdbdc5;}
|
|
9
|
+
.settings {padding: 24px;}
|
|
10
|
+
.setting {display: flex; align-items: center; justify-content: space-between; padding: 12px 0; gap: 12px; border-bottom: 1px solid #3d3d43;}
|
|
11
|
+
input[type=number] {width: 78px;}
|
|
12
|
+
input[type=text], input[type=number] {background: #1a1a1e; color: #eee; border: 1px solid #5a5a63; border-radius: 5px; padding: 6px;}
|
|
13
|
+
.shortcut {width: 220px;}
|
|
14
|
+
.message {white-space: pre-wrap; color: #f0c284;}
|
|
15
|
+
.buttons {display: flex; gap: 10px; margin-top: 20px;}
|
|
16
|
+
.picker {padding: 12px;}
|
|
17
|
+
.hint {font-size: 12px; color: #bcbcc5; margin-bottom: 8px;}
|
|
18
|
+
.layouts {display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px;}
|
|
19
|
+
.layout-label {font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-bottom: 5px;}
|
|
20
|
+
.diagram {height: 67px; position: relative;}
|
|
21
|
+
.zone {position: absolute; padding: 2px; background: transparent; border: 0; border-radius: 4px;}
|
|
22
|
+
.zone::after {content: ''; position: absolute; inset: 2px; border-radius: 4px; border: 1px solid #85858d; background: #55555e;}
|
|
23
|
+
.zone:hover::after, .zone.selected::after, .zone:focus-visible::after {background: #b3b3be; border-color: #eee;}
|
|
24
|
+
.preview {background: transparent;}
|
|
25
|
+
.preview #app {position: fixed; inset: 3px; border: 2px solid #d0d0dc; border-radius: 12px; background: #77778555; box-shadow: inset 0 0 15px #aaa2;}
|
|
Binary file
|
package/docs/DEVELOPMENT.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[한국어 안내](../README.md) · [English guide](README.en.md)
|
|
4
4
|
|
|
5
|
-
Tidy는 GNOME Shell 확장과
|
|
5
|
+
Tidy는 GNOME Shell 확장과 Python 관리 도구, macOS용 Electron 앱과 Swift 창 제어 도구로 구성됩니다. GNOME판은 npm 없이 설치할 수 있습니다. 데스크톱 앱 구조와 기능 범위는 [macOS](MACOS.md)를 참고하세요.
|
|
6
6
|
|
|
7
7
|
## Build and checks
|
|
8
8
|
|
|
@@ -18,7 +18,11 @@ npm run test:package
|
|
|
18
18
|
|
|
19
19
|
빌드 결과는 `dist/winubun@winubun.local.shell-extension.zip`입니다. 런타임 소스, 컴파일한 스키마, 설치·복구 도구와 GPL 라이선스 파일을 포함합니다.
|
|
20
20
|
|
|
21
|
-
npm 배포 이름은 `@hnode/tidy`이고 실행 파일은 `bin/tidy.js`입니다. `npm pack`은 `prepack`에서 확장 ZIP을 빌드합니다. 사용자 설치 시에는 이 ZIP을 사용하므로 npm 패키지 경로가 읽기 전용이어도 됩니다. 게시 절차와 tarball 검증은 [Releasing](RELEASING.md)을 참고하세요.
|
|
21
|
+
npm 배포 이름은 `@hnode/tidy`이고 실행 파일은 `bin/tidy.js`입니다. `npm pack`은 `prepack`에서 Node.js로 확장 ZIP을 빌드합니다. 이 빌드는 macOS에서도 Python 없이 동작합니다. GLib 컴파일러가 없는 환경에서는 XML 스키마를 포함하고 GNOME 설치 시 컴파일합니다. 사용자 설치 시에는 이 ZIP을 사용하므로 npm 패키지 경로가 읽기 전용이어도 됩니다. 게시 절차와 tarball 검증은 [Releasing](RELEASING.md)을 참고하세요.
|
|
22
|
+
|
|
23
|
+
`npm test`, `npm run check`, `npm run build`는 Ubuntu와 macOS에서 실행할 수 있습니다. `desktop/core.js`는 GNOME과 같은 배치 및 모니터 계산을 사용하며, `native-bridge.js`는 Swift 실행부와 같은 논리 좌표를 전달합니다. Mac에서 `node scripts/native-smoke.js`로 Swift를 컴파일한 뒤 읽기 전용 프로토콜과 오류 전달을 확인합니다. 손쉬운 사용 권한을 요청하거나 실제 창을 이동하지 않습니다. `.github/workflows/ci.yml`에 OS별 검사를 구성했습니다. 실제 창 제스처·권한·로그인 자동 실행은 각 OS에서 수동 검증해야 합니다.
|
|
24
|
+
|
|
25
|
+
데스크톱 UI는 `npm ci --prefix desktop --ignore-scripts` 후 `npm run test:desktop-ui`로 검사합니다. 첫 실행에 Electron을 다운로드하며, 별도 임시 프로필에서 실제 Chromium으로 선택기 영역·클릭·Esc·한국어 설정·저장·잘못된 단축키 오류를 확인합니다. 자동 실행과 전역 단축키를 등록하거나 창을 이동하지 않습니다. 현재 Ubuntu 환경의 샌드박스 설치 제한으로 UI 검사에만 `npm run test:desktop-ui -- --no-sandbox`를 사용했습니다. 제품 창의 `sandbox: true`는 유지합니다.
|
|
22
26
|
|
|
23
27
|
```bash
|
|
24
28
|
GSETTINGS_BACKEND=memory GSETTINGS_SCHEMA_DIR="$PWD/schemas" gjs -m tests/lease-smoke.js
|
package/docs/MACOS.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# macOS
|
|
2
|
+
|
|
3
|
+
[한국어 안내](../README.md) · [English guide](README.en.md)
|
|
4
|
+
|
|
5
|
+
macOS에서는 Tidy가 Electron 데스크톱 앱으로 실행됩니다. GNOME판과 같은 `lib/layouts.js`의 배치와 모니터 탐색 규칙을 사용하며, Swift의 Accessibility API로 창을 이동하고 크기를 조절합니다.
|
|
6
|
+
|
|
7
|
+
## Requirements
|
|
8
|
+
|
|
9
|
+
macOS 13 이상에서 Intel과 Apple Silicon을 대상으로 합니다. 설치에는 Node.js 22.12 이상과 npm, Xcode Command Line Tools의 Swift 컴파일러가 필요합니다. 컴파일러가 없다면 `xcode-select --install`을 실행하고 설치를 완료하세요. `tidy doctor`로 설치 도구를 확인할 수 있습니다.
|
|
10
|
+
|
|
11
|
+
최초 설치는 Electron 런타임을 다운로드하므로 인터넷 연결이 필요합니다. 설치된 앱은 별도의 시스템 Python이나 Node.js 프로세스 없이 실행됩니다.
|
|
12
|
+
|
|
13
|
+
## Install and run
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
npm install -g @hnode/tidy
|
|
17
|
+
tidy doctor
|
|
18
|
+
tidy install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
0.20.0 배포본을 버전 고정으로 테스트하는 절차는 [배포본 Mac 테스트](RELEASING.md#test-the-published-package-on-mac)에 있습니다. 전역 설치 없이 `npx --yes @hnode/tidy@0.20.0 install`로도 설치할 수 있습니다.
|
|
22
|
+
|
|
23
|
+
소스의 변경 사항을 사용하려면 저장소에서 실행하세요.
|
|
24
|
+
|
|
25
|
+
```sh
|
|
26
|
+
node bin/tidy.js doctor
|
|
27
|
+
node bin/tidy.js install
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
설치 후 앱과 설정이 바로 열립니다. **시스템 설정 → 개인정보 보호 및 보안 → 손쉬운 사용**에서 Tidy를 허용한 후 앱을 다시 실행하세요. 권한을 주기 전에는 설정과 진단을 사용할 수 있으며 창 배치는 사용할 수 없습니다. 업데이트 후 권한을 다시 요청할 수 있습니다.
|
|
31
|
+
|
|
32
|
+
메뉴 막대 아이콘의 **배치 선택기 열기**나 단축키로 현재 창을 배치하세요. 창을 화면 상단 중앙으로 끌어도 선택기를 열 수 있습니다. 원하는 칸에 포인터를 두고 놓으면 배치하고, 빈 곳에 놓으면 취소합니다. 단축키로 열었을 때는 칸을 클릭하거나 Tab으로 이동해 Enter를 누르세요. Esc로 닫습니다.
|
|
33
|
+
|
|
34
|
+
로그인 시 자동 실행은 기본으로 켜져 있으며 설정에서 끌 수 있습니다. 앱과 런타임을 사용자 폴더에 복사하므로 원본 소스와 npm 캐시를 지워도 실행됩니다.
|
|
35
|
+
|
|
36
|
+
## Shortcuts and settings
|
|
37
|
+
|
|
38
|
+
기본 조합은 **Control+Option**입니다. 방향키, Enter, U/I/J/K, D/F/G, E/T, C, Space, N의 배치 동작은 GNOME판과 같습니다. 같은 방향키를 반복하면 해당 방향 모니터로 이동하고 양 끝에서 순환합니다. `Control+Option+Space`로 선택기를 엽니다. `Control+Option+Enter`는 사용 가능 영역을 채우거나 이전 크기로 되돌립니다. 별도 Space로 전환하는 전체 화면 모드는 사용하지 않습니다.
|
|
39
|
+
|
|
40
|
+
`tidy prefs` 또는 메뉴 막대 아이콘으로 설정을 엽니다. 창 간격, 상단 드래그 선택기, 가장자리 배치, 자동 실행, 각 단축키를 바꿀 수 있습니다. 단축키는 `Control+Alt+Left` 같은 형식으로 입력하며 비워 두면 해당 동작을 끕니다. 등록할 수 없는 단축키는 설정에 표시하고, 저장 실패 시 기존 지정을 유지합니다.
|
|
41
|
+
|
|
42
|
+
macOS 기본 타일링과 시스템 단축키 설정은 변경하지 않습니다. Command 키나 Mission Control 연동, 기본 타일링의 자동 비활성화·복원은 구현하지 않았습니다. 기본 타일링이 켜진 환경에서는 가장자리 드래그 동작이 겹칠 수 있습니다.
|
|
43
|
+
|
|
44
|
+
## Update and uninstall
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
tidy status
|
|
48
|
+
npm install -g @hnode/tidy@latest
|
|
49
|
+
tidy update
|
|
50
|
+
tidy uninstall
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
업데이트는 새 런타임을 준비한 다음 실행 중인 앱을 종료하고 교체합니다. 다운로드·컴파일·시작에 실패하면 기존 설치를 보존하거나 복원합니다. 제거하면 자동 실행 등록과 앱을 삭제하고 사용자 설정을 보관합니다. npm 패키지만 제거하면 데스크톱 앱은 계속 남습니다.
|
|
54
|
+
|
|
55
|
+
## Feature scope and validation
|
|
56
|
+
|
|
57
|
+
6가지 배치 선택기, 상단 드래그·가장자리 배치, 사용자 지정 단축키, 다중 모니터 이동·순환, 최대화·복귀, 창 간격, 한국어·영어 설정, 로그인 자동 실행을 제공합니다. Dock과 메뉴 막대를 제외한 작업 영역을 사용합니다.
|
|
58
|
+
|
|
59
|
+
GNOME의 Super 창 보기 연동, 최대화 버튼 호버, 축소 드래그 애니메이션, 함께 크기 조절, 남은 공간의 앱 선택은 GNOME판 기능입니다. macOS판에는 별도 창 목록이 없습니다. 창 이동·크기 변경을 막는 앱과 전체 화면 창은 배치 대상에서 제외하며, 앱의 최소 크기 때문에 요청한 배치보다 커질 수 있습니다.
|
|
60
|
+
|
|
61
|
+
Ubuntu 개발 환경에서 공통 계산, macOS 명령 분기, 네이티브 통신 대역, 설치·복구 및 npm 패키지를 검증했습니다. 실제 Chromium에서 선택기와 한국어 설정 UI도 검사했습니다. **실제 Mac에서의 창 조작은 실기 검증 전입니다.** CI는 Ubuntu와 macOS의 Node 테스트·패키지 빌드, macOS Swift 컴파일·읽기 전용 네이티브 프로토콜·UI 검사를 수행하도록 구성되어 있습니다.
|
|
62
|
+
|
|
63
|
+
## Files and diagnostics
|
|
64
|
+
|
|
65
|
+
앱은 `~/Library/Application Support/Tidy/desktop/Tidy.app`, 설정은 `~/Library/Application Support/Tidy/config/settings.json`에 저장합니다. 같은 Tidy 폴더의 `status.json`에 프로세스, 권한, 충돌 단축키와 최근 오류를 기록합니다. `tidy status`로 확인하고, 앱을 종료했다면 `tidy prefs`로 다시 실행하세요.
|
|
66
|
+
|
|
67
|
+
Mac에서 `node scripts/native-smoke.js`로 Swift 컴파일과 읽기 전용 프로토콜 검사를 실행합니다. 이 검사는 권한을 요청하거나 창을 이동하지 않습니다.
|
|
68
|
+
|
|
69
|
+
API 근거: [Electron 전역 단축키](https://www.electronjs.org/docs/latest/api/global-shortcut), [지원 OS 변경](https://www.electronjs.org/docs/latest/breaking-changes), [macOS AX 위치 좌표](https://developer.apple.com/documentation/applicationservices/kaxpositionattribute).
|
package/docs/README.en.md
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
[한국어](../README.md) · [English](README.en.md)
|
|
4
4
|
|
|
5
|
-
Window tiling for GNOME
|
|
5
|
+
Window tiling for GNOME and macOS
|
|
6
6
|
|
|
7
7
|
Drag a window to the top of a monitor, choose a layout, and move between monitors with keyboard shortcuts.
|
|
8
|
-
Tidy
|
|
8
|
+
Tidy arranges windows with a GNOME extension or a macOS desktop app.
|
|
9
9
|
|
|
10
10
|

|
|
11
11
|

|
|
@@ -17,7 +17,7 @@ Tidy adds flexible window arrangement to Ubuntu GNOME.
|
|
|
17
17
|
|
|
18
18
|
## Overview
|
|
19
19
|
|
|
20
|
-
Tidy
|
|
20
|
+
Tidy runs as a GNOME Shell extension on Ubuntu and as a separate desktop app on macOS. Its layout picker opens inside the top-center area of each monitor, making it easier to use across multiple displays.
|
|
21
21
|
|
|
22
22
|
<img src="preview.png" alt="Tidy's top layout picker with grayscale layout diagrams" width="760">
|
|
23
23
|
|
|
@@ -25,6 +25,8 @@ The interface follows your desktop language. Korean and English are supported; o
|
|
|
25
25
|
|
|
26
26
|
## Features
|
|
27
27
|
|
|
28
|
+
The table below describes the GNOME edition. macOS provides the six-layout picker, top dragging and edge snapping, custom shortcuts, multiple monitors, maximize/restore and window gaps. GNOME overview integration, maximize-button hover, miniature animations, linked resizing and snap assist remain GNOME features.
|
|
29
|
+
|
|
28
30
|
| Feature | Behavior |
|
|
29
31
|
| --- | --- |
|
|
30
32
|
| Top layout picker | Drop a window into one of six layouts arranged in a single row. |
|
|
@@ -48,12 +50,21 @@ The maximize button picker waits about 350 milliseconds before opening. Click a
|
|
|
48
50
|
| Ubuntu 26.04 · GNOME 50.1 · Wayland | Tested with real Wayland windows and two virtual monitors in an isolated GNOME session |
|
|
49
51
|
| GNOME 46–49 | Declared compatible; not yet tested on those versions |
|
|
50
52
|
| X11 | Not yet tested |
|
|
51
|
-
|
|
|
53
|
+
| macOS 13+ · Intel/Apple Silicon | Desktop app using Accessibility added; real desktop testing pending |
|
|
54
|
+
| KDE · Xfce | Outside the supported platform |
|
|
52
55
|
|
|
53
|
-
|
|
56
|
+
GNOME runtime requirements: system Python 3 with PyGObject, GJS, and GTK 4/libadwaita. GNOME npm commands require Node.js 18 or later. Building compiled schemas requires `glib-compile-schemas`. The installed GNOME extension does not run a Node.js or npm process. macOS installation requires Node.js 22.12+, npm, the Swift compiler from Xcode Command Line Tools and Accessibility permission.
|
|
54
57
|
|
|
55
58
|
## Install
|
|
56
59
|
|
|
60
|
+
On macOS, use the same `tidy install` command, or `node bin/tidy.js install` from this repository. The desktop app downloads its Electron runtime, starts immediately and registers to run at login. Install Command Line Tools with `xcode-select --install` if needed, then allow Tidy under **System Settings → Privacy & Security → Accessibility** and restart it. Source files and npm caches can be deleted after installation. The logout/login and Python instructions below apply to GNOME.
|
|
61
|
+
|
|
62
|
+
macOS defaults to **Control+Option**, with the placement keys listed below. Open settings using `tidy prefs` or the menu bar icon. Settings include gaps, top dragging, edge snapping, login startup and editable shortcuts. `tidy update`, `tidy status` and `tidy uninstall` work on both supported platforms. Uninstalling removes the desktop app and login item while preserving settings. Native macOS tiling, system shortcuts and Mission Control are unchanged. The GNOME-specific settings below apply only to GNOME.
|
|
63
|
+
|
|
64
|
+
The shared logic, native protocol doubles, installation rollback and npm payload are tested on Ubuntu. Actual Mac window operations are not yet verified. CI is configured for Node tests and package builds on Ubuntu and macOS, plus Swift compilation and read-only protocol/UI probes on macOS. Full-screen and non-resizable windows are excluded. Minimum app sizes can limit exact placement.
|
|
65
|
+
|
|
66
|
+
Desktop data lives in `~/Library/Application Support/Tidy`. Settings are in `config/settings.json`; `status.json` contains permissions, shortcut conflicts and the latest error. See [macOS implementation notes (Korean)](MACOS.md) for more details.
|
|
67
|
+
|
|
57
68
|
### npm
|
|
58
69
|
|
|
59
70
|
The package is **`@hnode/tidy`** and the command is **`tidy`**. Once published to npm, install the package and register the GNOME extension:
|
|
@@ -91,6 +102,8 @@ All runtime tools are copied into the installation. **You can delete the downloa
|
|
|
91
102
|
|
|
92
103
|
## Quick Start
|
|
93
104
|
|
|
105
|
+
Super and overview integration below are GNOME features. On macOS, use the menu bar picker, the picker shortcut, or drag a window to the top center. Click a cell when opening the picker from a shortcut; use Tab/Enter or Esc for keyboard navigation.
|
|
106
|
+
|
|
94
107
|
1. Grab a window by its title bar. A thin hint appears at the top of the monitor.
|
|
95
108
|
2. Drag into that area to reveal the layouts and shrink the window into a small preview. Move the pointer onto the desired layout cell.
|
|
96
109
|
3. Release to tile the window. Release over empty space to cancel.
|
package/docs/RELEASING.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# npm release
|
|
2
2
|
|
|
3
|
-
Tidy는 **@hnode/tidy**라는 공개 npm 패키지로 배포합니다. `tidy` CLI
|
|
3
|
+
Tidy는 **@hnode/tidy**라는 공개 npm 패키지로 배포합니다. `tidy` CLI, GNOME 확장 ZIP과 macOS 데스크톱 앱 소스를 포함합니다. 루트 패키지에는 런타임 npm 의존성이 없고, macOS의 명시적 `tidy install` 시 별도 사용자 폴더에 고정 버전의 Electron을 설치합니다. 확장 ZIP과 데스크톱 설치에는 GPL 소스와 라이선스 파일을 포함합니다.
|
|
4
|
+
|
|
5
|
+
현재 배포 준비 버전은 **0.20.0**입니다. macOS 설치·업데이트·제거, 메뉴 막대 선택기, Control+Option 단축키와 Swift Accessibility 창 제어를 포함합니다. GNOME 확장 내부 버전은 **22**를 유지합니다. Mac의 실제 창 조작은 배포본을 받은 뒤 검증하며, 자동 검사 통과와 구분합니다.
|
|
4
6
|
|
|
5
7
|
## Prepare
|
|
6
8
|
|
|
@@ -13,10 +15,11 @@ npm run check
|
|
|
13
15
|
npm run test:package
|
|
14
16
|
npm pack --dry-run
|
|
15
17
|
npm pack --pack-destination dist
|
|
16
|
-
node tests/npm-package-smoke.js dist/hnode-tidy-0.
|
|
18
|
+
node tests/npm-package-smoke.js dist/hnode-tidy-0.20.0.tgz
|
|
19
|
+
sha256sum dist/hnode-tidy-0.20.0.tgz
|
|
17
20
|
```
|
|
18
21
|
|
|
19
|
-
`prepack`이 최신
|
|
22
|
+
`prepack`이 Node.js로 최신 소스의 확장 ZIP을 다시 빌드합니다. GNOME 배포용 tarball은 `glib-compile-schemas`가 있는 Linux에서 빌드해 컴파일한 스키마까지 검증하세요. macOS에서는 GLib 없이 소스 스키마를 포함한 ZIP을 만들 수 있습니다. 공개 파일은 `package.json`의 `files` 목록으로 제한합니다. `desktop/native/macos.swift`, UI와 공통 `lib/layouts.js`가 포함되는지 확인하세요. 로그, 테스트, `.npmrc`, 캐시, `node_modules`는 포함하지 않습니다. npm 패키지 설치 자체는 데스크톱 설정을 바꾸지 않으며 `postinstall`은 사용하지 않습니다.
|
|
20
23
|
|
|
21
24
|
패키지 테스트는 임시 npm 전역 경로와 XDG 디렉터리를 사용합니다. 실제 tarball에서 명령을 설치한 뒤 읽기 전용 패키지, 한국어·영어 도움말, 의존성 진단과 설치된 복구 도구 호출을 확인합니다. 데스크톱 작업은 격리된 대역으로 호출을 검사합니다. Python 테스트는 실제 ZIP 설치·설정 복구를 수행하고 Shell 통신만 대체합니다.
|
|
22
25
|
|
|
@@ -34,12 +37,46 @@ TIDY_TEST_UBUNTU_DOCK=1 /usr/bin/python3 scripts/test-shell.py
|
|
|
34
37
|
```bash
|
|
35
38
|
npm login --registry=https://registry.npmjs.org/
|
|
36
39
|
npm whoami --registry=https://registry.npmjs.org/
|
|
37
|
-
npm publish ./dist/hnode-tidy-0.
|
|
38
|
-
npm view @hnode/tidy version dist
|
|
40
|
+
npm publish ./dist/hnode-tidy-0.20.0.tgz --access public --tag latest
|
|
41
|
+
npm view @hnode/tidy@0.20.0 version os dist.integrity --json
|
|
42
|
+
npm view @hnode/tidy dist-tags --json
|
|
39
43
|
```
|
|
40
44
|
|
|
41
45
|
npm이 요청하는 브라우저 로그인·2FA를 완료하세요. 같은 버전이 이미 게시되었으면 `package.json`의 버전을 올리고 다시 검증합니다. GNOME 런타임 JavaScript가 바뀌면 `metadata.json`의 확장 버전도 올립니다. npm CLI·Python 설치 도구·문서만 바뀌면 Shell 버전을 유지할 수 있습니다.
|
|
42
46
|
|
|
47
|
+
## Test the published package on Mac
|
|
48
|
+
|
|
49
|
+
Node.js 22.12 이상과 Xcode Command Line Tools가 필요합니다. 컴파일러가 없다면 `xcode-select --install`로 설치를 완료한 다음 진행하세요. 게시한 버전을 명시해 이전 `latest`나 전역 설치본과 혼동하지 않도록 합니다.
|
|
50
|
+
|
|
51
|
+
```sh
|
|
52
|
+
npx --yes @hnode/tidy@0.20.0 --version
|
|
53
|
+
npx --yes @hnode/tidy@0.20.0 doctor
|
|
54
|
+
npx --yes @hnode/tidy@0.20.0 install
|
|
55
|
+
npx --yes @hnode/tidy@0.20.0 status
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
첫 명령은 `0.20.0`을 출력해야 합니다. **시스템 설정 → 개인정보 보호 및 보안 → 손쉬운 사용**에서 Tidy를 허용하세요. 메뉴 막대에서 Tidy를 종료하고 다음 명령으로 다시 실행하면 새 권한을 적용합니다.
|
|
59
|
+
|
|
60
|
+
```sh
|
|
61
|
+
npx --yes @hnode/tidy@0.20.0 prefs
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
TextEdit나 브라우저 같은 일반 창을 선택한 뒤 확인하세요.
|
|
65
|
+
|
|
66
|
+
- **Control+Option+←/→/↑/↓**로 절반 배치, **Control+Option+Space**로 선택기 열기, **Control+Option+Enter**로 최대화·이전 크기 복원
|
|
67
|
+
- 제목 표시줄을 화면 상단 중앙으로 끌어 배치 선택·취소, 좌우 가장자리 배치
|
|
68
|
+
- 외장 모니터가 있다면 같은 방향키 반복과 **Control+Option+N**으로 이동
|
|
69
|
+
- 설정의 간격·단축키 변경과 로그인 자동 실행, 다시 로그인한 뒤 동작
|
|
70
|
+
|
|
71
|
+
업데이트와 제거도 같은 공개 버전으로 확인할 수 있습니다.
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
npx --yes @hnode/tidy@0.20.0 update
|
|
75
|
+
npx --yes @hnode/tidy@0.20.0 uninstall
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
제거 후 앱과 로그인 자동 실행 등록이 없어지고 설정은 보관돼야 합니다. macOS 기본 타일링과 시스템 단축키는 변경하지 않습니다. 실패 시 `sw_vers`, `uname -m`, `node --version`과 `npx --yes @hnode/tidy@0.20.0 status` 결과를 기록하세요. 설치 실패 시 터미널에 출력된 오류도 함께 확인합니다.
|
|
79
|
+
|
|
43
80
|
## User commands
|
|
44
81
|
|
|
45
82
|
```bash
|
|
@@ -50,7 +87,7 @@ tidy prefs
|
|
|
50
87
|
tidy status
|
|
51
88
|
```
|
|
52
89
|
|
|
53
|
-
최초 설치·확장 코드 업데이트
|
|
90
|
+
GNOME에서는 최초 설치·확장 코드 업데이트 후 한 번 다시 로그인합니다. macOS는 설치 후 바로 실행되며 손쉬운 사용 권한을 설정합니다. `npx @hnode/tidy@latest install`도 지원합니다. npm 패키지와 캐시를 삭제해도 설치된 확장·앱은 유지됩니다. macOS판을 게시하기 전에는 실제 Mac에서 창 배치·단축키·자동 실행·업데이트·제거도 검증하세요.
|
|
54
91
|
|
|
55
92
|
```bash
|
|
56
93
|
tidy uninstall
|
package/lib/layouts.js
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// Coordinates are fractions of the usable monitor area, in logical pixels.
|
|
2
|
+
export const ZONES = {
|
|
3
|
+
left: [0, 0, 0.5, 1], right: [0.5, 0, 0.5, 1],
|
|
4
|
+
top: [0, 0, 1, 0.5], bottom: [0, 0.5, 1, 0.5],
|
|
5
|
+
'top-left': [0, 0, 0.5, 0.5], 'top-right': [0.5, 0, 0.5, 0.5],
|
|
6
|
+
'bottom-left': [0, 0.5, 0.5, 0.5], 'bottom-right': [0.5, 0.5, 0.5, 0.5],
|
|
7
|
+
'left-third': [0, 0, 1 / 3, 1], 'center-third': [1 / 3, 0, 1 / 3, 1],
|
|
8
|
+
'right-third': [2 / 3, 0, 1 / 3, 1],
|
|
9
|
+
'left-two-thirds': [0, 0, 2 / 3, 1], 'right-two-thirds': [1 / 3, 0, 2 / 3, 1],
|
|
10
|
+
'left-quarter': [0, 0, 0.25, 1], 'center-half': [0.25, 0, 0.5, 1],
|
|
11
|
+
'right-quarter': [0.75, 0, 0.25, 1],
|
|
12
|
+
maximize: [0, 0, 1, 1], center: [0.125, 0.125, 0.75, 0.75],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const LAYOUTS = [
|
|
16
|
+
{name: "Halves", zones: ['left', 'right']},
|
|
17
|
+
{name: "Wide", zones: ['left-two-thirds', 'right-third']},
|
|
18
|
+
{name: "Focus", zones: ['left', 'top-right', 'bottom-right']},
|
|
19
|
+
{name: "Three columns", zones: ['left-third', 'center-third', 'right-third']},
|
|
20
|
+
{name: "Wide center", zones: ['left-quarter', 'center-half', 'right-quarter']},
|
|
21
|
+
{name: "Four quarters", zones: ['top-left', 'top-right', 'bottom-left', 'bottom-right']},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
export const ACTIONS = [
|
|
25
|
+
['snap-left', "Left half / left monitor", 'left', '<Super><Alt>Left'],
|
|
26
|
+
['snap-right', "Right half / right monitor", 'right', '<Super><Alt>Right'],
|
|
27
|
+
['snap-toggle-maximize', "Maximize / restore previous layout", 'toggle-maximize', '<Super><Alt>Return'],
|
|
28
|
+
['snap-top', "Top half / upper monitor", 'top', '<Super><Alt>Up'],
|
|
29
|
+
['snap-bottom', "Bottom half / lower monitor", 'bottom', '<Super><Alt>Down'],
|
|
30
|
+
['snap-top-left', "Top-left quarter", 'top-left', '<Super><Alt>u'],
|
|
31
|
+
['snap-top-right', "Top-right quarter", 'top-right', '<Super><Alt>i'],
|
|
32
|
+
['snap-bottom-left', "Bottom-left quarter", 'bottom-left', '<Super><Alt>j'],
|
|
33
|
+
['snap-bottom-right', "Bottom-right quarter", 'bottom-right', '<Super><Alt>k'],
|
|
34
|
+
['snap-left-third', "Left third", 'left-third', '<Super><Alt>d'],
|
|
35
|
+
['snap-center-third', "Center third", 'center-third', '<Super><Alt>f'],
|
|
36
|
+
['snap-right-third', "Right third", 'right-third', '<Super><Alt>g'],
|
|
37
|
+
['snap-left-two-thirds', "Left two-thirds", 'left-two-thirds', '<Super><Alt>e'],
|
|
38
|
+
['snap-right-two-thirds', "Right two-thirds", 'right-two-thirds', '<Super><Alt>t'],
|
|
39
|
+
['snap-center', "Centered three-quarter size", 'center', '<Super><Alt>c'],
|
|
40
|
+
['show-layouts', "Open layout picker", 'picker', '<Super><Alt>space'],
|
|
41
|
+
['next-monitor', "Move to next monitor", 'next-monitor', '<Super><Alt>n'],
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
export function zoneRect(area, zone, gap = 0) {
|
|
45
|
+
const parts = typeof zone === 'string' ? ZONES[zone] : zone;
|
|
46
|
+
if (!parts || area.width <= 0 || area.height <= 0)
|
|
47
|
+
throw new Error('Invalid zone or work area');
|
|
48
|
+
const [x, y, width, height] = parts;
|
|
49
|
+
// Round boundaries, not widths: adjacent thirds must share an exact edge.
|
|
50
|
+
const x1 = Math.round(area.x + area.width * x);
|
|
51
|
+
const y1 = Math.round(area.y + area.height * y);
|
|
52
|
+
const x2 = Math.round(area.x + area.width * (x + width));
|
|
53
|
+
const y2 = Math.round(area.y + area.height * (y + height));
|
|
54
|
+
const inset = Math.max(0, Math.min(Math.round(gap / 2), Math.floor((Math.min(x2 - x1, y2 - y1) - 1) / 2)));
|
|
55
|
+
return {x: x1 + inset, y: y1 + inset, width: x2 - x1 - inset * 2, height: y2 - y1 - inset * 2};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function companionZones(zone) {
|
|
59
|
+
const layout = LAYOUTS.find(item => item.zones.includes(zone));
|
|
60
|
+
return layout ? layout.zones.filter(other => other !== zone) :
|
|
61
|
+
({top: ['bottom'], bottom: ['top']})[zone] ?? [];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function monitorAt(monitors, x, y) {
|
|
65
|
+
return monitors.findIndex(m => x >= m.x && y >= m.y && x < m.x + m.width && y < m.y + m.height);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function contains(rect, x, y) {
|
|
69
|
+
return x >= rect.x && y >= rect.y && x < rect.x + rect.width && y < rect.y + rect.height;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function dragIntent(monitor, area, x, y, {height = 96, width = 320,
|
|
73
|
+
center = area.x + area.width / 2, picker = true} = {}) {
|
|
74
|
+
if (!contains(monitor, x, y))
|
|
75
|
+
return null;
|
|
76
|
+
const halfWidth = Math.min(width, area.width - 24) / 2;
|
|
77
|
+
if (picker && Math.abs(x - center) <= halfWidth && y <= area.y + height)
|
|
78
|
+
return {type: 'picker'};
|
|
79
|
+
// The rest of the top edge maximizes; the side edges tile directly.
|
|
80
|
+
if (y <= area.y + 12)
|
|
81
|
+
return {type: 'tile', zone: 'maximize'};
|
|
82
|
+
if (x <= monitor.x + 12)
|
|
83
|
+
return {type: 'tile', zone: 'left'};
|
|
84
|
+
if (x >= monitor.x + monitor.width - 12)
|
|
85
|
+
return {type: 'tile', zone: 'right'};
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const DIRECTIONS = {
|
|
90
|
+
left: ['x', 'width', 'y', 'height', -1], right: ['x', 'width', 'y', 'height', 1],
|
|
91
|
+
up: ['y', 'height', 'x', 'width', -1], down: ['y', 'height', 'x', 'width', 1],
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
function monitorCandidates(monitors, current, direction) {
|
|
95
|
+
const origin = monitors[current];
|
|
96
|
+
if (!origin || !Object.hasOwn(DIRECTIONS, direction)) return null;
|
|
97
|
+
const [axis, span, cross, crossSpan, sign] = DIRECTIONS[direction];
|
|
98
|
+
const center = origin[axis] + origin[span] / 2;
|
|
99
|
+
const crossCenter = origin[cross] + origin[crossSpan] / 2;
|
|
100
|
+
const candidates = monitors.map((monitor, index) => {
|
|
101
|
+
const advance = (monitor[axis] + monitor[span] / 2 - center) * sign;
|
|
102
|
+
const offset = Math.abs(monitor[cross] + monitor[crossSpan] / 2 - crossCenter);
|
|
103
|
+
const overlap = Math.min(origin[cross] + origin[crossSpan], monitor[cross] + monitor[crossSpan]) -
|
|
104
|
+
Math.max(origin[cross], monitor[cross]);
|
|
105
|
+
const axisOverlap = Math.min(origin[axis] + origin[span], monitor[axis] + monitor[span]) -
|
|
106
|
+
Math.max(origin[axis], monitor[axis]);
|
|
107
|
+
const gap = sign > 0 ? monitor[axis] - origin[axis] - origin[span] : origin[axis] - monitor[axis] - monitor[span];
|
|
108
|
+
return {index, advance, offset, axisOverlap, aligned: overlap > 0, gap: Math.max(0, gap),
|
|
109
|
+
edge: monitor[axis] + (sign < 0 ? monitor[span] : 0)};
|
|
110
|
+
}).filter(item => item.index !== current && (item.aligned || item.axisOverlap <= 0));
|
|
111
|
+
return {sign, candidates};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export function adjacentMonitor(monitors, current, direction) {
|
|
115
|
+
const candidates = monitorCandidates(monitors, current, direction)?.candidates.filter(item => item.advance > 0) ?? [];
|
|
116
|
+
candidates.sort((a, b) => Number(b.aligned) - Number(a.aligned) ||
|
|
117
|
+
a.gap - b.gap || Math.hypot(a.advance, a.offset) - Math.hypot(b.advance, b.offset));
|
|
118
|
+
return candidates[0]?.index ?? -1;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function directionalMonitor(monitors, current, direction) {
|
|
122
|
+
const adjacent = adjacentMonitor(monitors, current, direction);
|
|
123
|
+
if (adjacent >= 0) return {monitor: adjacent, wrapped: false};
|
|
124
|
+
const measured = monitorCandidates(monitors, current, direction);
|
|
125
|
+
if (!measured) return null;
|
|
126
|
+
const {sign, candidates} = measured;
|
|
127
|
+
const opposite = candidates.filter(item => item.advance < 0);
|
|
128
|
+
// Prefer the same row/column, then its opposite outer edge. Offsets on
|
|
129
|
+
// the other axis must not turn a vertical stack into a left/right move.
|
|
130
|
+
opposite.sort((a, b) => Number(b.aligned) - Number(a.aligned) || sign * (a.edge - b.edge) || a.offset - b.offset);
|
|
131
|
+
return opposite.length ? {monitor: opposite[0].index, wrapped: true} : null;
|
|
132
|
+
}
|
package/lib/translations.json
CHANGED
|
@@ -102,7 +102,6 @@
|
|
|
102
102
|
"Percent. Sizes are limited to fit the monitor.": "퍼센트. 모니터에 맞게 최대 크기를 제한합니다.",
|
|
103
103
|
"Adapt picker size to each monitor": "모니터에 맞춰 선택기 크기 자동 조절",
|
|
104
104
|
"Keep the built-in display size and gently enlarge the picker on larger external displays. Your size settings remain the baseline. Default: on.": "내장 화면의 크기는 유지하고, 큰 외장 모니터에서는 선택기를 적당히 키웁니다. 지정한 크기를 기준으로 조절합니다. 기본값: 켬",
|
|
105
|
-
"Tidy · Window tiling for GNOME\n\nUsage: tidy <command>\n\n install Install Tidy for the current user\n update Install this package version of Tidy\n uninstall Remove Tidy and restore desktop settings\n prefs Open settings and shortcuts\n status Show the installed extension status\n doctor Check system requirements\n\nInstall: npx @hnode/tidy@latest install\nAfter installation, log out and back in once.": "Tidy · GNOME 창 배치\n\n사용법: tidy <명령>\n\n install 현재 사용자에게 Tidy 설치\n update 현재 npm 패키지 버전으로 Tidy 갱신\n uninstall Tidy 제거 및 데스크톱 설정 복원\n prefs 설정 및 단축키 열기\n status 설치한 확장 상태 확인\n doctor 시스템 요구 사항 확인\n\n설치: npx @hnode/tidy@latest install\n설치 후 한 번 로그아웃하고 다시 로그인하세요.",
|
|
106
105
|
"Unknown command. Run tidy --help.": "알 수 없는 명령입니다. tidy --help를 실행하세요.",
|
|
107
106
|
"Tidy requires Linux with GNOME Shell 46–50.": "Tidy는 GNOME Shell 46–50을 사용하는 Linux에서 실행할 수 있습니다.",
|
|
108
107
|
"Run Tidy as your desktop user, without sudo.": "sudo 없이 현재 데스크톱 사용자로 Tidy를 실행하세요.",
|
|
@@ -128,6 +127,9 @@
|
|
|
128
127
|
"Could not save extension preferences: {uuid}": "확장 설정을 저장하지 못했습니다: {uuid}",
|
|
129
128
|
"The previous extension will be restored at the next login: {uuid}": "기존 확장은 다음 로그인에 복원됩니다: {uuid}",
|
|
130
129
|
"The previous extension is no longer installed; skipping restoration: {uuid}": "기존 확장이 이미 제거되어 복원을 건너뜁니다: {uuid}",
|
|
131
|
-
"GNOME could not remove Tidy.": "GNOME이 Tidy를 제거하지 못했습니다."
|
|
130
|
+
"GNOME could not remove Tidy.": "GNOME이 Tidy를 제거하지 못했습니다.",
|
|
131
|
+
"Quit": "종료",
|
|
132
|
+
"Tidy supports Linux with GNOME Shell 46–50 and macOS.": "Tidy는 GNOME Shell 46–50 기반 Linux와 macOS를 지원합니다.",
|
|
133
|
+
"Tidy · Window tiling for Linux and macOS\n\nUsage: tidy <command>\n tidy [options]\n\nCommands:\n install Install Tidy for the current user\n update Install this package version of Tidy\n uninstall Remove Tidy and restore desktop settings\n prefs Open settings and shortcuts\n status Show installation and runtime status\n doctor Check system requirements\n\nOptions:\n -h, --help Show this help\n -v, --version Show package version\n\nGNOME: log out and back in once. macOS: starts immediately.": "Tidy · Linux와 macOS 창 배치\n\n사용법: tidy <명령>\n tidy [옵션]\n\n명령:\n install 현재 사용자에게 Tidy 설치\n update 현재 npm 패키지 버전으로 Tidy 갱신\n uninstall Tidy 제거 및 데스크톱 설정 복원\n prefs 설정 및 단축키 열기\n status 설치 및 실행 상태 확인\n doctor 시스템 요구 사항 확인\n\n옵션:\n -h, --help 도움말 표시\n -v, --version npm 패키지 버전 표시\n\nGNOME: 한 번 로그아웃하고 다시 로그인하세요. macOS: 바로 실행됩니다."
|
|
132
134
|
}
|
|
133
135
|
}
|
package/package.json
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hnode/tidy",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Window tiling for
|
|
3
|
+
"version": "0.20.0",
|
|
4
|
+
"description": "Window tiling for GNOME and macOS with a layout picker, custom shortcuts and multi-monitor support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"tidy": "bin/tidy.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
10
|
"bin/tidy.js",
|
|
11
|
+
"desktop/*.js",
|
|
12
|
+
"desktop/*.cjs",
|
|
13
|
+
"desktop/*.html",
|
|
14
|
+
"desktop/*.css",
|
|
15
|
+
"desktop/package.json",
|
|
16
|
+
"desktop/package-lock.json",
|
|
17
|
+
"desktop/native/*.swift",
|
|
18
|
+
"lib/layouts.js",
|
|
11
19
|
"lib/i18nCore.js",
|
|
12
20
|
"lib/translations.json",
|
|
13
21
|
"metadata.json",
|
|
@@ -17,28 +25,30 @@
|
|
|
17
25
|
"dist/winubun@winubun.local.shell-extension.zip",
|
|
18
26
|
"docs/README.en.md",
|
|
19
27
|
"docs/DEVELOPMENT.md",
|
|
28
|
+
"docs/MACOS.md",
|
|
20
29
|
"docs/RELEASING.md",
|
|
21
30
|
"docs/preview.png",
|
|
22
31
|
"docs/assist-preview.png",
|
|
23
32
|
"LICENSE",
|
|
24
33
|
"NOTICE"
|
|
25
34
|
],
|
|
26
|
-
"os": ["linux"],
|
|
35
|
+
"os": ["linux", "darwin"],
|
|
27
36
|
"engines": {
|
|
28
37
|
"node": ">=18"
|
|
29
38
|
},
|
|
30
|
-
"keywords": ["gnome", "ubuntu", "tiling", "window-manager", "snap-layouts", "multi-monitor"],
|
|
39
|
+
"keywords": ["gnome", "ubuntu", "macos", "tiling", "window-manager", "snap-layouts", "multi-monitor"],
|
|
31
40
|
"publishConfig": {
|
|
32
41
|
"access": "public",
|
|
33
42
|
"registry": "https://registry.npmjs.org/"
|
|
34
43
|
},
|
|
35
44
|
"scripts": {
|
|
36
|
-
"test": "node
|
|
37
|
-
"check": "
|
|
45
|
+
"test": "node scripts/test.js",
|
|
46
|
+
"check": "node scripts/check.js",
|
|
38
47
|
"test:shell": "python3 scripts/test-shell.py",
|
|
39
|
-
"build": "
|
|
40
|
-
"prepack": "
|
|
48
|
+
"build": "node scripts/build.js",
|
|
49
|
+
"prepack": "node scripts/build.js",
|
|
41
50
|
"test:package": "node tests/npm-package-smoke.js",
|
|
51
|
+
"test:desktop-ui": "node desktop/node_modules/electron/cli.js tests/desktop-ui-smoke.cjs",
|
|
42
52
|
"install-extension": "python3 scripts/manage.py install",
|
|
43
53
|
"uninstall-extension": "python3 scripts/manage.py uninstall"
|
|
44
54
|
},
|
package/scripts/manage.py
CHANGED
|
@@ -195,6 +195,8 @@ def install(archive=None):
|
|
|
195
195
|
DEST.mkdir(parents=True, exist_ok=True)
|
|
196
196
|
with zipfile.ZipFile(archive) as package:
|
|
197
197
|
package.extractall(DEST)
|
|
198
|
+
if 'schemas/gschemas.compiled' not in package.namelist():
|
|
199
|
+
run('glib-compile-schemas', '--strict', str(DEST / 'schemas'))
|
|
198
200
|
install_launcher()
|
|
199
201
|
if not registered or registered.get('version') != metadata['version']:
|
|
200
202
|
schedule_update(metadata['version'])
|