@coeiro-operator/term-bg
v1.0.1
Published
Terminal background image controller for iTerm2
Downloads
63
Readme
@coeiro-operator/term-bg
Terminal background image controller for iTerm2.
Features
- Set background images in iTerm2 programmatically
- Control opacity and display mode
- Python environment auto-setup with uv
Installation
npm install @coeiro-operator/term-bgThe postinstall script will automatically:
- Check for
uvinstallation - Create a Python virtual environment
- Install required dependencies (iterm2)
Usage
import { TerminalBackground } from '@coeiro-operator/term-bg';
const termBg = new TerminalBackground();
// Check if running in iTerm2
if (termBg.isITerm2()) {
// Set background image
await termBg.setBackground({
imagePath: '/path/to/image.png',
opacity: 0.3, // 30% opacity
mode: 'stretch' // or 'tile', 'fit', 'fill'
});
// Clear background
await termBg.clearBackground();
}Requirements
- Node.js >= 18
- iTerm2 with Python API enabled
- uv (for Python environment management)
iTerm2 Setup
- Open iTerm2 Preferences
- Go to General > Magic
- Enable "Enable Python API"
- Restart iTerm2
Development
# Build TypeScript
npm run build
# Setup Python environment manually
node scripts/setup-python-env.js