https://github.com/ethanuppal/unnamed
🖥️🦀 Extremely simple window layout engine for macOS built in Rust!
https://github.com/ethanuppal/unnamed
layout macos rust
Last synced: 2 months ago
JSON representation
🖥️🦀 Extremely simple window layout engine for macOS built in Rust!
- Host: GitHub
- URL: https://github.com/ethanuppal/unnamed
- Owner: ethanuppal
- Created: 2025-03-20T10:47:25.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-07T22:08:46.000Z (about 1 year ago)
- Last Synced: 2025-07-28T01:40:47.882Z (11 months ago)
- Topics: layout, macos, rust
- Language: Rust
- Homepage:
- Size: 67.4 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# unnamed: Extremely simple window layout engine for macOS
> [!NOTE]
> The name, in addition to the code, is a work-in-progress!
This is currently just for me because I want to automatically pin apps to have specific border insets.
Thus, the border insets are not configurable -- they will always be
```rs
const LEFT_INSET: CGFloat = 8.0;
const RIGHT_INSET: CGFloat = 8.0;
const TOP_INSET: CGFloat = 6.0;
const BOTTOM_INSET: CGFloat = 8.0;
const INNER_SPACING: CGFloat = 12.0;
```
because those look best on my system.
**It's also probably very buggy.**
## Usage
First, clone:
```shell
git clone https://github.com/ethanuppal/unnamed.git
cd unnamed
```
Then, run:
```shell
cargo build --release
./target/release/unnamed -- apps.txt
```
For example, see [`apps.txt`](./apps.txt).
This file contains the "core" apps --- these are the apps that unnamed will actively maintain in certain layouts (_i,e,._, you can't accidently move or resize them).
You will need to give `target/release/unnamed` accessibility permissions.
> [!CAUTION]
> Right now, I don't check for whether windows get resized afterward --- the next step is to (1) setup `AXObserver`s for when new windows are created, ~~get moved, or get resized~~ and (2) setup `NSNotification`s for when the specified apps are closed and reopened.
## Roadmap
- [x] Layout apps on screen
- [x] Keybinds to change app layout or prevent maintaining layout
- [x] Non-core apps can still be manually/temporarily layouted with keybinds
- [ ] Check when a core app launches new windows and handle those / check when a core app closes a window
- [ ] Check when a core app is closed and reopened
## Layouts
Three layout options are supported (where `Super` is `Command-Control-Option`):
- full screen (`Super-Shift-C`)
- left (`Super-Shift-H`)
- right (`Super-Shift-L`)
- toggle floating (`Super-Shift-Space`)
The toggle-floating option only matters for core apps since non-core apps will always behave as if they are in that state.
## Debugging
This is for me on macOS:
Address sanitizer:
```shell
ASAN_OPTIONS=detect_leaks=1:symbolize=1 RUSTFLAGS=-Zsanitizer=address cargo +nightly r -Z build-std --target aarch64-apple-darwin -- com.apple.Safari net.kovidgoyal.kitty
```