Skip to content

vim-zz/something_bg

Repository files navigation

Something In The Background

A native menu bar utility for managing background processes, SSH tunnels, and scheduled tasks.

Menu Bar Screenshot

Features

  • Tiny native macOS app with a Rust core (less than 1MB)
  • Run any script or CLI task without keeping a terminal open
  • Fire-and-forget one-time commands (silent, with notification, or in a terminal)
  • Auto-discover scripts from a directory
  • Run scripts on a schedule without cron, or launchd
  • Controlled from the menu bar
  • Cross-platform support (macOS, Linux, Windows)
  • Everything is configured with one simple config file

Installation

macOS

Step 1: Install Rust (skip if already installed)

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env

Step 2: Install build tools

xcode-select --install
cargo install cargo-bundle

Step 3: Build and install

git clone https://github.com/vim-zz/something_bg.git
cd something_bg
./scripts/bundle-macos.sh
cp -r "target/release/bundle/osx/Something in the Background.app" /Applications/

Launch from Applications or run: open "/Applications/Something in the Background.app"

Linux

Prerequisites (Ubuntu/Debian):

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source $HOME/.cargo/env
sudo apt install libayatana-appindicator3-dev libgtk-3-dev

Build and run:

git clone https://github.com/vim-zz/something_bg.git
cd something_bg
cargo run -p something_bg_linux --release

Windows

Build on Windows:

# Install Rust from https://rustup.rs/
git clone https://github.com/vim-zz/something_bg.git
cd something_bg
cargo build -p something_bg_windows --release
.\target\release\something_bg_windows.exe

Configuration

Configuration is stored in ~/.config/something_bg/config.toml (created on first run).

Example

path = "/bin:/usr/bin:/usr/local/bin:/opt/homebrew/bin"

# Optional: auto-discover .sh scripts from this directory
scripts_dir = "~/.config/something_bg/scripts"

[tunnels]

# SSH tunnel with port forwarding
[tunnels.database-prod]
name = "PROD"
command = "ssh"
args = ["-N", "-L", "5432:localhost:5432", "user@server.com"]
kill_command = "pkill"
kill_args = ["-f", "user@server.com"]
group_header = "DATABASE"
group_icon = "sf:cylinder.fill"

# Port forwarding
[tunnels.k8s-service]
name = "API Service"
command = "kubectl"
args = ["port-forward", "svc/api", "8080:8080"]
kill_command = "pkill"
kill_args = ["-f", "svc/api"]
group_header = "KUBERNETES"
separator_after = true

# One-time commands (fire-and-forget)
[commands.fix-quarantine]
name = "Fix Whisperer Quarantine"
command = "xattr"
args = ["-dr", "com.apple.quarantine", "/Applications/whisperer.app"]
group_header = "PERSONAL"
group_icon = "sf:person.fill"

[commands.deploy]
name = "Deploy"
command = "bash"
args = ["/Users/me/scripts/deploy.sh"]
output = "terminal"                 # Opens in Terminal.app
separator_after = true

# Scheduled tasks
[schedules.daily-backup]
name = "Daily Backup"
command = "/usr/local/bin/backup.sh"
args = []
cron_schedule = "0 6 * * *"
group_header = "SCHEDULED"
group_icon = "sf:clock.fill"

Fields

Tunnels (toggleable services):

  • name — Display name
  • command, args — Start command
  • kill_command, kill_args — Stop command
  • group_header (optional) — Section title
  • group_icon (optional) — SF Symbol (e.g., sf:cylinder.fill)
  • separator_after (optional) — Add separator

For Commands:

  • name: Display name in the menu
  • command + args: Command to execute
  • output: Output mode — "silent" (default), "notify", or "terminal" (see below)

For Scheduled Tasks:

  • name: Display name in the menu
  • command + args: Command to execute
  • cron_schedule: Cron expression for scheduling (e.g., "0 6 * * *")

Optional fields (all types):

  • group_header: Section title (e.g., "DATABASE", "SCHEDULED TASKS")
  • group_icon: SF Symbol name for the header (e.g., "sf:cylinder.fill", "sf:clock.fill")
  • separator_after: Add a visual separator line after this item

One-Time Commands

Run any command with a single click from the menu bar. Each command has a configurable output mode:

Mode Behavior Best for
silent (default) Fire and forget, no output Instant commands (xattr, pkill)
notify Run in background, show notification on completion with last 5 lines of output Scripts that take seconds to minutes
terminal Open a terminal window with live output Long/interactive scripts, debugging
[commands.fix-quarantine]
name = "Fix Quarantine"
command = "xattr"
args = ["-dr", "com.apple.quarantine", "/Applications/myapp.app"]
# output defaults to "silent"

[commands.backup]
name = "Run Backup"
command = "bash"
args = ["/usr/local/bin/backup.sh"]
output = "notify"                    # Shows notification when done

[commands.deploy]
name = "Deploy"
command = "bash"
args = ["/usr/local/bin/deploy.sh"]
output = "terminal"                  # Opens in Terminal.app

Scripts Directory

Auto-discover shell scripts from a directory. All *.sh files appear in the menu under a "Scripts" header, sorted alphabetically. Default output mode is notify.

scripts_dir = "~/.config/something_bg/scripts"

Filenames are title-cased for display: delete-logs.sh → "Delete Logs".

Scheduled Tasks

Common cron patterns:

  • 0 * * * * — Every hour
  • */15 * * * * — Every 15 minutes
  • 0 6 * * * — Daily at 6am
  • 0 9 * * 1 — Mondays at 9am

SF Symbols (macOS icons)

Common symbols for group_icon:

  • sf:cylinder.fill — Database
  • sf:shippingbox.fill — Cache/Redis
  • sf:cloud.fill — Cloud/Kubernetes
  • sf:server.rack — Server
  • sf:network — Network
  • sf:clock.fill — Scheduled tasks
  • sf:hammer.fill — Development

Browse all symbols at developer.apple.com/sf-symbols or use the SF Symbols app.

Restart the app after editing the config.

License

MIT

About

A lightweight native macOS utility for running scripts and commands in the background

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors