A tool to design and run dynamic, customizable dashboards directly inside your terminal.
Project description
🖥 Terminal Widgets
This tool lets you design and run dynamic, customizable dashboards directly inside your terminal.
It combines modular widgets, real-time data updates, and flexible layout management for a highly
interactive CLI experience.
Getting started •
Configuration •
Adding new widgets •
Contributing •
License
🚀 1. Getting started
Installation from PyPI
- Install:
pip install twidgets - Initialize:
twidgets init - Run:
twidgets
⚠️ Requires Python Version 3.10+
Installation from Source
- Clone this repository
- Install dependencies:
pip install -r requirements.txt - Initialize configuration:
python -m twidgets init - Run:
python -m twidgets
⚠️ Requires Python Version 3.10+
For full documentation see Setup Guide
✨ 2. Configuration
2.1 Changing standard colors and configuration in ~/.config/twidgets/base.yaml
If you remove anything or let anything blank, it will just fall back to the standard configuration.
However, you will get warned.
Example:
use_standard_terminal_background: False
background_color:
r: 31 # Red value
g: 29 # Green value
b: 67 # Blue value
...
2.2 Configure your secrets in: ~/.config/twidgets/secrets.env
Example:
WEATHER_API_KEY='your_api_key'
WEATHER_CITY='Berlin,DE'
WEATHER_UNITS='metric'
NEWS_FEED_URL='https://feeds.bbci.co.uk/news/rss.xml?edition=uk'
NEWS_FEED_NAME='BCC'
2.3 Adjust widgets and layouts in: ~/.config/twidgets/widgets/*.yaml
Example:
name: 'clock'
title: ' ⏲ Clock'
enabled: True
interval: 1
height: 5
width: 30
y: 4
x: 87
weekday_format: '%A' # day of the week
date_format: '%d.%m.%Y' # us: '%m.%d.%Y', international: '%Y-%m-%d'
time_format: '%H:%M:%S' # time
For full documentation see Configuration Guide
⭐ 3. Adding new widgets
Adding a new widget to terminal-widgets is very easy—just create two files!
For a simple widget, that does not require heavy loading (no update function)
you only need to define a configuration and a single Python function.
3.1. ⚙️ Define Configuration (.yaml)
Create the configuration file at ~/.config/twidgets/widgets/custom.yaml and set interval = 0 for simple widgets:
name: custom
title: My Custom Widget
enabled: true
interval: 0 # For simple content
height: 7
width: 30
y: 1
x: 1
3.2. 🐍 Write the Widget Logic (.py)
Note: Make sure to name the
.yamland.pyfiles the same way (excluding suffixes)
Create the widget's Python file at ~/.config/twidgets/py_widgets/custom_widget.py
For a simple widget, you primarily need to define the draw function and use add_widget_content
Example:
from twidgets.core.base import Widget, draw_widget, add_widget_content, Config, UIState, BaseConfig
import typing
# 1. Define the draw function for content
def draw(widget: Widget, ui_state: UIState, base_config: BaseConfig) -> None:
# Initialize the widget title, borders, etc.
draw_widget(widget, ui_state, base_config)
# Add your content (list of strings)
content: list[str] = [
'Welcome to my new widget!',
'This is a test.',
'It was very easy to create.'
]
add_widget_content(widget, content)
# 2. Define the build function
def build(stdscr: CursesWindowType, config: Config) -> Widget:
return Widget(
config.name, config.title, config, draw, config.interval, config.dimensions, stdscr,
update_func=None,
mouse_click_func=None,
keyboard_func=None,
init_func=None,
help_func=None
)
For full documentation see Widget Guide
🧩 4. Contributing
Help the project grow: create an issue or pull request (on github)!
📜 5. License
See License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file twidgets-1.2.2.tar.gz.
File metadata
- Download URL: twidgets-1.2.2.tar.gz
- Upload date:
- Size: 32.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e56e0f7b10d27590dd0ac7ff7a12b326815888d8ef1b2f567bb95c27a79aac6b
|
|
| MD5 |
786b7aedb46f28e2048ca3fa8bdfe2c8
|
|
| BLAKE2b-256 |
5300b1a7684d0ae65efb76ee07b14dc8d88888e796771a0e3eb8d7bcfcf01072
|
Provenance
The following attestation bundles were made for twidgets-1.2.2.tar.gz:
Publisher:
publish.yml on IceWizard7/terminal-widgets
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
twidgets-1.2.2.tar.gz -
Subject digest:
e56e0f7b10d27590dd0ac7ff7a12b326815888d8ef1b2f567bb95c27a79aac6b - Sigstore transparency entry: 747173720
- Sigstore integration time:
-
Permalink:
IceWizard7/terminal-widgets@32c1ae994262a8dc3447464d9f0df85d13ef3204 -
Branch / Tag:
refs/tags/v1.2.2 - Owner: https://github.com/IceWizard7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@32c1ae994262a8dc3447464d9f0df85d13ef3204 -
Trigger Event:
release
-
Statement type:
File details
Details for the file twidgets-1.2.2-py3-none-any.whl.
File metadata
- Download URL: twidgets-1.2.2-py3-none-any.whl
- Upload date:
- Size: 38.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b7e59bbdc4de762c29fc7aced66130999a2321710ccc24a73188b73784622473
|
|
| MD5 |
fcd4ebf0baea5f75a5d906777e94166b
|
|
| BLAKE2b-256 |
4b0b2827ba8ef0a9678021b9b44dc5152cd672a2bcff0a3dc3e398418b84bd9d
|
Provenance
The following attestation bundles were made for twidgets-1.2.2-py3-none-any.whl:
Publisher:
publish.yml on IceWizard7/terminal-widgets
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
twidgets-1.2.2-py3-none-any.whl -
Subject digest:
b7e59bbdc4de762c29fc7aced66130999a2321710ccc24a73188b73784622473 - Sigstore transparency entry: 747173727
- Sigstore integration time:
-
Permalink:
IceWizard7/terminal-widgets@32c1ae994262a8dc3447464d9f0df85d13ef3204 -
Branch / Tag:
refs/tags/v1.2.2 - Owner: https://github.com/IceWizard7
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@32c1ae994262a8dc3447464d9f0df85d13ef3204 -
Trigger Event:
release
-
Statement type: