Code Monkey home page Code Monkey logo

shell-emotions's Introduction

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 <insert_gif_name>
  • Run -> ./termimation <insert_gif_name> ./<insert_save_location>

Adding Animations

  • Create ascii frames using above workflow or
  • Move ascii frames named 0-N to ./assets/frames/<insert_emotion_name>
  • Add conditional in state_update() in lib.threading that sets state = emotions["<insert_emotion_name>"].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.

shell-emotions's People

Contributors

avanisubbiah avatar malav097 avatar mrbesen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

shell-emotions's Issues

License needs to be added

I'm not too familiar with licensing, but I just realized after looking at the termination repository that we need to add a license file to this repo. Maybe GPL 3.0?

Refactor branch

@avanishsubbiah I will create another branch named refactor, in that branch i will create a subdirectory called "lib" and organize the code into objects. I will add argparse to manage command line arguments. You can keep working on the main branch but keep in mind that later on you will have to commit your new changes to the refactor branch too. So we can merge refactor with main.

Need cropped images or specifications to reproduce ascii art

Following the workflow outlined in the documentation, using the images provided, results in images of different sizing than the original ascii art images provided. If the art was generated via cropped images the images in assets need to be updated to those cropped images. Or if a certain sizing was used that would be useful to know.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.