back up project
This commit is contained in:
@@ -0,0 +1,179 @@
|
||||
# tint
|
||||
|
||||
A small wrapper around [Tinty](https://github.com/tinted-theming/tinty) that manages light/dark theme pairs and applies the selected theme to Ghostty, Zed, Herdr, and OMP.
|
||||
|
||||
## Requirements
|
||||
|
||||
This setup targets macOS and requires:
|
||||
|
||||
- [Homebrew](https://brew.sh/)
|
||||
- Go 1.26 or newer
|
||||
- Tinty 0.34 or newer
|
||||
- [`dark-notify`](https://github.com/cormacrelf/dark-notify) for automatic switching when macOS changes appearance
|
||||
- `make` from the Xcode Command Line Tools
|
||||
|
||||
Install the required tools:
|
||||
|
||||
```sh
|
||||
xcode-select --install
|
||||
brew tap tinted-theming/tinted
|
||||
brew install tinty go
|
||||
brew install cormacrelf/tap/dark-notify
|
||||
```
|
||||
|
||||
Ghostty, Zed, Herdr, and OMP are optional consumers. Install only the applications you use.
|
||||
|
||||
## Install
|
||||
|
||||
From this directory, run:
|
||||
|
||||
```sh
|
||||
make install
|
||||
```
|
||||
|
||||
The installer:
|
||||
|
||||
- Builds `~/.local/bin/tint`.
|
||||
- Installs `config.toml` under `$XDG_CONFIG_HOME/tinted-theming/tinty`, or `~/.config/tinted-theming/tinty` when `XDG_CONFIG_HOME` is unset.
|
||||
- Copies `state.toml` only when no state file already exists.
|
||||
- Creates `~/.config/herdr/config.toml` if needed.
|
||||
- Runs `tinty sync` to download the configured theme repositories.
|
||||
- Creates and loads a `dark-notify` LaunchAgent for automatic macOS appearance switching.
|
||||
|
||||
Add the binary directory to your shell path:
|
||||
|
||||
```sh
|
||||
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
|
||||
source ~/.zshrc
|
||||
```
|
||||
|
||||
Verify the installation:
|
||||
|
||||
```sh
|
||||
which tint
|
||||
tinty --version
|
||||
tint
|
||||
```
|
||||
|
||||
## Automatic light/dark switching
|
||||
|
||||
`make install` creates and loads `~/Library/LaunchAgents/dev.tinty.dark-notify.plist`. The agent starts at login, restarts if it exits, and invokes `tint light` or `tint dark` whenever macOS changes appearance.
|
||||
|
||||
Confirm that the agent is running:
|
||||
|
||||
```sh
|
||||
launchctl print "gui/$(id -u)/dev.tinty.dark-notify"
|
||||
```
|
||||
|
||||
Inspect its output if an application does not update:
|
||||
|
||||
```sh
|
||||
tail -f ~/Library/Logs/dark-notify.log
|
||||
```
|
||||
|
||||
## Application setup
|
||||
|
||||
### Ghostty
|
||||
|
||||
The Tinty hook writes:
|
||||
|
||||
```text
|
||||
~/.config/ghostty/themes/tinted-theming
|
||||
```
|
||||
|
||||
Select it in the Ghostty configuration:
|
||||
|
||||
```text
|
||||
theme = tinted-theming
|
||||
```
|
||||
|
||||
The hook sends `SIGUSR2` to reload Ghostty after applying a theme.
|
||||
|
||||
### Zed
|
||||
|
||||
The wrapper writes:
|
||||
|
||||
```text
|
||||
~/.config/zed/themes/tinty-current.json
|
||||
```
|
||||
|
||||
After applying the first theme, select `Tinty Current` in Zed.
|
||||
|
||||
### Herdr
|
||||
|
||||
The wrapper maintains a generated `[theme.custom]` block in:
|
||||
|
||||
```text
|
||||
~/.config/herdr/config.toml
|
||||
```
|
||||
|
||||
When the `herdr` executable is available, the wrapper also runs `herdr server reload-config`.
|
||||
|
||||
### OMP
|
||||
|
||||
The wrapper writes:
|
||||
|
||||
```text
|
||||
~/.omp/agent/themes/tinty-current.json
|
||||
```
|
||||
|
||||
Configure OMP to use `tinty-current` where required.
|
||||
|
||||
## Usage
|
||||
|
||||
Show the current pair and available commands:
|
||||
|
||||
```sh
|
||||
tint
|
||||
```
|
||||
|
||||
Select a named pair:
|
||||
|
||||
```sh
|
||||
tint swamp
|
||||
```
|
||||
|
||||
Apply one side of the current pair:
|
||||
|
||||
```sh
|
||||
tint light
|
||||
tint dark
|
||||
```
|
||||
|
||||
Set both sides:
|
||||
|
||||
```sh
|
||||
tint light:base16-swamp-light dark:base16-swamp-dark
|
||||
```
|
||||
|
||||
Save and favorite a named pair:
|
||||
|
||||
```sh
|
||||
tint pair swamp dark:base16-swamp-dark light:base16-swamp-light
|
||||
tint favorite swamp
|
||||
```
|
||||
|
||||
Force appearance selection for scripts or troubleshooting:
|
||||
|
||||
```sh
|
||||
TINTY_PAIR_APPEARANCE=light tint swamp
|
||||
TINTY_PAIR_APPEARANCE=dark tint swamp
|
||||
```
|
||||
|
||||
## Update
|
||||
|
||||
After changing or updating the wrapper source:
|
||||
|
||||
```sh
|
||||
make install
|
||||
```
|
||||
|
||||
Existing `state.toml` content is preserved.
|
||||
|
||||
## Uninstall
|
||||
|
||||
```sh
|
||||
make uninstall
|
||||
```
|
||||
|
||||
This unloads and removes the LaunchAgent, log, and `tint` binary. It also removes configuration, state, and the empty Herdr configuration only when they were originally created by `make install`; pre-existing user files are preserved. Tinty itself and its shared data remain installed.
|
||||
Reference in New Issue
Block a user