Making the command line fun - terminaltexteffects

Posted on May 30, 2024

This is a rad tool for adding visual effects to the terminal. Having effects when running a command or launching a terminal is totally unnecessary… And a lot of fun.

From their documentation:

TerminalTextEffects (TTE) is a terminal visual effects engine. TTE can be installed as a system application to produce effects in your terminal, or as a Python library to enable effects within your Python scripts/applications. TTE includes a growing library of built-in effects which showcase the engine’s features.

Install

I am using pipx to install instead of regular pip or downloading a binary and running with python.

pipx install terminaltexteffects

If its the first time using pipx use pipx ensurepath to easily add to your $PATH.

Usage

In their documentation there are a ton of features and tweaks you can run. Rather than go through all those, here is how I am currently using it.

ssh animation

I have a handful of boxes I regularly connect to anytime I sit down at my desk. I am using this command for connecting to my primary nas:

ssh nas -t 'screenfetch -N | tte print --print-speed 5  --print-head-return-speed 6; fish -l'

Notes on what this is doing:

  • -t to execute a command once connected.
  • screenfetch to display system information, an alternative to neofetch.
  • -N for screenfetch to strip all color from the output
  • tte to run terminaltexteffects
  • print is the text effect to display
  • --print-speed 5 to speed up the output. The default is 1.
  • print-head-return-speed 6 to speed up how fast the animation prints the info.
  • ;fish -l to use fish as the shell and -l to be started as a the login shell.

Every effect has a help menu to show the options when running it. You can invoke the list by doing tte <effect> -h.

This is what it looks like:

A terminal screen printing the system information in an animation similar to an old dot matrix printer printing the text on the screen.

PS: I am using vhs to create this gif of the terminal output.

Terminator launch

When I’m getting down to some serious work I use Terminator in a fullscreen window. I want this same kind of startup animation with screenfetch at launch of the Terminator window. This time I want to use the beams animation and launch tmux. So, I wrote a couple of scripts. Now, I’m neither a SysAdmin nor a developer so I’m sure these scripts can be a lot better.

First, to start tmux and run a command when it starts:

#! /bin/fish
tmux -f ~/.config/tmux/tmux.conf.local new-session -d -s workin 
tmux send-keys -t workin "sh /home/dominic/scripts/tmux_tte_start.sh" Enter
tmux attach -t workin

Then, the script to run the command (that is the command listed in the above script):

#! /bin/fish
screenfetch -N | tte beams

Last, I set a keyboard shortcut on my desktop to open Terminator in a borderless window, execute the tmux launch script, and then set my working directory:

terminator -M -b -e /home/dominic/scripts/tmux_launch.sh --working-directory /home/dominic

I set the keyboard shortcut to Super+T.

Here’s what it looks like:

A wallpaper of a Synthwave style sun with a terminal window opening and running the beams animation. The animation moves the text a symbol at a time left to right and up and down until all the symbols are in the correct location.

This was recorded using Peek so I could grab the entire screen.

I’m sure I will find other pointless usecases for terminal animations on my various machines over the next few months. Its just too fun to pass up.

- - - - -

Did you like this post? Give it an upvote by clicking on the arrows below! Sending me an upvote is like you and I giving each other a high five.

🙏 😎

Thank you for reading! If you would like to comment on this post you can start a conversation on the Fediverse. Message me on Mastodon at @cinimodev@masto.ctms.me. Or, you may email me at blog.discourse904@8alias.com. This is an intentionally masked email address that will be forwarded to the correct inbox.

If you enjoy the random stuff I write here, post to Mastodon, or watch on YouTube, and are feeling generous, I am open to tips of Ko-fi.