Command line animations based on the state of the system

Overview

shell-emotions

Command line animations based on the state of the system for Linux or Windows 10

The ascii animations were created using a modified version of Joedang's converter

Requirements

Linux

  • Python 2 or 3
  • psutil
  • Bash or Fish

Windows 10

  • Python 3
  • psutil
  • pythonnet | (Optional)
  • OpenHardwareMonitorLib.dll | Note: OpenHardwareMonitor REQUIRES Administrator Access (Optional)
  • Powershell

Workflow for getting the ascii frames

Manual Method

Termimum Method

  • Download modified Termimation
  • Locate gif you want to convert to ascii frames named
  • Run -> ./termimation ./

Adding Animations

  • Create ascii frames using above workflow or
  • Move ascii frames named 0-N to ./assets/frames/
  • Add conditional in state_update() in lib.threading that sets state = emotions[""].id

Configuration

Configurable Parameters in ./conf/cfg.py:

  • frames_path | This is the path of the frames folder where individual folders for each emotion is kept (Default "./assets/frames/")
  • state | This is the starting state of the program (Default 0)
  • welcome_time | Time (sec) for welcome message (Default 1)
  • frame_time | The time before printing next frame (Default 0.2)
  • util_refresh | Time inbetween utilization stat refreshes (Default 5)
  • cpu_lvl_1 | Boundary for low CPU usage (Default 10)
  • cpu_lvl_2 | Boundary for medium CPU usage (Default 30)
  • cpu_lvl_3 | Boundary for high CPU usage (Default 90)
  • cpu_temp_lvl_1 | Boundary for high CPU temperature (Default 80)
  • cpu_temp_lvl_2 | Boundary for very high CPU temperature (Default 90)
  • cpu_temp_lvl_3 | Boundary for CPU throttling temperature (Default 105)
  • cpu_temp_sensor | Sensor to pull CPU Temps from (Default "coretemp")
  • cpu_temp_sensor_win32 | Sensor to pull CPU temps in win32 from (Default "CPU Package")
  • cpu_temp_default | Default fallback CPU temperature (Default 0)
  • mem_bound | Boundary for high memory usage (Default 50)

clean.sh

Use clean.sh file for cleaning undesired characters from the ascii frames

main.py

Functions

shutdown(signum, frame):

The shutdown function handles clean shutdown of the program with "Shutting down..." printout.

main():

The main function deals with signal handling and starts both state update and emote threads.

threading.py

Functions

state_update(thread_name):

The state update thread is a daemon that queries system stats through psutil and updates global state.

emote(thread_name):

The emote thread is a daemon that runs the correct animation based on state continuously.

animation.py

Classes

class Animation:

The Animation class has the properties name, id, file_path, and frames. It will fill frames list upon initialization using input file_path and name.

win32_temp.py

Functions

init_open_hwd_mon():

This function initializes OpenHardwareMonitor by loading OpenHardwareMonitorLib.dll and returning the handle.

get_cpu_pkg_temp(handle)

This function returns cpu package temperature from OpenHardwareMonitor.

Owner
Simon Malave
I like to walk in the thin line between infrastructure and code.
Simon Malave
Cement is an advanced Application Framework for Python, with a primary focus on CLI

Cement Framework Cement is an advanced Application Framework for Python, with a primary focus on Command Line Interfaces (CLI). Its goal is to introdu

Data Folk Labs, LLC 1.1k Dec 31, 2022
Corgy allows you to create a command line interface in Python, without worrying about boilerplate code

corgy Elegant command line parsing for Python. Corgy allows you to create a command line interface in Python, without worrying about boilerplate code.

Jayanth Koushik 7 Nov 17, 2022
Color text streams with a polished command line interface

colout(1) -- Color Up Arbitrary Command Output Synopsis colout [-h] [-r RESOURCE] colout [-g] [-c] [-l min,max] [-a] [-t] [-T DIR] [-P DIR] [-d COLORM

nojhan 1.1k Dec 21, 2022
Rich is a Python library for rich text and beautiful formatting in the terminal.

Rich 中文 readme • lengua española readme • Läs på svenska Rich is a Python library for rich text and beautiful formatting in the terminal. The Rich API

Will McGugan 41.4k Jan 02, 2023
emoji terminal output for Python

Emoji Emoji for Python. This project was inspired by kyokomi. Example The entire set of Emoji codes as defined by the unicode consortium is supported

Taehoon Kim 1.6k Jan 02, 2023
Library for building powerful interactive command line applications in Python

Python Prompt Toolkit prompt_toolkit is a library for building powerful interactive command line applications in Python. Read the documentation on rea

prompt-toolkit 8.1k Dec 30, 2022
A minimal and ridiculously good looking command-line-interface toolkit

Proper CLI Proper CLI is a Python package for creating beautiful, composable, and ridiculously good looking command-line-user-interfaces without havin

Juan-Pablo Scaletti 2 Dec 22, 2022
Command line animations based on the state of the system

shell-emotions Command line animations based on the state of the system for Linux or Windows 10 The ascii animations were created using a modified ver

Simon Malave 63 Nov 12, 2022
Python Command-line Application Tools

Clint: Python Command-line Interface Tools Clint is a module filled with a set of awesome tools for developing commandline applications. C ommand L in

Kenneth Reitz Archive 82 Dec 28, 2022
Simple cross-platform colored terminal text in Python

Colorama Makes ANSI escape character sequences (for producing colored terminal text and cursor positioning) work under MS Windows. PyPI for releases |

Jonathan Hartley 3k Jan 01, 2023
Clint is a module filled with a set of awesome tools for developing commandline applications.

Clint: Python Command-line Interface Tools Clint is a module filled with a set of awesome tools for developing commandline applications. C ommand L in

Kenneth Reitz Archive 82 Dec 28, 2022
prompt_toolkit is a library for building powerful interactive command line applications in Python.

Python Prompt Toolkit prompt_toolkit is a library for building powerful interactive command line applications in Python. Read the documentation on rea

prompt-toolkit 8.1k Jan 04, 2023
A thin, practical wrapper around terminal capabilities in Python

Blessings Coding with Blessings looks like this... from blessings import Terminal t = Terminal() print(t.bold('Hi there!')) print(t.bold_red_on_brig

Erik Rose 1.4k Jan 07, 2023
A fast, stateless http slash commands framework for scale. Built by the Crunchy bot team.

Roid 🤖 A fast, stateless http slash commands framework for scale. Built by the Crunchy bot team. 🚀 Installation You can install roid in it's default

Harrison Burt 7 Aug 09, 2022
Humane command line arguments parser. Now with maintenance, typehints, and complete test coverage.

docopt-ng creates magic command-line interfaces CHANGELOG New in version 0.7.2: Complete MyPy typehints - ZERO errors. Required refactoring class impl

Jazzband 108 Dec 27, 2022
A CLI tool to build beautiful command-line interfaces with type validation.

Piou A CLI tool to build beautiful command-line interfaces with type validation. It is as simple as from piou import Cli, Option cli = Cli(descriptio

Julien Brayere 310 Dec 07, 2022
A drop-in replacement for argparse that allows options to also be set via config files and/or environment variables.

ConfigArgParse Overview Applications with more than a handful of user-settable options are best configured through a combination of command line args,

634 Dec 22, 2022
Cleo allows you to create beautiful and testable command-line interfaces.

Cleo Create beautiful and testable command-line interfaces. Cleo is mostly a higher level wrapper for CliKit, so a lot of the components and utilities

Sébastien Eustace 984 Jan 02, 2023
Pythonic command line arguments parser, that will make you smile

docopt creates beautiful command-line interfaces Video introduction to docopt: PyCon UK 2012: Create *beautiful* command-line interfaces with Python N

7.7k Dec 30, 2022
sane is a command runner made simple.

sane is a command runner made simple.

Miguel M. 22 Jan 03, 2023