ghostty-ambient 0.6.0__tar.gz
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.
- ghostty_ambient-0.6.0/PKG-INFO +228 -0
- ghostty_ambient-0.6.0/README.md +197 -0
- ghostty_ambient-0.6.0/pyproject.toml +123 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/__init__.py +18 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/adaptive_model.py +430 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/adaptive_scorer.py +123 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/bayesian_embedding.py +365 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/cli.py +992 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/color.py +159 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/daemon.py +267 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/daemon_manager.py +371 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/embedding_cache.py +210 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/embeddings.py +391 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/factors/__init__.py +33 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/factors/base.py +126 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/factors/builtin.py +394 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/history.py +350 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/observations.py +365 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/phase_detector.py +279 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/picker.py +84 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/sensor.py +464 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/sensors/__init__.py +17 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/sensors/backends/__init__.py +21 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/sensors/backends/linux.py +81 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/sensors/backends/macos.py +78 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/sensors/backends/windows.py +73 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/sensors/loader.py +67 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/sensors/protocol.py +64 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/sensors/registry.py +93 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/theme_generator.py +204 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/themes.py +226 -0
- ghostty_ambient-0.6.0/src/ghostty_ambient/tui.py +187 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: ghostty-ambient
|
|
3
|
+
Version: 0.6.0
|
|
4
|
+
Summary: Ambient light-aware Ghostty theme selector with Bayesian preference learning
|
|
5
|
+
Keywords: ghostty,terminal,theme,ambient,bayesian
|
|
6
|
+
Author: Gezim Basha
|
|
7
|
+
License-Expression: MIT
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Operating System :: MacOS
|
|
12
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
15
|
+
Classifier: Topic :: Terminals :: Terminal Emulators/X Terminals
|
|
16
|
+
Requires-Dist: simple-term-menu>=1.6.0
|
|
17
|
+
Requires-Dist: rich>=13.0.0
|
|
18
|
+
Requires-Dist: numpy>=1.26.0
|
|
19
|
+
Requires-Dist: readchar>=4.0.0
|
|
20
|
+
Requires-Dist: pytest>=8.0.0 ; extra == 'dev'
|
|
21
|
+
Requires-Dist: pytest-cov>=4.0.0 ; extra == 'dev'
|
|
22
|
+
Requires-Dist: freezegun>=1.2.0 ; extra == 'dev'
|
|
23
|
+
Requires-Dist: winsdk>=1.0.0b10 ; extra == 'windows'
|
|
24
|
+
Requires-Python: >=3.12
|
|
25
|
+
Project-URL: Homepage, https://github.com/gezibash/ghostty-ambient
|
|
26
|
+
Project-URL: Repository, https://github.com/gezibash/ghostty-ambient
|
|
27
|
+
Project-URL: Issues, https://github.com/gezibash/ghostty-ambient/issues
|
|
28
|
+
Provides-Extra: dev
|
|
29
|
+
Provides-Extra: windows
|
|
30
|
+
Description-Content-Type: text/markdown
|
|
31
|
+
|
|
32
|
+
# Ghostty Ambient
|
|
33
|
+
|
|
34
|
+
Ambient light-aware theme selector for [Ghostty](https://ghostty.org/) with Bayesian preference learning.
|
|
35
|
+
|
|
36
|
+
<img src="https://github.com/gezibash/ghostty-ambient/releases/download/v0.1.0/demo.gif" alt="ghostty-ambient demo" />
|
|
37
|
+
|
|
38
|
+
## Quick Install
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
curl -fsSL https://raw.githubusercontent.com/gezibash/ghostty-ambient/main/install.sh | bash
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
This installs the package and sets up the learning daemon to run automatically.
|
|
45
|
+
|
|
46
|
+
## Features
|
|
47
|
+
|
|
48
|
+
- **Ambient Light Sensing**: Reads your Mac's ambient light sensor to suggest themes appropriate for current lighting
|
|
49
|
+
- **Bayesian Learning**: Learns your color preferences over time—which themes you prefer in different contexts
|
|
50
|
+
- **Context-Aware**: Considers time of day, weather, system dark/light mode, and power source
|
|
51
|
+
- **Theme Generation**: Generates custom themes from your learned preferences (background, contrast, saturation)
|
|
52
|
+
- **Portable Profiles**: Export/import your learned preferences across devices
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# Using uv (recommended)
|
|
58
|
+
uv add ghostty-ambient
|
|
59
|
+
|
|
60
|
+
# Using pip
|
|
61
|
+
pip install ghostty-ambient
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Quick Start
|
|
65
|
+
|
|
66
|
+
### Interactive Theme Picker
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
ghostty-ambient
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Shows a picker with theme recommendations based on current conditions. Select a theme to apply it.
|
|
73
|
+
|
|
74
|
+
### Run the Learning Daemon
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
ghostty-ambient --daemon
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Runs in the background, learning your preferences by observing which themes you use in different contexts. Only records when Ghostty is the frontmost application.
|
|
81
|
+
|
|
82
|
+
### Generate Your Ideal Theme
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
ghostty-ambient --ideal
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
Generates and applies a custom theme optimized for your current context, based on learned preferences:
|
|
89
|
+
- Background color (light vs dark)
|
|
90
|
+
- Contrast (how much difference between background and foreground)
|
|
91
|
+
- Chroma (color saturation)
|
|
92
|
+
|
|
93
|
+
## CLI Reference
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
ghostty-ambient # Interactive theme picker
|
|
97
|
+
ghostty-ambient --ideal # Generate and apply optimal theme
|
|
98
|
+
ghostty-ambient --set NAME # Set theme by name
|
|
99
|
+
ghostty-ambient --stats # Show learned preferences
|
|
100
|
+
ghostty-ambient --export-profile FILE # Export preferences
|
|
101
|
+
ghostty-ambient --import-profile FILE # Import preferences
|
|
102
|
+
ghostty-ambient --favorite # Mark current theme as favorite
|
|
103
|
+
ghostty-ambient --dislike # Mark current theme as disliked
|
|
104
|
+
ghostty-ambient --sensors # Show available light sensors
|
|
105
|
+
ghostty-ambient --setup # Configure location (for weather)
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Daemon Management
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
ghostty-ambient --status # Check daemon status
|
|
112
|
+
ghostty-ambient --start # Start daemon (5m interval)
|
|
113
|
+
ghostty-ambient --start --freq 1m # Start with custom interval
|
|
114
|
+
ghostty-ambient --stop # Stop daemon
|
|
115
|
+
ghostty-ambient --restart # Restart daemon
|
|
116
|
+
ghostty-ambient --logs # Tail daemon logs
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
### Run Daemon Inline
|
|
120
|
+
|
|
121
|
+
```bash
|
|
122
|
+
ghostty-ambient --daemon # Run daemon in foreground
|
|
123
|
+
ghostty-ambient --daemon --interval 30s # Custom interval
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## How It Works
|
|
127
|
+
|
|
128
|
+
### Bayesian Preference Learning
|
|
129
|
+
|
|
130
|
+
The system learns three key properties of your theme preferences:
|
|
131
|
+
|
|
132
|
+
| Property | What It Learns |
|
|
133
|
+
|----------|----------------|
|
|
134
|
+
| **Background L** | Light vs dark theme preference (LAB lightness) |
|
|
135
|
+
| **Contrast** | Preferred difference between background and foreground |
|
|
136
|
+
| **Chroma** | Preferred color saturation in the palette |
|
|
137
|
+
|
|
138
|
+
These are learned per-context:
|
|
139
|
+
- Time of day (morning, afternoon, evening, night)
|
|
140
|
+
- Ambient light (dim, office, bright, daylight)
|
|
141
|
+
- System appearance (light mode, dark mode)
|
|
142
|
+
- Power source (AC, battery)
|
|
143
|
+
|
|
144
|
+
### View Your Learned Preferences
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
ghostty-ambient --stats
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
By Time of Day
|
|
152
|
+
╭───────────┬───────┬────┬──────────┬────────┬─────╮
|
|
153
|
+
│ │ Theme │ L │ Contrast │ Chroma │ n │
|
|
154
|
+
├───────────┼───────┼────┼──────────┼────────┼─────┤
|
|
155
|
+
│ Morning │ light │ 97 │ 84 │ 49 │ 124 │
|
|
156
|
+
│ Afternoon │ light │ 97 │ 86 │ 50 │ 121 │
|
|
157
|
+
╰───────────┴───────┴────┴──────────┴────────┴─────╯
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Portable Profiles
|
|
161
|
+
|
|
162
|
+
Export your learned preferences:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
ghostty-ambient --export-profile ~/my-prefs.json
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
Import on another device:
|
|
169
|
+
|
|
170
|
+
```bash
|
|
171
|
+
ghostty-ambient --import-profile ~/my-prefs.json
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Platform Support
|
|
175
|
+
|
|
176
|
+
| Platform | Ambient Light Sensor | Theme Detection |
|
|
177
|
+
|----------|---------------------|-----------------|
|
|
178
|
+
| macOS | Native (via `als` helper) | Full support |
|
|
179
|
+
| Linux | Via `iio-sensor-proxy` | Full support |
|
|
180
|
+
| Windows | Via Windows SDK | Partial support |
|
|
181
|
+
|
|
182
|
+
### macOS Ambient Light Sensor
|
|
183
|
+
|
|
184
|
+
The bundled `als` binary reads the ambient light sensor. To compile from source:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
clang -framework IOKit -framework CoreFoundation als.m -o als
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
## Daemon Management
|
|
191
|
+
|
|
192
|
+
The install script sets up a background daemon that learns your preferences. Use these commands to manage it:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
ghostty-ambient --status # Check if daemon is running
|
|
196
|
+
ghostty-ambient --start # Start the daemon (default 5m interval)
|
|
197
|
+
ghostty-ambient --start --freq 30s # Start with custom interval
|
|
198
|
+
ghostty-ambient --stop # Stop the daemon
|
|
199
|
+
ghostty-ambient --restart # Restart the daemon
|
|
200
|
+
ghostty-ambient --logs # Tail daemon logs (Ctrl+C to exit)
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
## Uninstall
|
|
204
|
+
|
|
205
|
+
```bash
|
|
206
|
+
curl -fsSL https://raw.githubusercontent.com/gezibash/ghostty-ambient/main/uninstall.sh | bash
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
Your learned preferences are preserved in `~/.config/ghostty-ambient/`.
|
|
210
|
+
|
|
211
|
+
## Development
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
# Clone and install dev dependencies
|
|
215
|
+
git clone https://github.com/gezibash/ghostty-ambient
|
|
216
|
+
cd ghostty-ambient
|
|
217
|
+
uv sync --all-extras
|
|
218
|
+
|
|
219
|
+
# Run tests
|
|
220
|
+
uv run pytest
|
|
221
|
+
|
|
222
|
+
# Run with verbose output
|
|
223
|
+
uv run ghostty-ambient --daemon --interval 30s
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## License
|
|
227
|
+
|
|
228
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
# Ghostty Ambient
|
|
2
|
+
|
|
3
|
+
Ambient light-aware theme selector for [Ghostty](https://ghostty.org/) with Bayesian preference learning.
|
|
4
|
+
|
|
5
|
+
<img src="https://github.com/gezibash/ghostty-ambient/releases/download/v0.1.0/demo.gif" alt="ghostty-ambient demo" />
|
|
6
|
+
|
|
7
|
+
## Quick Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
curl -fsSL https://raw.githubusercontent.com/gezibash/ghostty-ambient/main/install.sh | bash
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This installs the package and sets up the learning daemon to run automatically.
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
- **Ambient Light Sensing**: Reads your Mac's ambient light sensor to suggest themes appropriate for current lighting
|
|
18
|
+
- **Bayesian Learning**: Learns your color preferences over time—which themes you prefer in different contexts
|
|
19
|
+
- **Context-Aware**: Considers time of day, weather, system dark/light mode, and power source
|
|
20
|
+
- **Theme Generation**: Generates custom themes from your learned preferences (background, contrast, saturation)
|
|
21
|
+
- **Portable Profiles**: Export/import your learned preferences across devices
|
|
22
|
+
|
|
23
|
+
## Installation
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Using uv (recommended)
|
|
27
|
+
uv add ghostty-ambient
|
|
28
|
+
|
|
29
|
+
# Using pip
|
|
30
|
+
pip install ghostty-ambient
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Quick Start
|
|
34
|
+
|
|
35
|
+
### Interactive Theme Picker
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
ghostty-ambient
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
Shows a picker with theme recommendations based on current conditions. Select a theme to apply it.
|
|
42
|
+
|
|
43
|
+
### Run the Learning Daemon
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
ghostty-ambient --daemon
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Runs in the background, learning your preferences by observing which themes you use in different contexts. Only records when Ghostty is the frontmost application.
|
|
50
|
+
|
|
51
|
+
### Generate Your Ideal Theme
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
ghostty-ambient --ideal
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Generates and applies a custom theme optimized for your current context, based on learned preferences:
|
|
58
|
+
- Background color (light vs dark)
|
|
59
|
+
- Contrast (how much difference between background and foreground)
|
|
60
|
+
- Chroma (color saturation)
|
|
61
|
+
|
|
62
|
+
## CLI Reference
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
ghostty-ambient # Interactive theme picker
|
|
66
|
+
ghostty-ambient --ideal # Generate and apply optimal theme
|
|
67
|
+
ghostty-ambient --set NAME # Set theme by name
|
|
68
|
+
ghostty-ambient --stats # Show learned preferences
|
|
69
|
+
ghostty-ambient --export-profile FILE # Export preferences
|
|
70
|
+
ghostty-ambient --import-profile FILE # Import preferences
|
|
71
|
+
ghostty-ambient --favorite # Mark current theme as favorite
|
|
72
|
+
ghostty-ambient --dislike # Mark current theme as disliked
|
|
73
|
+
ghostty-ambient --sensors # Show available light sensors
|
|
74
|
+
ghostty-ambient --setup # Configure location (for weather)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Daemon Management
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
ghostty-ambient --status # Check daemon status
|
|
81
|
+
ghostty-ambient --start # Start daemon (5m interval)
|
|
82
|
+
ghostty-ambient --start --freq 1m # Start with custom interval
|
|
83
|
+
ghostty-ambient --stop # Stop daemon
|
|
84
|
+
ghostty-ambient --restart # Restart daemon
|
|
85
|
+
ghostty-ambient --logs # Tail daemon logs
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Run Daemon Inline
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
ghostty-ambient --daemon # Run daemon in foreground
|
|
92
|
+
ghostty-ambient --daemon --interval 30s # Custom interval
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## How It Works
|
|
96
|
+
|
|
97
|
+
### Bayesian Preference Learning
|
|
98
|
+
|
|
99
|
+
The system learns three key properties of your theme preferences:
|
|
100
|
+
|
|
101
|
+
| Property | What It Learns |
|
|
102
|
+
|----------|----------------|
|
|
103
|
+
| **Background L** | Light vs dark theme preference (LAB lightness) |
|
|
104
|
+
| **Contrast** | Preferred difference between background and foreground |
|
|
105
|
+
| **Chroma** | Preferred color saturation in the palette |
|
|
106
|
+
|
|
107
|
+
These are learned per-context:
|
|
108
|
+
- Time of day (morning, afternoon, evening, night)
|
|
109
|
+
- Ambient light (dim, office, bright, daylight)
|
|
110
|
+
- System appearance (light mode, dark mode)
|
|
111
|
+
- Power source (AC, battery)
|
|
112
|
+
|
|
113
|
+
### View Your Learned Preferences
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
ghostty-ambient --stats
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
```
|
|
120
|
+
By Time of Day
|
|
121
|
+
╭───────────┬───────┬────┬──────────┬────────┬─────╮
|
|
122
|
+
│ │ Theme │ L │ Contrast │ Chroma │ n │
|
|
123
|
+
├───────────┼───────┼────┼──────────┼────────┼─────┤
|
|
124
|
+
│ Morning │ light │ 97 │ 84 │ 49 │ 124 │
|
|
125
|
+
│ Afternoon │ light │ 97 │ 86 │ 50 │ 121 │
|
|
126
|
+
╰───────────┴───────┴────┴──────────┴────────┴─────╯
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Portable Profiles
|
|
130
|
+
|
|
131
|
+
Export your learned preferences:
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
ghostty-ambient --export-profile ~/my-prefs.json
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Import on another device:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
ghostty-ambient --import-profile ~/my-prefs.json
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
## Platform Support
|
|
144
|
+
|
|
145
|
+
| Platform | Ambient Light Sensor | Theme Detection |
|
|
146
|
+
|----------|---------------------|-----------------|
|
|
147
|
+
| macOS | Native (via `als` helper) | Full support |
|
|
148
|
+
| Linux | Via `iio-sensor-proxy` | Full support |
|
|
149
|
+
| Windows | Via Windows SDK | Partial support |
|
|
150
|
+
|
|
151
|
+
### macOS Ambient Light Sensor
|
|
152
|
+
|
|
153
|
+
The bundled `als` binary reads the ambient light sensor. To compile from source:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
clang -framework IOKit -framework CoreFoundation als.m -o als
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Daemon Management
|
|
160
|
+
|
|
161
|
+
The install script sets up a background daemon that learns your preferences. Use these commands to manage it:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
ghostty-ambient --status # Check if daemon is running
|
|
165
|
+
ghostty-ambient --start # Start the daemon (default 5m interval)
|
|
166
|
+
ghostty-ambient --start --freq 30s # Start with custom interval
|
|
167
|
+
ghostty-ambient --stop # Stop the daemon
|
|
168
|
+
ghostty-ambient --restart # Restart the daemon
|
|
169
|
+
ghostty-ambient --logs # Tail daemon logs (Ctrl+C to exit)
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
## Uninstall
|
|
173
|
+
|
|
174
|
+
```bash
|
|
175
|
+
curl -fsSL https://raw.githubusercontent.com/gezibash/ghostty-ambient/main/uninstall.sh | bash
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
Your learned preferences are preserved in `~/.config/ghostty-ambient/`.
|
|
179
|
+
|
|
180
|
+
## Development
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
# Clone and install dev dependencies
|
|
184
|
+
git clone https://github.com/gezibash/ghostty-ambient
|
|
185
|
+
cd ghostty-ambient
|
|
186
|
+
uv sync --all-extras
|
|
187
|
+
|
|
188
|
+
# Run tests
|
|
189
|
+
uv run pytest
|
|
190
|
+
|
|
191
|
+
# Run with verbose output
|
|
192
|
+
uv run ghostty-ambient --daemon --interval 30s
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
## License
|
|
196
|
+
|
|
197
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "ghostty-ambient"
|
|
3
|
+
version = "0.6.0"
|
|
4
|
+
description = "Ambient light-aware Ghostty theme selector with Bayesian preference learning"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.12"
|
|
7
|
+
authors = [{ name = "Gezim Basha" }]
|
|
8
|
+
license = "MIT"
|
|
9
|
+
keywords = ["ghostty", "terminal", "theme", "ambient", "bayesian"]
|
|
10
|
+
classifiers = [
|
|
11
|
+
"Development Status :: 4 - Beta",
|
|
12
|
+
"Environment :: Console",
|
|
13
|
+
"Intended Audience :: Developers",
|
|
14
|
+
"Operating System :: MacOS",
|
|
15
|
+
"Operating System :: POSIX :: Linux",
|
|
16
|
+
"Programming Language :: Python :: 3.12",
|
|
17
|
+
"Programming Language :: Python :: 3.13",
|
|
18
|
+
"Topic :: Terminals :: Terminal Emulators/X Terminals",
|
|
19
|
+
]
|
|
20
|
+
dependencies = [
|
|
21
|
+
"simple-term-menu>=1.6.0",
|
|
22
|
+
"rich>=13.0.0",
|
|
23
|
+
"numpy>=1.26.0",
|
|
24
|
+
"readchar>=4.0.0",
|
|
25
|
+
]
|
|
26
|
+
|
|
27
|
+
[project.urls]
|
|
28
|
+
Homepage = "https://github.com/gezibash/ghostty-ambient"
|
|
29
|
+
Repository = "https://github.com/gezibash/ghostty-ambient"
|
|
30
|
+
Issues = "https://github.com/gezibash/ghostty-ambient/issues"
|
|
31
|
+
|
|
32
|
+
[project.optional-dependencies]
|
|
33
|
+
windows = ["winsdk>=1.0.0b10"]
|
|
34
|
+
dev = [
|
|
35
|
+
"pytest>=8.0.0",
|
|
36
|
+
"pytest-cov>=4.0.0",
|
|
37
|
+
"freezegun>=1.2.0",
|
|
38
|
+
]
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
ghostty-ambient = "ghostty_ambient.cli:main"
|
|
42
|
+
|
|
43
|
+
# Plugin entry point for third-party sensor backends
|
|
44
|
+
# Example: A custom sensor plugin can register via:
|
|
45
|
+
# [project.entry-points."ghostty_ambient.sensors"]
|
|
46
|
+
# my_sensor = "my_package.sensors:MySensorBackend"
|
|
47
|
+
[project.entry-points."ghostty_ambient.sensors"]
|
|
48
|
+
|
|
49
|
+
[build-system]
|
|
50
|
+
requires = ["uv_build>=0.9.2,<0.10.0"]
|
|
51
|
+
build-backend = "uv_build"
|
|
52
|
+
|
|
53
|
+
[tool.uv]
|
|
54
|
+
package = true
|
|
55
|
+
|
|
56
|
+
[tool.pytest.ini_options]
|
|
57
|
+
testpaths = ["tests"]
|
|
58
|
+
python_files = ["test_*.py"]
|
|
59
|
+
python_functions = ["test_*"]
|
|
60
|
+
addopts = "-v --tb=short"
|
|
61
|
+
|
|
62
|
+
[tool.coverage.run]
|
|
63
|
+
source = ["src/ghostty_ambient"]
|
|
64
|
+
omit = ["src/ghostty_ambient/cli.py", "src/ghostty_ambient/daemon.py", "src/ghostty_ambient/picker.py", "src/ghostty_ambient/browser.py"]
|
|
65
|
+
|
|
66
|
+
[tool.coverage.report]
|
|
67
|
+
exclude_lines = [
|
|
68
|
+
"pragma: no cover",
|
|
69
|
+
"if TYPE_CHECKING:",
|
|
70
|
+
"raise NotImplementedError",
|
|
71
|
+
]
|
|
72
|
+
|
|
73
|
+
[dependency-groups]
|
|
74
|
+
dev = [
|
|
75
|
+
"pytest>=9.0.2",
|
|
76
|
+
"ruff>=0.8.0",
|
|
77
|
+
"pre-commit>=4.0.0",
|
|
78
|
+
"gitlint>=0.19.0",
|
|
79
|
+
]
|
|
80
|
+
release = [
|
|
81
|
+
"python-semantic-release>=9.0.0",
|
|
82
|
+
]
|
|
83
|
+
|
|
84
|
+
[tool.ruff]
|
|
85
|
+
target-version = "py312"
|
|
86
|
+
line-length = 120
|
|
87
|
+
src = ["src", "tests"]
|
|
88
|
+
|
|
89
|
+
[tool.ruff.lint]
|
|
90
|
+
select = [
|
|
91
|
+
"E", # pycodestyle errors
|
|
92
|
+
"W", # pycodestyle warnings
|
|
93
|
+
"F", # pyflakes
|
|
94
|
+
"I", # isort
|
|
95
|
+
"B", # flake8-bugbear
|
|
96
|
+
"C4", # flake8-comprehensions
|
|
97
|
+
"UP", # pyupgrade
|
|
98
|
+
"SIM", # flake8-simplify
|
|
99
|
+
]
|
|
100
|
+
ignore = [
|
|
101
|
+
"E501", # line too long (handled by formatter)
|
|
102
|
+
"SIM108", # ternary operators often less readable
|
|
103
|
+
"SIM105", # contextlib.suppress often less clear
|
|
104
|
+
"SIM102", # nested if often clearer than combined
|
|
105
|
+
]
|
|
106
|
+
|
|
107
|
+
[tool.ruff.format]
|
|
108
|
+
quote-style = "double"
|
|
109
|
+
indent-style = "space"
|
|
110
|
+
|
|
111
|
+
[tool.semantic_release]
|
|
112
|
+
version_toml = ["pyproject.toml:project.version"]
|
|
113
|
+
tag_format = "v{version}"
|
|
114
|
+
branch = "main"
|
|
115
|
+
commit_message = "chore(release): v{version}"
|
|
116
|
+
|
|
117
|
+
[tool.semantic_release.changelog.default_templates]
|
|
118
|
+
changelog_file = "CHANGELOG.md"
|
|
119
|
+
|
|
120
|
+
[tool.semantic_release.commit_parser_options]
|
|
121
|
+
allowed_tags = ["feat", "fix", "docs", "style", "refactor", "perf", "test", "build", "ci", "chore"]
|
|
122
|
+
minor_tags = ["feat"]
|
|
123
|
+
patch_tags = ["fix", "perf"]
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"""ghostty-ambient library modules."""
|
|
2
|
+
|
|
3
|
+
from .adaptive_scorer import score_themes_adaptive as score_themes
|
|
4
|
+
from .history import History
|
|
5
|
+
from .sensor import get_lux, get_sun_phase, get_sun_times, lux_to_condition
|
|
6
|
+
from .themes import calculate_brightness, load_all_themes, parse_theme
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"get_lux",
|
|
10
|
+
"get_sun_times",
|
|
11
|
+
"lux_to_condition",
|
|
12
|
+
"get_sun_phase",
|
|
13
|
+
"load_all_themes",
|
|
14
|
+
"parse_theme",
|
|
15
|
+
"calculate_brightness",
|
|
16
|
+
"History",
|
|
17
|
+
"score_themes",
|
|
18
|
+
]
|