formalconf 2.0.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 +280 -0
- package/dist/formalconf.js +2339 -0
- package/package.json +53 -0
package/README.md
ADDED
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
# FormalConf
|
|
2
|
+
|
|
3
|
+
A comprehensive dotfiles management system for macOS that combines configuration management, package synchronization, and theme switching in one unified interface.
|
|
4
|
+
|
|
5
|
+
 
|
|
6
|
+
|
|
7
|
+
## ✨ Features
|
|
8
|
+
|
|
9
|
+
- **📦 Configuration Management**: Automated dotfile linking using GNU Stow
|
|
10
|
+
- **🔄 Package Synchronization**: Intelligent Homebrew package management with purge capabilities
|
|
11
|
+
- **🎨 Theme System**: Easy switching between visual themes across all applications
|
|
12
|
+
- **🖥️ Interactive TUI**: Beautiful terminal interface for easy management
|
|
13
|
+
- **⚡ Smart Adoption**: Import existing configurations seamlessly
|
|
14
|
+
|
|
15
|
+
## 🚀 Quick Start
|
|
16
|
+
|
|
17
|
+
1. **Clone and Navigate**
|
|
18
|
+
```bash
|
|
19
|
+
git clone <your-repo-url> ~/.dotfiles
|
|
20
|
+
cd ~/.dotfiles
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
2. **Install Dependencies**
|
|
24
|
+
```bash
|
|
25
|
+
brew install stow jq mas
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3. **Launch FormalConf**
|
|
29
|
+
```bash
|
|
30
|
+
./formalconf.sh
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 📁 Project Structure
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
formalconf/
|
|
37
|
+
├── formalconf.sh # Main TUI interface
|
|
38
|
+
├── config-manager.sh # Dotfile management with GNU Stow
|
|
39
|
+
├── pkg-sync.sh # Package synchronization engine
|
|
40
|
+
├── set-theme.sh # Theme switching utility
|
|
41
|
+
├── pkg-config.json # Package configuration
|
|
42
|
+
├── configs/ # Dotfile packages
|
|
43
|
+
│ ├── aerospace/ # Window manager config
|
|
44
|
+
│ ├── btop/ # System monitor config
|
|
45
|
+
│ ├── fish/ # Shell configuration
|
|
46
|
+
│ ├── ghostty/ # Terminal emulator config
|
|
47
|
+
│ ├── neovim/ # Editor configuration
|
|
48
|
+
│ └── tmux/ # Terminal multiplexer config
|
|
49
|
+
└── themes/ # Visual themes
|
|
50
|
+
├── tokyo-night/ # Dark theme
|
|
51
|
+
└── matte-black/ # Black theme
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## 🔧 Usage
|
|
55
|
+
|
|
56
|
+
### Interactive Mode
|
|
57
|
+
|
|
58
|
+
Launch the main interface:
|
|
59
|
+
```bash
|
|
60
|
+
./formalconf.sh
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Navigate through the menu options:
|
|
64
|
+
- **Config Manager**: Manage dotfile linking
|
|
65
|
+
- **Package Sync**: Install/update packages
|
|
66
|
+
- **Set Theme**: Switch visual themes
|
|
67
|
+
|
|
68
|
+
### Command Line Usage
|
|
69
|
+
|
|
70
|
+
#### Configuration Management
|
|
71
|
+
```bash
|
|
72
|
+
# Link all configurations
|
|
73
|
+
./config-manager.sh stow-all
|
|
74
|
+
|
|
75
|
+
# Link specific package
|
|
76
|
+
./config-manager.sh stow neovim
|
|
77
|
+
|
|
78
|
+
# Remove all links
|
|
79
|
+
./config-manager.sh unstow-all
|
|
80
|
+
|
|
81
|
+
# Check status
|
|
82
|
+
./config-manager.sh status
|
|
83
|
+
|
|
84
|
+
# List available packages
|
|
85
|
+
./config-manager.sh list
|
|
86
|
+
|
|
87
|
+
# Adopt existing configs
|
|
88
|
+
./config-manager.sh adopt fish
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
#### Package Synchronization
|
|
92
|
+
```bash
|
|
93
|
+
# Sync packages from config
|
|
94
|
+
./pkg-sync.sh pkg-config.json
|
|
95
|
+
|
|
96
|
+
# Sync with purge (remove unlisted)
|
|
97
|
+
jq '.config.purge = true' pkg-config.json > temp.json && ./pkg-sync.sh temp.json
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
#### Theme Management
|
|
101
|
+
```bash
|
|
102
|
+
# Apply theme
|
|
103
|
+
./set-theme.sh tokyo-night
|
|
104
|
+
|
|
105
|
+
# List available themes
|
|
106
|
+
./set-theme.sh
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## ⚙️ Configuration
|
|
110
|
+
|
|
111
|
+
### Package Configuration (`pkg-config.json`)
|
|
112
|
+
|
|
113
|
+
Define your system packages in JSON format:
|
|
114
|
+
|
|
115
|
+
```json
|
|
116
|
+
{
|
|
117
|
+
"config": {
|
|
118
|
+
"purge": true, // Remove unlisted packages
|
|
119
|
+
"autoUpdate": true // Update Homebrew before sync
|
|
120
|
+
},
|
|
121
|
+
"taps": [ // Homebrew taps
|
|
122
|
+
"oven-sh/bun",
|
|
123
|
+
"nikitabobko/tap"
|
|
124
|
+
],
|
|
125
|
+
"packages": [ // CLI tools
|
|
126
|
+
"neovim",
|
|
127
|
+
"tmux",
|
|
128
|
+
"fish"
|
|
129
|
+
],
|
|
130
|
+
"casks": [ // GUI applications
|
|
131
|
+
"ghostty",
|
|
132
|
+
"raycast",
|
|
133
|
+
"aerospace"
|
|
134
|
+
],
|
|
135
|
+
"mas": { // Mac App Store apps
|
|
136
|
+
"Xcode": 497799835,
|
|
137
|
+
"WhatsApp": 310633997
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Adding New Configurations
|
|
143
|
+
|
|
144
|
+
1. **Create Package Directory**
|
|
145
|
+
```bash
|
|
146
|
+
mkdir -p configs/myapp/.config/myapp
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
2. **Add Configuration Files**
|
|
150
|
+
```bash
|
|
151
|
+
# Place your config files maintaining home directory structure
|
|
152
|
+
configs/myapp/.config/myapp/config.toml
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
3. **Link Configuration**
|
|
156
|
+
```bash
|
|
157
|
+
./config-manager.sh stow myapp
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### Creating Themes
|
|
161
|
+
|
|
162
|
+
1. **Create Theme Directory**
|
|
163
|
+
```bash
|
|
164
|
+
mkdir themes/my-theme
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
2. **Add Theme Files**
|
|
168
|
+
```bash
|
|
169
|
+
# Add configuration files for each app
|
|
170
|
+
themes/my-theme/ghostty.conf
|
|
171
|
+
themes/my-theme/btop.theme
|
|
172
|
+
themes/my-theme/neovim.lua
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
3. **Apply Theme**
|
|
176
|
+
```bash
|
|
177
|
+
./set-theme.sh my-theme
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## 🛠️ Customization
|
|
181
|
+
|
|
182
|
+
### Supported Applications
|
|
183
|
+
|
|
184
|
+
Current configurations include:
|
|
185
|
+
- **Aerospace**: Tiling window manager
|
|
186
|
+
- **Btop**: System resource monitor
|
|
187
|
+
- **FastFetch**: System information tool
|
|
188
|
+
- **Fish**: Friendly shell
|
|
189
|
+
- **Ghostty**: Fast terminal emulator
|
|
190
|
+
- **Git**: Version control system
|
|
191
|
+
- **Neovim**: Modern Vim-based editor
|
|
192
|
+
- **Tmux**: Terminal multiplexer
|
|
193
|
+
|
|
194
|
+
### Adding New Applications
|
|
195
|
+
|
|
196
|
+
1. **Create the package structure** in `configs/`
|
|
197
|
+
2. **Add theme variants** in `themes/*/`
|
|
198
|
+
3. **Update package lists** in `pkg-config.json`
|
|
199
|
+
|
|
200
|
+
### Configuration Adoption
|
|
201
|
+
|
|
202
|
+
Use the adoption feature to import existing configurations:
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
# This will move your existing config into the repo
|
|
206
|
+
./config-manager.sh adopt fish
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
## 🔍 Advanced Features
|
|
210
|
+
|
|
211
|
+
### Package Management
|
|
212
|
+
|
|
213
|
+
- **Smart Dependencies**: Skips removing packages required by others
|
|
214
|
+
- **System App Protection**: Prevents removal of essential macOS apps
|
|
215
|
+
- **Failure Handling**: Continues operation even if individual packages fail
|
|
216
|
+
- **Cleanup**: Automatically removes orphaned dependencies
|
|
217
|
+
|
|
218
|
+
### Theme System
|
|
219
|
+
|
|
220
|
+
- **Symlink-based**: Instant theme switching without file copying
|
|
221
|
+
- **Application-specific**: Each app can have its own theme configuration
|
|
222
|
+
- **Extensible**: Easy to add new applications and themes
|
|
223
|
+
|
|
224
|
+
### Status Monitoring
|
|
225
|
+
|
|
226
|
+
Get detailed information about your system state:
|
|
227
|
+
- Configuration link status
|
|
228
|
+
- Package installation status
|
|
229
|
+
- Theme application status
|
|
230
|
+
|
|
231
|
+
## 🚨 Troubleshooting
|
|
232
|
+
|
|
233
|
+
### Common Issues
|
|
234
|
+
|
|
235
|
+
**Stow conflicts:**
|
|
236
|
+
```bash
|
|
237
|
+
# Remove conflicting files first
|
|
238
|
+
./config-manager.sh unstow-all
|
|
239
|
+
# Then restow
|
|
240
|
+
./config-manager.sh stow-all
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
**Package sync failures:**
|
|
244
|
+
```bash
|
|
245
|
+
# Update Homebrew
|
|
246
|
+
brew update && brew doctor
|
|
247
|
+
# Retry sync
|
|
248
|
+
./pkg-sync.sh pkg-config.json
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Theme not applying:**
|
|
252
|
+
```bash
|
|
253
|
+
# Check if theme directory exists
|
|
254
|
+
ls themes/
|
|
255
|
+
# Verify theme files
|
|
256
|
+
ls themes/your-theme/
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### Dependencies
|
|
260
|
+
|
|
261
|
+
Required tools:
|
|
262
|
+
- **GNU Stow**: Configuration management
|
|
263
|
+
- **jq**: JSON processing
|
|
264
|
+
- **Homebrew**: Package management
|
|
265
|
+
- **mas**: Mac App Store CLI
|
|
266
|
+
|
|
267
|
+
## 📝 License
|
|
268
|
+
|
|
269
|
+
MIT License - feel free to fork and customize for your own needs.
|
|
270
|
+
|
|
271
|
+
## 🤝 Contributing
|
|
272
|
+
|
|
273
|
+
1. Fork the repository
|
|
274
|
+
2. Create your feature branch
|
|
275
|
+
3. Add your configurations/themes
|
|
276
|
+
4. Submit a pull request
|
|
277
|
+
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
*Built with ❤️ for macOS power users who love automation and consistency.*
|