Skip to main content

Minimal and customizable fetch script written in Python3 <3

Project description

KatFetch

KatFetch is a minimal and customizable fetch script.

What is a fetch script?

A fetch script is a script that fetches some information about your system. It is commonly used when taking screenshots of your desktop and is designed to show off your terminal and it's colours.

Installation

KatFetch includes an installer. To use it, simply run python3 setup.py install and KatFetch will be installed to /usr/bin along with all dependencies.

Dependencies

Note: If you install KatFetch using setup.py, all dependencies are installed automatically. To remove unwanted dependencies, you can simply remove them from the install_requires list.

To display all information entries, KatFetch requires some dependencies, however all of these are optional (with the exception of Click). If you don't want to install a specific module, simply remove the offending entry from get_info() and the entries array in main().

Module Used for
distro Getting Linux Distribution
cpuinfo Getting CPU information
hurry.filesize Displaying RAM usage as a human readable value
psutil Getting RAM usage
click Displaying entries in colour, colour bar and arguments

Command line arguments

Argument Description Supported Values
--nobar Disables colour bar None
--color Changes accent colour red, green, yellow, blue, magenta, cyan
--help View help text (Automatically generated by Click) None

Adding and removing entries

Adding an extra line of information is super simple. Each entry is stored in a list. First, you need to add some code in get_info() that will get you the information you want to add, store that in a variable. Then, add some code similar to this to the entries list.

color_entry("Greeting", "Hello, World!", color)

This will output something like:

Greeting Hello, World!

Where "Greeting" uses the colour you specified.

Removing entries is very similar and even easier, simply remove them from get_info() and the entries list.

Improving speed

Out of the box, KatFetch can be a little slow to run. On my system, it can take up to 1 second for KatFetch to display info. This is caused by the function that gets processor information and is out of my control.

If you don't really need to see processor information, you can simply remove it from get_info() and the entries list (see adding and removing entries above) for a massive speed boost.

Running on Windows

KatFetch will successfully run on Windows, however the terminal, shell and user fields won't work. I currently have no intentions to support Windows, however, if you would like to, you can make a fork and add the necessary code.

Things planned for the future

There are a couple more things I need to implement. Pull requests for these features would be super helpful.

  • Get terminal and user from a source other than environment variables.

Screenshots

KatFetch Screenshot

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

KatFetch-1.2.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

KatFetch-1.2-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page