Home

Awesome

<div align="center"> <kbd> <img src="https://github.com/imegeek/terminal-widgets/assets/63346676/30780c81-38f5-4083-98b6-caef644a2563" alt="Preview" /> </kbd> </div><br>

Terminal Widgets is a versatile CLI program designed to enhance your terminal experience by providing various widgets and customizable features. Below is a list of features offered by Terminal Widgets:

<div align="center"> <img src="https://img.shields.io/static/v1?label=build with&message=♡&color=ff7751&labelColor=1e2528&style=for-the-badge"> <br> <img src="https://img.shields.io/github/stars/imegeek/terminal-widgets?color=F2CD80&labelColor=1e2528&style=for-the-badge"> <img src="https://img.shields.io/static/v1?label=license&message=MIT&color=8ccf7e&labelColor=1e2528&style=for-the-badge"> <img src="https://img.shields.io/github/forks/imegeek/terminal-widgets?color=8EC8D8&labelColor=1e2528&style=for-the-badge"> </div>

Features:

Screenshots

<kbd> <p align="center">Windows <img src="https://github.com/imegeek/terminal-widgets/assets/63346676/0915b7ad-671d-4e37-b68d-cd3e292cb2ed"> </p> </kbd> <kbd> <p align="center">Linux <img src="https://github.com/imegeek/terminal-widgets/assets/63346676/64132f65-748e-4ee3-966b-7be73d5ce8b7"> </p> </kbd> <kbd> <p align="center">macOS <img src="https://github.com/imegeek/terminal-widgets/assets/63346676/5697d372-9855-4929-9935-641291ffe8cb"> </p> </kbd> <kbd> <p align="center">Android <img src="https://github.com/imegeek/terminal-widgets/assets/63346676/386088c8-5229-4899-bc1b-45f74aaeaa8d"> </p> </kbd>

Supported platforms

Getting Started

To start using Terminal Widgets, follow these steps:

  1. Install the program via pip or perform a local install.
  2. Ensure you have Nerd Font installed for optimal display.
  3. Customize your widgets and addons using the configuration file (~/.twidgets.json).
  4. Refer to the Configuration for more detailed information on configuration options and usage.

Prerequisites

Before using Terminal Widgets, please ensure that you have the following prerequisites installed:

  1. Python 3.x: Terminal Widgets is written in Python and requires Python 3.x to be installed on your system.

  2. Nerd Font: Terminal Widgets requires Nerd Font for display glyphs. If not installed, download one from here.

  3. For Android users using Termux:

    • Termux: Terminal Widgets can be used on Android devices via Termux. Ensure that you have Termux installed on your Android device from the Google Play Store or F-Droid.

    • Termux-API: Terminal Widgets requires the Termux-API app for certain functionalities. Install the Termux-API app from the Google Play Store or F-Droid.

    • termux-api: Terminal Widgets requires the termux-api package for certain functionalities. Install termux-api by running the following command in your Termux terminal:

      pkg install termux-api
      

Installation

You can install Terminal Widgets using pip, or you can clone the repository and install it locally.

Install via pip

To install Terminal Widgets via pip, simply run the following command:

pip install terminal-widgets

or

pip3 install terminal-widgets

This will download and install the latest version of Terminal Widgets from the Python Package Index (PyPI) along with its dependencies.

Manual Installation

To install Terminal Widgets locally, follow these steps:

  1. Clone this repository to your local machine. git clone https://github.com/imegeek/terminal-widgets

  2. Navigate to the cloned directory. cd terminal-widgets

  3. Install the package using pip: pip install . or pip3 install .

This will install Terminal Widgets along with its dependencies from the local source files.

Usage

Simply run the twidgets in your terminal to get an overview of your system status. try these command if not working:

python -m twidgets

or

python3 -m twidgets

<a name="argument"></a>

Argument Options:

Terminal-Widgets supports the following command line options for customization and control:

These options allow users to customize the behavior and appearance of Terminal-Widgets according to their preferences.

<a name="configuration"></a>

Configuration

Terminal Widgets supports configuration options, allowing users to customize their widgets or add new ones.

To configure Terminal Widgets:

  1. Open the configuration file located at ~/.twidgets.json.

  2. Modify the following key-value pairs according to your preferences:

  1. Dynamic Method for Defining widget-addon without Specifying 'color' or 'icon'.
  1. Save the changes and restart Terminal Widgets to apply the new configuration.

Configuration Examples

{
    "colors": {
        "red": "#FF0000",
        "cyan": "#00FFFF",
        "purple": "#a06efc",
        "green": "#9ACB73",
        "yellow": "#f8d255",
        "sky": "#6AA1DA"
    }
}
{
    "widgets": {
        "username": {
            "color": "#d0ff1f"
        }
    }
}
{
    "widgets": {
        "hostname": {
            "text": "macbook pro",
            "index": 2
        }
    }
}
{
    "widgets": {
        "platform": {
          "text": "macos",
          "icon": "\uf179"
        }
    }
}
{
    "widgets": {
          "shell": {
            "text": "zsh"
        }
    }
}
{
    "widgets": {
        "storage": {
            "state": "disabled"
        }
    }
}
{
    "addons": {
        "welcome": {
            "text": "Welcome to Terminal Widgets",
            "color": "#afdaaf",
            "index": 2
        }
    }
}
{
    "addons": {
      "cputemp": {
          "script": "import random\nprint(random.randint(30, 60), '\u00B0C')",
          "color": "#ff8522",
          "icon": "\udb84\udcc3"
      }
    }
}
{
    "addons": {
        "process": {
            "script": "/path/to/the/file/script.py"
        }
    }
}
{
    "addons": {
        "pwd": {
          "exec": "pwd",
          "color": "#ffa0f4",
          "icon": "\uf07b"
        }
    }
}
{
    "addons": {
        "hi": {
          "text": "[#ff0000]\uf255[/] [#eeff00]Hi, there[/]"
        }
    }
}
{
  "addons": {
    "color": {
        "script": "print(' '.join([f'[{color}]\ueabc[/]' for color in ['black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white']]))",
        "color": "#6aafff",
        "icon": "\ue22b"
    }
  }
}

Contributing

Contributions are welcome! If you have any suggestions, bug reports, or feature requests, please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License - see the LICENSE file for details.