launch-bar-0.1.2 is not a library.
launch-bar
Context-aware command launcher with icon buttons for developers.
Features
- Auto-detection: Detects project type by file presence (Cargo.toml, package.json, etc.)
- Preset system: Configurable command sets per project type with custom colors
- Preset switching: Hot-switch presets from title bar without restart
- Scripting: Rhai and Lua scripting support for advanced automation
- Visual feedback: Process status indicators (running/success/failed)
- File watcher: Highlights when files in the working directory change
- Position memory: Remembers window position per directory
- Clipboard support: Use
$clipboardvariable in commands - Transparent UI: Semi-transparent window with customizable opacity
Installation
Usage
# Run in current directory (auto-detects project type)
# Use specific preset
# Create local config in current directory
# Create/reset global config
Configuration
Configuration files are loaded in this order:
./launch-bar.toml(local, highest priority)~/.config/launch-bar/config.toml(global)
Example config
[]
= 5 # Maximum icons to display
= 0.8 # Background opacity (0.0 - 1.0)
= "auto" # "auto", "show", "hide"
= "auto" # "auto" (hover), "show", "hide"
= "auto" # "auto" (highlight on change/hover), "show", "hide"
# default_script = "rhai" # Global default script type: "rhai" or "lua"
[[]]
= "RustDev"
= "Cargo.toml"
= "#FF7043"
= [
{ = "Run", = "cargo run", = "play" },
{ = "Test", = "cargo test", = "check" },
{ = "Build", = "cargo build --release", = "wrench" },
{ = "Clean", = "cargo clean", = "broom" },
{ = "Fmt", = "cargo fmt", = "edit" },
]
[[]]
= "NodeDev"
= "package.json"
= "#66BB6A"
= [
{ = "Start", = "npm start", = "play" },
{ = "Test", = "npm test", = "check" },
{ = "Build", = "npm run build", = "wrench" },
]
Preset options
| Field | Description |
|---|---|
name |
Preset identifier |
detect_file |
Auto-detect by file presence |
cwd_pattern |
Auto-detect by path pattern (supports * suffix) |
base_color |
Hex color for accent line |
default_script |
Default script type for this preset (rhai or lua) |
commands |
List of command configurations |
Command options
| Field | Description |
|---|---|
name |
Display name |
cmd |
Shell command to execute (supports $clipboard) |
run |
Script to execute (Rhai or Lua) |
script_type |
Force script type: rhai or lua |
icon |
Icon name (see available icons below) |
cwd |
Working directory override |
Scripting
Commands can use run instead of cmd to execute scripts. Both Rhai and Lua are supported.
Script type resolution
Script type is determined in this order:
- Explicit
script_typeon the command - File extension for
@pathreferences (.rhaior.lua) - Preset's
default_script - Window's
default_script(global) - Fallback:
rhai
Example
[]
= "lua" # Global default
[[]]
= "Scripts"
= "rhai" # Preset default
= [
# Inline script (uses preset default = rhai)
{ = "Greet", = "notify(\"Hello!\")", = "info" },
# Script from file (type detected by .lua extension)
{ = "Build", = "@scripts/build.lua", = "wrench" },
# Explicit script type
{ = "Test", = "shell('cargo test')", = "lua", = "check" },
]
Available functions
| Function | Description |
|---|---|
clipboard() |
Get clipboard text |
clipboard_set(text) |
Set clipboard text |
shell(cmd) |
Run command and return output |
shell_spawn(cmd) |
Run command in background |
claude(prompt) |
Call Claude CLI with prompt |
notify(message) |
Show system notification |
open(path) |
Open file/URL with system default |
env(name) |
Get environment variable |
read_file(path) |
Read file contents |
write_file(path, content) |
Write to file |
Available icons
play, check, wrench, broom, edit, trash, gear, bug, refresh, folder, file, plus, minus, x, search, copy, download, upload, eye, fire, lock, unlock, info, warning, stop, pause, home, user, terminal, code, package
Window controls
Hover over the top area to reveal the title bar:
- Preset switch (🔄 icon): Cycle through available presets
- Settings (gear icon): Open config file
- Corner (corners icon): Move to bottom-right corner / Return to original position
- Minimize (minus icon): Minimize window
- Close (x icon): Close application
License
MIT