formalconf 2.0.8 → 2.0.10

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 CHANGED
@@ -35,6 +35,7 @@
35
35
  - Application-specific theme configs (Ghostty, Btop, Neovim, etc.)
36
36
  - Theme discovery with metadata parsing (author, colors, light/dark mode)
37
37
  - Background support as part of themes
38
+ - **Hook support** for custom scripts on theme change (wallpaper, notifications, etc.)
38
39
 
39
40
  ### **Interactive TUI**
40
41
  - **Beautiful React-based interface** powered by Ink
@@ -86,6 +87,8 @@ FormalConf expects your configuration files in `~/.config/formalconf/`:
86
87
  │ ├── tmux/ # Example: tmux config
87
88
  │ └── ...
88
89
  ├── themes/ # Omarchy-compatible themes
90
+ ├── hooks/ # Event hook scripts
91
+ │ └── theme-change/ # Scripts run after theme changes
89
92
  ├── pkg-config.json # Package sync configuration
90
93
  └── pkg-lock.json # Package version lockfile
91
94
  ```
@@ -127,6 +130,36 @@ Define your packages in `pkg-config.json`:
127
130
 
128
131
  FormalConf supports [Omarchy themes](https://learn.omacom.io/2/the-omarchy-manual/52/themes). Place themes in `~/.config/formalconf/themes/` following the Omarchy theme structure.
129
132
 
133
+ ### Theme Hooks
134
+
135
+ Run custom scripts when a theme is applied. Useful for setting wallpapers, sending notifications, or triggering other theme-dependent actions.
136
+
137
+ **Setup:**
138
+ ```bash
139
+ mkdir -p ~/.config/formalconf/hooks/theme-change
140
+ ```
141
+
142
+ **Example hook** (`~/.config/formalconf/hooks/theme-change/set-wallpaper.sh`):
143
+ ```bash
144
+ #!/bin/bash
145
+ echo "Theme changed to: $FORMALCONF_THEME"
146
+ # Set wallpaper from theme's backgrounds directory
147
+ if [ -d "$FORMALCONF_THEME_DIR/backgrounds" ]; then
148
+ osascript -e "tell application \"Finder\" to set desktop picture to POSIX file \"$FORMALCONF_THEME_DIR/backgrounds/wallpaper.jpg\""
149
+ fi
150
+ ```
151
+
152
+ Make executable: `chmod +x ~/.config/formalconf/hooks/theme-change/set-wallpaper.sh`
153
+
154
+ **Environment variables passed to hooks:**
155
+
156
+ | Variable | Description | Example |
157
+ |----------|-------------|---------|
158
+ | `FORMALCONF_THEME` | Theme name | `nord` |
159
+ | `FORMALCONF_THEME_DIR` | Full theme directory path | `~/.config/formalconf/themes/nord` |
160
+
161
+ Scripts run in alphabetical order. Failed hooks don't prevent theme application.
162
+
130
163
  ---
131
164
 
132
165
  ## Development