# Install termbg with Homebrew, dnf, Nix

Rust library for terminal background color detection. Version 0.6.2 via Homebrew; verified from local package data. Also installable with nix: nix profile install nixpkgs#termbg.

## Install

```sh
sudo av install brew:termbg
```

Additional install commands:

### macOS

- Homebrew (100%):

```sh
brew install termbg
```

  Evidence: local Homebrew formula metadata

### Linux

- dnf (92%):

```sh
sudo dnf install termbg
```

  Evidence: Fedora Rawhide package metadata: termbg from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#termbg
```

  Evidence: nixpkgs package indexes: pkgs/by-name/te/termbg/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## Package facts

- **Package key:** brew:termbg
- **Package manager:** Homebrew
- **Version:** 0.6.2
- **Source summary:** Rust library for terminal background color detection
- **Homepage:** <https://github.com/dalance/termbg>
- **Repository:** <https://github.com/dalance/termbg>
- **Generated:** 2026-08-03T19:37:03+00:00

## Executables

- termbg (alias)

## Install behavior

- Bottle: not available

## Freshness

- Page generated: 2026-08-03
- Package-manager version: 0.6.2
## Project history and usage

termbg is a Rust library and small check program for detecting a terminal's background color. The README says it reports either RGB values or a dark/light theme.

### Project history

The GitHub repository was created in November 2020, and its v0.1.0 tag points to the initial repository work from the same day. The project has remained a focused terminal-behavior utility rather than a broad terminal UI framework.

### Adoption history

termbg is published as a Rust crate and appears in package-manager metadata for Homebrew, dnf, and Nix. Its README badges link crates.io and docs.rs, and its Homebrew formula exposes the included `termbg` executable for checking terminal behavior from the command line.

### How it is used

Rust programs depend on the crate and call functions such as `terminal`, `rgb`, and `theme` with a timeout. The README also documents an example check program that prints the terminal type, detected RGB value, and dark/light theme.

### Why package nerds care

termbg is useful in the terminal-tooling niche because theme-aware CLIs often need to know whether the background is dark or light. Its README documents support and non-support across many terminals, which gives package maintainers and CLI authors a compact compatibility reference.

### Timeline

- 2020-11-09: GitHub repository created and v0.1.0 tag commit dated.
- 2024-11-15: v0.6.1 tag commit dated.
- 2025-01-06: v0.6.2 tag commit dated.

### Related projects

- The README's compatibility list includes Alacritty, GNOME Terminal, GNU Screen, kitty, iTerm2, macOS Terminal, mintty, tmux, Visual Studio Code, xterm, Win32 console, and several unsupported terminals such as Cmder, ConEmu, PuTTY, QTerminal, and Windows Terminal.

### Sources

- <https://api.github.com/repos/dalance/termbg>
- <https://api.github.com/repos/dalance/termbg/commits/ebd895a0349367115b618a2a1c919c4a35870324>
- <https://api.github.com/repos/dalance/termbg/tags>
- <https://github.com/dalance/termbg#readme>
- source_facts.package-manager


## Security Notes

library-like package without higher-risk signals.

- **Geiger risk:** green / low
- library-like package without higher-risk signals

## Other Package-Manager Records

- Nix - termbg: normalized package name match | nixpkgs package indexes: pkgs/by-name/te/termbg/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- dnf - termbg - 0.6.2-5.fc45: normalized package name match | Fedora Rawhide package metadata: termbg from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Terminal background color detection | https://crates.io/crates/termbg


## Combined YAML source

View the package source record on GitHub. [combined/termbg.yml](https://github.com/mxcl/pkgdb/blob/main/combined/termbg.yml)


## Sources

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
