Skip to content

cumulus13/showit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

showit

Bring any Windows window to the foreground by searching its title — fast, coloured, interactive.

CI crates.io License: MIT


Features

  • Substring / wildcard / regex search — plain text, */? globs, or full regex with -r
  • Vivid hex-colour output — each title gets its own colour from a configurable palette; the matched portion is highlighted
  • Interactive REPL — after results appear, type a number to focus, [n]c to close, or any text to search again
  • Config fileconfig.toml lets you set any colour in the palette, the index colour, match highlight, errors, success messages
  • Single static binary — no runtime dependencies; ships as a native Windows .exe

Installation

From crates.io

cargo install showit

From source

git clone https://github.com/cumulus13/showit
cd showit
cargo build --release
# binary at: target/release/showit.exe

Usage

showit [OPTIONS] [PATTERN]
Argument / Flag Description
PATTERN Title to search (substring by default)
-r, --regex Treat PATTERN as a regular expression
-l, --list List all visible windows
--config-path Print the path to the config file
--init-config Write a default config file (won't overwrite)
-h, --help Print help
-V, --version Print version

Examples

# Substring match (case-insensitive)
showit firefox

# Wildcard — any window whose title starts with "Visual"
showit "Visual*"

# Regex — windows containing "term" or "bash"
showit -r "term|bash"

# List every visible window
showit --list

Interactive commands

After results are displayed:

Input Effect
3 Bring window #3 to the front
2c Close window #2 (sends WM_CLOSE)
notepad Start a new search for "notepad"
x / q Quit

Configuration

Run showit --init-config to create a starter config, then open it:

showit --config-path   # prints the path

Windows: %APPDATA%\showit\config.toml
Linux/macOS: ~/.config/showit/config.toml

Example config.toml

# showit configuration file
# Colors must be valid hex strings: "#RRGGBB" or "#RGB"

# Palette cycled through for each window title in the list
colors = [
    "#00FFFF",   # Cyan
    "#FF6B6B",   # Coral red
    "#FFD700",   # Gold
    "#7CFC00",   # Lawn green
    "#FF69B4",   # Hot pink
    "#00CED1",   # Dark turquoise
    "#FFA500",   # Orange
    "#DA70D6",   # Orchid
    "#ADFF2F",   # Green-yellow
    "#1E90FF",   # Dodger blue
    "#FF4500",   # Orange-red
    "#98FB98",   # Pale green
]

# Color for the index numbers (e.g.  1.  2.  3.)
index_color   = "#888888"

# Color for the prompt line
prompt_color  = "#00BFFF"

# Color used to highlight the matched portion inside a title
match_color   = "#FFFF00"

# Color for error messages
error_color   = "#FF4444"

# Color for success messages (focused / closed confirmations)
success_color = "#44FF88"

Architecture

src/
├── main.rs        — CLI args (clap), interactive REPL, command dispatch
├── config.rs      — Config struct, TOML load/write, hex-color parsing
├── display.rs     — Coloured output helpers (colorize, highlight_match, …)
├── search.rs      — Substring / wildcard / regex filtering
└── windows_api.rs — Win32 EnumWindows, SetForegroundWindow, PostMessage(WM_CLOSE)
                     (non-Windows stub for CI)

Development

cargo build          # debug build (cross-compiles on Linux for testing)
cargo test           # 12 unit tests, all platform-safe
cargo clippy         # lints
cargo build --release --target x86_64-pc-windows-msvc   # final Windows binary

License

MIT — see LICENSE.


👤 Author

Hadi Cahyadi

Buy Me a Coffee

Donate via Ko-fi

Support me on Patreon

About

Bring any Windows window to the foreground by searching its title — fast, coloured, interactive.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages