19

I saw a person that while using their terminal, it output a joke and changed the colors and laughed at the user. It said something along the lines of leaking colors into the console since (year). I don't remember what it was, but I'd like to use it because the Kubuntu Konsole gets very boring after long hours of use, and I'd like to liven things up a bit. Any ideas on what it is/where I can get it?

What I'm looking for is something that does it automatically -- without specific input from the user to run a script or command (or even a command run at startup). The thing I'm looking for changed the color themes of the shell at random intervals and joked about the color change. Perhaps it was just a different terminal program (I don't know if that is the right term) than Konsole that is built into Kubuntu.

2
  • 2
    "Terminal codes" or "ANSI codes" is what you are looking for.
    – phk
    Dec 2, 2016 at 9:33
  • You can also turn on sudo insults for a healthy dose of snark whenever you enter your password wrong.
    – DJMcMayhem
    Dec 2, 2016 at 17:16

7 Answers 7

32

Running a ruby script on every login doesn't sound like my idea of a good time.
But if it's colours you want you won't be disappointed by lolcat https://github.com/busyloop/lolcat

DISCLAIMER: I have since set this up on my SSH banners throughout my home cluster :)
Looks great with some text piped in from figlet

lolcat

2
  • 2
    This is also available in (at least) Ubuntu's repos with apt-get install lolcat. I also had to gem install lolcat. Dec 2, 2016 at 21:01
  • While this does have some of the things I was looking for, it is not what I am looking for, perhaps I should clarify the question.
    – Undermark5
    Dec 4, 2016 at 19:17
20

Text-mode graphics + jokes can be implemented using installing ponysay + fortune.

The ponysay package by default displays a string picking up a random poney.

Then for basic use, you do:

fortune | ponysay

or:

fortune | ponythink

From ArchWiki:

For full 256-colored cowsay-like art use ponysay (version 3.0 has 422 ponies). The syntax is $ ponysay message to say something and ponysay -l for a complete list of ponies. To select a pony to display, run $ ponysay --pony x "message", where x is a pony. To create more ponies use util-say-gitAUR and store them in ~/.local/share/ponysay/ponies and ~/.local/share/ponysay/ttyponies/ for desktop and TTY, respectively.

There is a fork here in github, which has link of packages for other distributions. https://github.com/erkin/ponysay

To install it:

git clone https://github.com/erkin/ponysay
cd ponysay
./setup.py build --freedom=partial
./setup.py install --freedom=partial

As for fortune itself, from man fortune:

NAME fortune - print a random, hopefully interesting, adage

DESCRIPTION When fortune is run with no arguments it prints out a random epigram. Epigrams are divided into several categories, where each category is sub-divided into those which are potentially offensive and those which are not.

The user may specify alternate sayings. You can specify a specific file, a directory which contains one or more files, or the special word all which says to use all the standard databases.

As a side note, if in Debian you install the package fortunes-debian-hints, besides jokes you also get the occasional technical advice about Debian. We have here a server for student training, and I installed this there coupled with fortune-mod+fortunes-debian-hints for sending technical fortunes at every login.

As for the packages with fortune data files, you even have got fortune data files in several tongues besides English, and you can easily put together your own set of jokes as the format is quite simple. Be particularly aware of fortunes-off in multi-user environments, as it can and will display sarcastic/non-political-correct jokes quite often.

ponies

4feet

4
  • 3
    OMG!!! Ponies!!! LOL!!! Dec 2, 2016 at 13:35
  • 1
    Ponies with wings, even! I dunno, though: falling off a horse isn't that much fun even when it's got all four feet on the ground :-)
    – jamesqf
    Dec 2, 2016 at 18:01
  • 1
    @jamesqf Yeah, you don't have 4 feet!
    – EKons
    Dec 3, 2016 at 14:47
  • 1
    @jamesqf Many of them are from My Little Pony, apparently. Erm, not that I would know... He... he...
    – wizzwizz4
    Dec 3, 2016 at 17:05
9

Don't know about the colors, but to add a little humor to opening a terminal:

sudo apt-get install cowsay fortune

Add to your ~/.profile or ~/.bashrc (depending to the specific configuration, shell, and terminal emulator):

if [ -x /usr/games/cowsay ] &&  [ -x /usr/games/fortune ]; then
   /usr/games/fortune | /usr/games/cowsay -f $(ls /usr/share/cowsay/cows/ | shuf -n1)
fi
  • fortune displays a pithy quotation chosen at random from those stored in /usr/share/games/fortunes/.
  • cowsay display ASCII art depicting some sort of animal with a speech bubble.
1
  • +1 This is a good hint, I am proposing a slightly more graphical variation of it. We have here a server for student training, and I installed this there coupled with fortunes-debian-hints for sending technical fortunes at every login. Dec 2, 2016 at 10:28
4

In order to change color you could use tput.

Something that i prefer to use to highlight a line on the shell is

echo "`tput setf 7``tput setb 4``tput bold`  SOMETHING TO HIGHLIGHT  `tput sgr0`"

List of tput color can be found here with examples

2

One more to way have fun with cowsay and fortune::

add below lines to your bashrc

ls -1 /usr/share/cowsay/cows/ | awk -F '.' '{print $1}' >  file
COWSA=`head   -$((${RANDOM} % \`wc -l < file\` + 1))  file | tail -1`
cowsay -f $COWSA `fortune`

This will give you random picture of cowsay with fortune quote. The first line is not relevant, you can just copy the names to a file(same file name as in second line) permanently and do without first line. Have fun !

Edit: Sorry, this was already mentioned in @AlexP anwser. Not deleting this as I used different concept to achieve this :)

2

Combining the best of the previous answers, I wrote a script which uses:

Content

  • fortune
  • date (if fortune not available)

Display

  • ponysay if available, else,
  • cowsay
    • Piped through lolcat for colouring if available
#!/bin/bash

function content {
    if command -v fortune &>-; then
        fortune
    else
        date
    fi
}

function display {
    if command -v ponysay &>-; then
        # Keep 4 terminal lines unused, truncate if necessary
        PONYSAY_SHELL_LINES=4 PONYSAY_TRUNCATE_HEIGHT=1 ponysay -Wi
    elif command -v cowsay &>-; then
        cowsay | 
        if command -v lolcat &>-; then
            lolcat
        else
            cat
        fi
    fi
}

content | display
3
  • You can test the exit status of command directly: if command -v ponysay >&-; then ...
    – muru
    Jun 26, 2018 at 5:29
  • Thanks! Updated. And also fixed another issue.
    – Tom Hale
    Jun 26, 2018 at 5:33
  • @muru Know of any way to get rid of that final cat?
    – Tom Hale
    Jun 26, 2018 at 5:35
-1

You can edit your .bashrc and add jokes or messages if you want

echo "GOOD EVENING MY LORD"

Then restart your terminal.

You can also add logos and great info, I recommend that you add a logo for linux

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .