/terminal-profile

Terminal Settings

Primary LanguageShell

Terminal Profile

terminal

This is my profile for UNIX (MacOS/Linux) terminals. For Ubuntu, I just use the default terminal app. For MacOS, I use iTerm2.

In the MacOS case, I have successfully installed this theme once before, but most of the terminal commands will be different. You'll just have to open the .sh files and figure out how to adapt it to MacOS until I can prepare MacOS commands.

These commands were last tested on May 2022 on Ubuntu 20.

Prerequisites

For the scripts to work, I think these are the bare minimum requirements.

# Update your software repositories.
sudo apt-get update
sudo apt-get upgrade

# Install Git.
sudo apt-get install -y git

# Install Vim.
sudo apt-get install -y vim

Installation

Powerline (and fonts)

First, we'll install the font (RobotoMono for Powerline). I'll also install it into VIM, since that is my built-in editor of choice (but you don't have to use it).

The Powerline fonts also include special characters (like Git branches) that we will use later in the terminal profile theme.

./install_powerline.sh

ZSH, OhMyZSH and Plugins

The shell that I use is "ZSH", with the OhMyZSH upgrade on top of that. To install all of that stuff, you can run the helper script (and may need to restart after).

./install_terminal.sh

After this, the terminal should look a bit different, but we need to do the next step to have the entire theme.

Profile (plugins, theme, font and color)

This script will first install two plugins that I like to use: auto-complete and color highlighting.

# You don't need to execute this - it's part of the script already.
(cd ~/.oh-my-zsh/custom/plugins && git clone https://github.com/zsh-users/zsh-syntax-highlighting)
(cd ~/.oh-my-zsh/custom/plugins && git clone https://github.com/zsh-users/zsh-autosuggestions)

It will also copy over the .zshrc and danielscholl-agnoster.zsh-theme files for the terminal to use (which will wire up the plugins and the theme).

The last command is to create a terminal profile that will set the colors and also set the font to be the Powerline one we installed earlier (required for the theme to display correctly).

./install_profile.sh

You can also change the font to any of the other Powerline Patched Fonts too if you don't like RobotoMono.

If it looks funky after this command, then you might need to wait until the theme is updated with a Powerline font (the next step), and may need to also restart your machine.

Notes

How to dump current terminal profiles.

dconf dump /org/gnome/terminal/legacy/profiles:/ > gnome-terminal-profiles.dconf

How to display terminal information (I use Neofetch).

sudo apt-get install neofetch

# Display the profile
# I override the colors because the default red is kinda ugly in this theme.
neofetch --ascii_colors 6 7 --colors 2 2 2 2

How do I reset the changes back to the old terminal?

There's two main modifications being done to the terminal. The terminal theme, and the shell itself.

For the theme, here's a thread I found on the internet on how to reset it to the default: https://askubuntu.com/questions/14487/how-to-reset-the-terminal-properties-and-preferences

For the terminal shell itself, we actually installed a new terminal (zsh) alongside the default bash. Bash itself wasn't removed, but we just set the default shell to zsh. Here is a thread on how to uninstall zsh and default back to bash: https://askubuntu.com/questions/958120/remove-zsh-from-ubuntu-16-04

Sources

Here are some of the main resources I used as part of this terminal setup.

Oh My Zsh! | Robby Russel OMZ | Install Powerline | Powerline Patched Fonts | Agnoster Theme