Initial commit — CTile Cinnamon extension
Snap layout overlay for Cinnamon 6.6. Drag a window to the top edge to reveal a picker with 14 tiling presets (halves, quarters, thirds). Layout previews use the system theme's accent color and update live when the theme changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
81
README.md
Normal file
81
README.md
Normal file
@@ -0,0 +1,81 @@
|
||||
# CTile
|
||||
|
||||
A Cinnamon desktop extension that brings snap layout overlays to window management — drag any window toward the top of your screen and a layout picker appears, letting you tile it into a preset zone without touching the keyboard.
|
||||
|
||||
## How it works
|
||||
|
||||
1. Start dragging any window by its titlebar
|
||||
2. Move the cursor within ~50px of the top screen edge — the layout picker appears
|
||||
3. Hover over the desired zone (the overlay stays visible as long as your cursor is within 20px of it)
|
||||
4. Release — the window snaps to that zone
|
||||
|
||||
The overlay displays 14 layout presets across three rows:
|
||||
|
||||
| Row | Layouts |
|
||||
|-----|---------|
|
||||
| Basic | Full, Left ½, Right ½, Top ½, Bottom ½ |
|
||||
| Quarters | Top-left, Top-right, Bottom-left, Bottom-right |
|
||||
| Thirds | Left ⅓, Center ⅓, Right ⅓, Left ⅔, Right ⅔ |
|
||||
|
||||
Layout previews are drawn in your system theme's accent color and update automatically when you change themes.
|
||||
|
||||
## Installation
|
||||
|
||||
Copy (or symlink) the repo directory to Cinnamon's extensions folder under the extension's UUID, then enable it:
|
||||
|
||||
```bash
|
||||
cp -r /path/to/ctile ~/.local/share/cinnamon/extensions/ctile@ctile
|
||||
```
|
||||
|
||||
Then open **System Settings → Extensions**, find **CTile**, and enable it. Or via the command line:
|
||||
|
||||
```bash
|
||||
gsettings set org.cinnamon enabled-extensions "['ctile@ctile']"
|
||||
```
|
||||
|
||||
Restart Cinnamon (`Alt+F2` → `r` → Enter) if the extension doesn't appear immediately.
|
||||
|
||||
## Development
|
||||
|
||||
After editing, sync and reload without restarting Cinnamon:
|
||||
|
||||
```bash
|
||||
cp extension.js stylesheet.css metadata.json ~/.local/share/cinnamon/extensions/ctile@ctile/
|
||||
```
|
||||
|
||||
Then reload via Looking Glass (`Alt+F2` → `lg`) or with:
|
||||
|
||||
```bash
|
||||
dbus-send --session --dest=org.Cinnamon /org/Cinnamon org.Cinnamon.Eval \
|
||||
string:'const es = imports.ui.extensionSystem; es.disableExtension("ctile@ctile"); es.enableExtension("ctile@ctile");'
|
||||
```
|
||||
|
||||
Debug output goes to `~/.xsession-errors` — search for `[ctile]`.
|
||||
|
||||
## Tunables
|
||||
|
||||
At the top of [extension.js](extension.js):
|
||||
|
||||
| Constant | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `TRIGGER_Y` | `50` | Pixels from top edge that triggers the overlay |
|
||||
| `POLL_INTERVAL` | `40` | Milliseconds between pointer polls during a drag |
|
||||
| `THUMB_W` / `THUMB_H` | `66` / `44` | Layout preview thumbnail dimensions |
|
||||
| `SHOW_ANIM_MS` / `HIDE_ANIM_MS` | `120` / `100` | Fade in/out duration |
|
||||
|
||||
## Compatibility
|
||||
|
||||
Tested on **Cinnamon 6.6.7** / **Muffin 6.6.3**.
|
||||
|
||||
> **Note for porters:** Muffin 6.6 passes four arguments to `grab-op-begin` — `(display, screen, window, op)` — unlike older versions which passed three. If you see the overlay never appearing, verify the signal arity with Looking Glass.
|
||||
|
||||
## File structure
|
||||
|
||||
```
|
||||
ctile/
|
||||
├── extension.js — all extension logic (~460 lines)
|
||||
├── metadata.json — UUID, name, supported Cinnamon versions
|
||||
├── stylesheet.css — overlay and button styles
|
||||
├── README.md
|
||||
└── AGENTS.md
|
||||
```
|
||||
Reference in New Issue
Block a user