Skip to content

Instantly share code, notes, and snippets.

@fishd72
Last active July 29, 2022 12:16
Show Gist options
  • Save fishd72/904bda22bed317fe25b76549c58de706 to your computer and use it in GitHub Desktop.
Save fishd72/904bda22bed317fe25b76549c58de706 to your computer and use it in GitHub Desktop.
Installing lolcat and fortune on Steam Deck

Installing lolcat and fortune on Steam Deck

... for fun and profit ?!

The Steam Deck is great, I'm less than 24 hours in but already loving it. It does have a few quirks compared to a standard Windows or Linux machine though... it has an immutable filesystem... meaning you can't just install packages using pacman as you normally would, and while you can switch this off temporarily to install things, these changes will likely be overwritten during the next software update cycle.

To work around this, I've found versions of lolcat and fortune that are written in python and installed in the /home/deck folder, which should survive any OS updates. Credit for both these tools goes to the original authors:

  1. Install pip using python3 -m ensurepip
  2. Install python version of fortune python -m pip install --user fortune
  3. Install python version of lolcat python -m pip install --user lolcat
  4. Create .bash_profile if not already present
  5. Add the following to .bash_profile to ensure the path is correct
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi
  1. Download a fortunes database (perhaps from here?) and save it to ~/Documents/fortune/
  2. Add the following to your .bashrc file to set the environment variable and execute the program every time you open a terminal session
if [ -d "$HOME/Documents/fortune" ]; then
  export FORTUNE_FILE="${HOME}/Documents/fortune/fortunes"
fi

if [ -f "$HOME/.local/bin/fortune" ]; then
    "$HOME/.local/bin/fortune" | "$HOME/.local/bin/lolcat"
fi
  1. Close and reopen your terminal session
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment