Catfood Bar =,=

A customizable system status bar built with Rust and extensible with Lua. Part of the catfood utility suite.
Features
- Modular Components: Choose from 13+ built-in components or create custom Lua components
- Live Configuration: Hot-reload config changes without restarting
- Sparkline Visualization: Real-time usage graphs for system metrics
- Multi-Bar Layout: Left, middle, and right bar sections
- Color Support: Optional colorize mode (TODO: Configurable color themes)
- Error Handling: Graceful error display and logging
Installation
Dependencies
- Rust 1.70+
- Hyprland
- NetworkManager
- lm-sensors (for component temperatures)
- kitty terminal (makes use of
kitten panelto render the bar)
[!NOTE] You may wish to try using catfood without the Kitty terminal emulator. Functionality is not guaranteed in this case, but you are free to experiment using the
--no-kittencommand line flag.
From crates.io
# Install the bar component
From Source
# Build and install
# Or build and run locally
Usage
Run the system bar:
When run through the main catfood CLI, it automatically spawns in a kitty panel:
# Top of screen (default)
For other purposes, you can still run the catfood-bar binary independently:
# Bottom of screen
Configuration
Configuration is stored in ~/.config/catfood/bar.json. The first run creates a default config with all components enabled.
Basic Configuration
Component Types
Components can be specified as either strings or objects with additional options:
String Components
Object Components with Options
Available Components
System Monitoring
workspaces- Hyprland workspace switchingwindows- Window management infocpu- CPU usage percentage (supports sparkline)ram- Memory usage percentage (supports sparkline)temperature- CPU temperaturebattery- Battery status and percentage
Network
wifi- WiFi connection status and signal strength (supports sparkline)weather- Current weather information
Audio & Display
volume- System volume levelbrightness- Screen brightness
Time & Date
time- Current date and time
Layout Components
separator- Visual separator (" | ")space- Single space character for fine spacing
Sparkline Components
The following components support sparkline visualization:
cpu- Real-time CPU usage graphram- Memory usage over timewifi- WiFi signal strength history
Sparkline Options
sparkline(default: false) - Enable sparkline modesparkline_length(default: 10) - Graph width in characterssparkline_update_freq(default: varies) - Update frequency in seconds- CPU: 3 seconds
- RAM: 2 seconds
- WiFi: 2 seconds
sparkline_logarithmic(default: false) - Use logarithmic scaling
Custom Lua Components
Create custom components in ~/.config/catfood/components/*.lua:
Component Structure
Each Lua component should return a table with the following structure:
return
Available Colors
Lua components can use the following color names:
red,green,yellow,blue,magenta,cyan,white,blackgray/grey,dark_red,dark_green,dark_yellow,dark_blue,dark_magenta,dark_cyan,dark_gray
![NOTE] Color support is a work in progress. Not all of these colors may work. In future, user-defined colors may be supported along with fallback values for more restricted terminal color-spaces.
Example Components
Simple Clock Component
return
System Uptime Component
return
Installation
-
Create the components directory:
-
Add your Lua component files (
.luaextension) -
Reference them in
config.jsonby filename (without extension) -
Restart catfood_bar or wait for automatic config reload
Error Handling
- If a Lua component fails to load or has errors, it will display as
❌ component_name - Built-in components are unaffected by Lua component failures
- Check application logs for detailed error information
Limitations
- Lua components run in the same process as the main application
- Long-running operations in
update()may affect UI responsiveness - No direct file system or network access beyond standard Lua libraries (can be extended if needed)
- Component state is not persisted across restarts
Configuration Examples
Minimal Setup
System Monitoring Focus
Compact Layout
Advanced Configuration
Component Reference
Special Components
kitty_tabs - Kitty terminal tabs with program icons
- Requires
kitty --single-instanceflag for proper detection - Active tab: Shows full tab title (up to 20 chars)
- Inactive tabs: Shows program icons only for compact display
- Supports nvim, vim, htop, btop, git, ssh, cargo, and more
- Custom socket path configuration available:
separator - Visual separator (" | ") space - Single space character for fine spacing
Sparkline Configuration
The cpu, ram, and wifi components support sparkline mode with these options:
sparkline(default: false) - Enable sparkline modesparkline_length(default: 10) - Graph width in characterssparkline_update_freq(default: varies) - Update frequency in secondssparkline_logarithmic(default: varies by component) - Use logarithmic scaling
Sparkline Scaling
Linear Scaling (default for CPU/RAM)
- Equal percentage changes have equal visual impact
- Best for bounded ranges like percentages
Logarithmic Scaling (default for WiFi)
- Equal ratio changes have equal visual impact
- Best for data with high dynamic range (network traffic)
- Small values remain visible when large values are present
Scaling Examples
// CPU with linear scaling (default)
// WiFi with logarithmic scaling (default)
// Override: CPU with logarithmic scaling
// Override: WiFi with linear scaling
Additional Configuration Examples
Network Focus
Terminal Workflow Focus
Full System Monitoring with Sparklines
Mixed Traditional and Sparkline Display
Custom Grouping
Fine-tuned Spacing
Minimal with Custom Spacing
Hot-Reload
Configuration changes are applied automatically:
- Edit
~/.config/catfood/bar.json - Save the file
- Changes appear instantly without restarting
Logging
Errors are logged to ~/.local/share/catfood/logs/bar.log:
2025-12-21T03:45:12Z [ERROR] [COMPONENT_WORKSPACES] Error: Failed to get workspaces
2025-12-21T03:45:13Z [ERROR] [CONFIG] Failed to reload configuration: ...
The log maintains the last 1000 lines.
License
Copyright (c) Thom Bruce thom@thombruce.com
Licensed under the MIT license.