Back to overview
Terminal Setup On Arch
January 18, 2021

Hey y'all, I just wanted to jot down my current (January 2021) terminal setup.

I enjoy customizing my developer experience. Although it may not be functional in super productive to make things look beautiful, I appreciate nice looking interfaces, and that's all that matters 🙂. It's all for the aesthetics 💯, and none of this is essential. I do think that ZSH does help you type slightly faster, but that's not my limiting factor for speed (that would just be me).

Please note that I'm running on Arch Linux. The installation steps will definitely be different for other linux distros. Some features may not even work entirely on Windows or Mac (unless you are using WSL on windows - still unsure about Macos since I don't own a mac).

Terminal

Emulator

The first step of customizing your terminal is picking a terminal. Here on Linux, there are many different terminal emulators such as kitty, alacrity, urxvt, termite, gnome-terminal. Each terminal emulator has its pros and cons and various features. I current use Kitty since it's GPU-accelerated, and it has a very clean configuration file format. I have used urxvt and termite in the past, and I haven't noticed any significant performance differences, but I did find that urxvt is a bit harder to configure. I've also tried hyper, the electron-based emulator but found it to be slow.

Electron allows people to build desktop applications using HTML, CSS, and JavaScript; this is typically nice for writing large-scale applications where you don't want to duplicate code between web and desktop. But this comes at a cost: slower performance. Although hyper is getting better and optimizes to improve speed, I definitely have noticed that it is much slower than a traditional terminal emulator, so I avoid it.

To setup kitty you first need to create the configuration file ~/.config/kitty/kitty.conf (there are other ways to load a config file as seen in the docs). Here we can put all the configuration options.

# Loads in my color palette
include afterglow.conf

# My font that I downloaded above
font_family SpaceMono Nerd Font Mono
# I personally dislike ligatures
disable_ligatures always

# Works with picom (on linux) to add some transparency
background_opacity .6

url_color #0087bd
url_style curly

# Enable zsh as seen below
shell zsh

And my color palette

foreground  #d0d0d0

cursor                #d0d0d0

selection_foreground  #928374
selection_background  #3c3836

# Black
color0                #151515
# Bright black
color8                #505050

# red
color1                #a53c23
# light red
color9                #a53c23

# green
color2                #7b9246
# light green
color10               #7b9246

# yellow
color3                #d3a04d
# light yellow
color11               #d3a04d

# blue
color4                #6c99bb
# light blue
color12               #547c99

# magenta
color5                #9f4e85
# light magenta
color13               #9f4e85

# cyan
color6                #7dd6cf
# lighy cyan
color14               #7dd6cf

# light gray
color7                #d0d0d0
# dark gray
color15               #f5f5f5

And with that kitty should be setup!

Also check out Gogh for different color schemes.

Font

Later in the post I will talk about using starship. Starship requires having a nerd font installed and enabled for the terminal ( read more here). I choose to go with space mono. I switch up my font every now and again though.

If you are using arch you can easily install this font with yay -S nerd-fonts-space-mono (AUR package).

Blur/Opacity

This section is very specific to Linux (again install details differ for other distros).

I am using picom, a compositor for Xorg. I'm not entirely sure how compositors work underneath the hood, but they allow you to apply specific effects to Windows, such as blurring, animations, and transparency. You can read more here. As of this writing, the base picom repo does not support dual kawase blur and rounded borders, so I am using a fork that supports both. This fork also supports window animation, which I think look nice.

# ░█▀█░▀█▀░█▀▀░█▀█░█▄█░░░░█▀▀░█▀█░█▀█░█▀▀
# ░█▀▀░░█░░█░░░█░█░█░█░░░░█░░░█░█░█░█░█▀▀
# ░▀░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░░▀▀▀░▀▀▀░▀░▀░▀░░
#
#  X compositor configuration

# ░█▀▀░█░█░█▀█░█▀▄░█▀█░█░█
# ░▀▀█░█▀█░█▀█░█░█░█░█░█▄█
# ░▀▀▀░▀░▀░▀░▀░▀▀░░▀▀▀░▀░▀

shadow = false;
shadow-radius = 12;
shadow-opacity = 0.75;
shadow-offset-x = -12;
shadow-offset-y = -12;

# shadow-red = 0
# shadow-green = 0
# shadow-blue = 0
shadow-color = "#000000";

shadow-exclude = [
	"name = 'Notification'",
	"class_g = 'Conky'",
	"class_g ?= 'Notify-osd'",
	"class_g = 'Cairo-clock'",
	"class_g = 'slop'",
	"class_g = 'Firefox' && argb",
	"class_g = 'Rofi'",
	"_GTK_FRAME_EXTENTS@:c",
	"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
];

# shadow-exclude-reg = "x10+0+0";
# xinerama-shadow-crop = true;

# ░█▀▀░█▀█░█▀▄░▀█▀░█▀█░█▀▀
# ░█▀▀░█▀█░█░█░░█░░█░█░█░█
# ░▀░░░▀░▀░▀▀░░▀▀▀░▀░▀░▀▀▀

# fading = true;
# fade-in-step = 0.03;
# fade-out-step = 0.03;
# fade-delta = 3;

# fade-exclude = [];

# no-fading-openclose = false;
# no-fading-destroyed-argb = true;

# ░█▀█░█▀█░█▀█░█▀▀░▀█▀░▀█▀░█░█
# ░█░█░█▀▀░█▀█░█░░░░█░░░█░░░█░
# ░▀▀▀░▀░░░▀░▀░▀▀▀░▀▀▀░░▀░░░▀░

inactive-opacity = 1;
frame-opacity = 1;
inactive-opacity-override = false;
active-opacity = 1.0;
inactive-dim = 0.0;

focus-exclude = [
	"class_g = 'Cairo-clock'",
	"class_g ?= 'rofi'",
	"class_g ?= 'slop'",
	"class_g ?= 'Steam'"
];

# inactive-dim-fixed = 1.0;

opacity-rule = [
	"80:class_g = 'URxvt'",
	"80:class_g = 'UXTerm'",
	"80:class_g = 'XTerm'",
	# "80:class_g = 'kitty'",
	"80:class_g = 'Alacritty'",
	# "80:class_g = 'Code'",
	"80:class_g = 'Spotify'"
#	"80:class_g = 'discord'"
]

# ░█▀▄░█░░░█░█░█▀▄░█▀▄░▀█▀░█▀█░█▀▀
# ░█▀▄░█░░░█░█░█▀▄░█▀▄░░█░░█░█░█░█
# ░▀▀░░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀░▀░▀▀▀

blur: {
	method = "dual_kawase";
    strength = 7.0;
	deviation = 1.0;
	# kernel = "11x11gaussian";
}

blur-background = false;
blur-background-frame = true;
blur-background-fixed = true;
# blur-kern = "3x3box";

blur-background-exclude = [
	"window_type = 'desktop'",
	"window_type = 'utility'",
	"class_g = 'slop'",
	"class_g = 'Firefox' && argb",
	"_GTK_FRAME_EXTENTS@:c"
];

# ░█▀▀░█▀▀░█▀█░█▀▀░█▀▄░█▀█░█░░░░░█▀▀░█▀▀░▀█▀░▀█▀░▀█▀░█▀█░█▀▀░█▀▀
# ░█░█░█▀▀░█░█░█▀▀░█▀▄░█▀█░█░░░░░▀▀█░█▀▀░░█░░░█░░░█░░█░█░█░█░▀▀█
# ░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░▀░▀░▀░▀▀▀░░░▀▀▀░▀▀▀░░▀░░░▀░░▀▀▀░▀░▀░▀▀▀░▀▀▀

daemon = false;
backend = "glx";
vsync = true;
dbus = false;
mark-wmwin-focused = true;
mark-ovredir-focused = true;
detect-rounded-corners = true;
detect-client-opacity = true;
refresh-rate = 0;
# use-ewmh-active-win = true;
# unredir-if-possible = false;
# unredir-if-possible-delay = 0;

unredir-if-possible-exclude = [];

detect-transient = true;
detect-client-leader = true;
resize-damage = 1;

invert-color-include = [];

glx-no-stencil = true;
# glx-no-rebind-pixmap = false;
use-damage = true;
# xrender-sync-fence = true;

# glx-fshader-win = "";
# force-win-blend = false;

# no-ewmh-fullscreen = false;
# max-brightness = 1.0;

transparent-clipping = false;

log-level = "warn";
log-file = "/home/kpfromer/.cache/picom-log.log";
show-all-xerrors = true;
# write-pid-path = '/path/to/your/mom';

wintypes: {
	tooltip = { fade = true; shadow = false; focus = false;	};
	normal = { shadow = false; };
	dock = { shadow = false; };
	dnd = { shadow = false; };
	popup_menu = { shadow = true; focus = false; opacity = 0.90; };
	dropdown_menu = { shadow = false; focus = false; };
	above = { shadow = true; };
	splash = { shadow = false; };
	utility = { focus = false; shadow = false; };
	notification = { shadow = false; };
	desktop = { shadow = false };
	menu = { focus = false };
	dialog = { shadow = true; };
};

# ░█▀█░█▀█░▀█▀░█▄█░█▀█░▀█▀░▀█▀░█▀█░█▀█░█▀▀
# ░█▀█░█░█░░█░░█░█░█▀█░░█░░░█░░█░█░█░█░▀▀█
# ░▀░▀░▀░▀░▀▀▀░▀░▀░▀░▀░░▀░░▀▀▀░▀▀▀░▀░▀░▀▀▀
# requires https://github.com/jonaburg/picom (read more there too)
transition-length = 185
transition-pow-x = 0.1
transition-pow-y = 0.1
transition-pow-w = 0.1
transition-pow-h = 0.1
size-transition = true

# ░█▀▀░█▀█░█▀▄░█▀█░█▀▀░█▀▄░█▀▀
# ░█░░░█░█░█▀▄░█░█░█▀▀░█▀▄░▀▀█
# ░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀░▀░▀▀▀
# requires: https://github.com/sdhand/compton or https://github.com/jonaburg/picom
corner-radius = 10.0;
rounded-corners-exclude = [
  #"window_type = 'normal'",
  "class_g = 'awesome'",
  # "class_g = 'URxvt'",
  # "class_g = 'XTerm'",
  # "class_g = 'kitty'",
  # "class_g = 'Alacritty'",
  # "class_g = 'Polybar'",
  # "class_g = 'code-oss'",
  #"class_g = 'TelegramDesktop'",
  # "class_g = 'firefox'",
  # "class_g = 'Thunderbird'"
];
round-borders = 1;
round-borders-exclude = [
  #"class_g = 'TelegramDesktop'",
];

Shell

There are many different types of shells that you can run, but the main three that come off my head are bash, zsh, and fish. I've only used bash and zsh and have not messed around with fish. I use zsh the most since it's extensible, has better tab completion (than bash), and is POSIX sh compliant. Installing zsh is reasonably easy:

# Arch install
yay -S zsh
# Debian? (from quick google search)
sudo apt install zsh

Make sure you set the zsh in your terminal (as seen in the kitty configuration file).

Plugins

I also install [zplug](https://github.com/zplug/zplug), which is a zsh plugin manager. There are many different plugin managers, but personally, I have found zplug to be clean to write with and fast.

# Arch install
yay -S zplug
# Check their docs for setup on others (https://github.com/zplug/zplug)

Here's my .zshrc file

#           _
#   _______| |__
#  |_  / __| '_ \
#   / /\__ \ | | |
#  /___|___/_| |_|

# Launch Starship
eval "$(starship init zsh)"

# Zplug (this is the location that arch installs zpl)
source /usr/share/zsh/scripts/zplug/init.zsh

# Colorize older terminal apps (like man)
# Start blinking
export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green
# Start bold
export LESS_TERMCAP_md=$(tput bold; tput setaf 2) # green
# Start stand out
export LESS_TERMCAP_so=$(tput bold; tput setaf 3) # yellow
# End standout
export LESS_TERMCAP_se=$(tput rmso; tput sgr0)
# Start underline
export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 1) # red
# End bold, blinking, standout, underline
export LESS_TERMCAP_me=$(tput sgr0)

# aliases
alias ls='exa --long --header --icons --sort=type'
alias tree='exa --tree --level 3'
alias sdn="sudo shutdown -h now" # Quick shutdown
alias cp="cp -i" # Confirm before overwriting something
alias pkg="yay -Q | fzf"
alias yt='youtube-dl --add-metadata -i'
alias cz='git-cz --disable-emoji'

# load the good parts from oh-my-zsh
# zsh auto completion
zplug "lib/completion",      from:oh-my-zsh
# setups up histoyr
zplug "lib/history",         from:oh-my-zsh
# Color highlighting in terminal
zplug "zdharma/fast-syntax-highlighting"
# Auto suggests commands based on history
zplug "zsh-users/zsh-autosuggestions"

# Install plugins if there are plugins that have not been installed (copied from the zplug readme)
if ! zplug check --verbose; then
	printf "Install? [y/N]: "
		if read -q; then
		echo; zplug install
	fi
fi

# # Then, source plugins and add commands to $PATH
zplug load

# run pfetch if terminal is interactive (https://github.com/dylanaraps/pfetch)
[ -z "$PS1" ] || pfetch

Theme

In the past I installed my theme via zsh, but I recently have found starship a customizable prompt that works with any shell. It's written in rust and boosts a sensible design and vast number of customization options.

# Arch install
yay -S starship-bin
# Regular install
curl -fsSL https://starship.rs/install.sh | bash

taken from starship.rs

Colorful ls

A while back, I wanted a more colorful version of ls. I've been searching online and have found this program called exa. It has many similar command-line options to ls and has some additional features like a tree view (note I aliased ls to exa in the zshrc config).

# Arch install
yay -S exa
# Debian/ubuntu
sudo apt install exa
# read more: https://the.exa.website/#installation

Summary

Thanks for reading; hopefully, you found something interesting or useful. Feel free to look at some of my dot files ( link) to learn more about how I have customized my Linux environment. I also have my awesome window manager dotfiles here. Also take a look at the resources below for further inspiration; I think that they have some slick setups.

Resources