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.

~/.config/kitty/kitty.conf
1
# Loads in my color palette
2
include afterglow.conf
3
4
# My font that I downloaded above
5
font_family SpaceMono Nerd Font Mono
6
# I personally dislike ligatures
7
disable_ligatures always
8
9
# Works with picom (on linux) to add some transparency
10
background_opacity .6
11
12
url_color #0087bd
13
url_style curly
14
15
# Enable zsh as seen below
16
shell zsh

And my color palette

~/.config/kitty/afterglow.conf
1
foreground #d0d0d0
2
3
cursor #d0d0d0
4
5
selection_foreground #928374
6
selection_background #3c3836
7
8
# Black
9
color0 #151515
10
# Bright black
11
color8 #505050
12
13
# red
14
color1 #a53c23
15
# light red
16
color9 #a53c23
17
18
# green
19
color2 #7b9246
20
# light green
21
color10 #7b9246
22
23
# yellow
24
color3 #d3a04d
25
# light yellow
26
color11 #d3a04d
27
28
# blue
29
color4 #6c99bb
30
# light blue
31
color12 #547c99
32
33
# magenta
34
color5 #9f4e85
35
# light magenta
36
color13 #9f4e85
37
38
# cyan
39
color6 #7dd6cf
40
# lighy cyan
41
color14 #7dd6cf
42
43
# light gray
44
color7 #d0d0d0
45
# dark gray
46
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.

~/.config/picom.conf
1
# ░█▀█░▀█▀░█▀▀░█▀█░█▄█░░░░█▀▀░█▀█░█▀█░█▀▀
2
# ░█▀▀░░█░░█░░░█░█░█░█░░░░█░░░█░█░█░█░█▀▀
3
# ░▀░░░▀▀▀░▀▀▀░▀▀▀░▀░▀░▀░░▀▀▀░▀▀▀░▀░▀░▀░░
4
#
5
# X compositor configuration
6
7
# ░█▀▀░█░█░█▀█░█▀▄░█▀█░█░█
8
# ░▀▀█░█▀█░█▀█░█░█░█░█░█▄█
9
# ░▀▀▀░▀░▀░▀░▀░▀▀░░▀▀▀░▀░▀
10
11
shadow = false;
12
shadow-radius = 12;
13
shadow-opacity = 0.75;
14
shadow-offset-x = -12;
15
shadow-offset-y = -12;
16
17
# shadow-red = 0
18
# shadow-green = 0
19
# shadow-blue = 0
20
shadow-color = "#000000";
21
22
shadow-exclude = [
23
"name = 'Notification'",
24
"class_g = 'Conky'",
25
"class_g ?= 'Notify-osd'",
26
"class_g = 'Cairo-clock'",
27
"class_g = 'slop'",
28
"class_g = 'Firefox' && argb",
29
"class_g = 'Rofi'",
30
"_GTK_FRAME_EXTENTS@:c",
31
"_NET_WM_STATE@:32a *= '_NET_WM_STATE_HIDDEN'"
32
];
33
34
# shadow-exclude-reg = "x10+0+0";
35
# xinerama-shadow-crop = true;
36
37
# ░█▀▀░█▀█░█▀▄░▀█▀░█▀█░█▀▀
38
# ░█▀▀░█▀█░█░█░░█░░█░█░█░█
39
# ░▀░░░▀░▀░▀▀░░▀▀▀░▀░▀░▀▀▀
40
41
# fading = true;
42
# fade-in-step = 0.03;
43
# fade-out-step = 0.03;
44
# fade-delta = 3;
45
46
# fade-exclude = [];
47
48
# no-fading-openclose = false;
49
# no-fading-destroyed-argb = true;
50
51
# ░█▀█░█▀█░█▀█░█▀▀░▀█▀░▀█▀░█░█
52
# ░█░█░█▀▀░█▀█░█░░░░█░░░█░░░█░
53
# ░▀▀▀░▀░░░▀░▀░▀▀▀░▀▀▀░░▀░░░▀░
54
55
inactive-opacity = 1;
56
frame-opacity = 1;
57
inactive-opacity-override = false;
58
active-opacity = 1.0;
59
inactive-dim = 0.0;
60
61
focus-exclude = [
62
"class_g = 'Cairo-clock'",
63
"class_g ?= 'rofi'",
64
"class_g ?= 'slop'",
65
"class_g ?= 'Steam'"
66
];
67
68
# inactive-dim-fixed = 1.0;
69
70
opacity-rule = [
71
"80:class_g = 'URxvt'",
72
"80:class_g = 'UXTerm'",
73
"80:class_g = 'XTerm'",
74
# "80:class_g = 'kitty'",
75
"80:class_g = 'Alacritty'",
76
# "80:class_g = 'Code'",
77
"80:class_g = 'Spotify'"
78
# "80:class_g = 'discord'"
79
]
80
81
# ░█▀▄░█░░░█░█░█▀▄░█▀▄░▀█▀░█▀█░█▀▀
82
# ░█▀▄░█░░░█░█░█▀▄░█▀▄░░█░░█░█░█░█
83
# ░▀▀░░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀░▀░▀▀▀
84
85
blur: {
86
method = "dual_kawase";
87
strength = 7.0;
88
deviation = 1.0;
89
# kernel = "11x11gaussian";
90
}
91
92
blur-background = false;
93
blur-background-frame = true;
94
blur-background-fixed = true;
95
# blur-kern = "3x3box";
96
97
blur-background-exclude = [
98
"window_type = 'desktop'",
99
"window_type = 'utility'",
100
"class_g = 'slop'",
101
"class_g = 'Firefox' && argb",
102
"_GTK_FRAME_EXTENTS@:c"
103
];
104
105
# ░█▀▀░█▀▀░█▀█░█▀▀░█▀▄░█▀█░█░░░░░█▀▀░█▀▀░▀█▀░▀█▀░▀█▀░█▀█░█▀▀░█▀▀
106
# ░█░█░█▀▀░█░█░█▀▀░█▀▄░█▀█░█░░░░░▀▀█░█▀▀░░█░░░█░░░█░░█░█░█░█░▀▀█
107
# ░▀▀▀░▀▀▀░▀░▀░▀▀▀░▀░▀░▀░▀░▀▀▀░░░▀▀▀░▀▀▀░░▀░░░▀░░▀▀▀░▀░▀░▀▀▀░▀▀▀
108
109
daemon = false;
110
backend = "glx";
111
vsync = true;
112
dbus = false;
113
mark-wmwin-focused = true;
114
mark-ovredir-focused = true;
115
detect-rounded-corners = true;
116
detect-client-opacity = true;
117
refresh-rate = 0;
118
# use-ewmh-active-win = true;
119
# unredir-if-possible = false;
120
# unredir-if-possible-delay = 0;
121
122
unredir-if-possible-exclude = [];
123
124
detect-transient = true;
125
detect-client-leader = true;
126
resize-damage = 1;
127
128
invert-color-include = [];
129
130
glx-no-stencil = true;
131
# glx-no-rebind-pixmap = false;
132
use-damage = true;
133
# xrender-sync-fence = true;
134
135
# glx-fshader-win = "";
136
# force-win-blend = false;
137
138
# no-ewmh-fullscreen = false;
139
# max-brightness = 1.0;
140
141
transparent-clipping = false;
142
143
log-level = "warn";
144
log-file = "/home/kpfromer/.cache/picom-log.log";
145
show-all-xerrors = true;
146
# write-pid-path = '/path/to/your/mom';
147
148
wintypes: {
149
tooltip = { fade = true; shadow = false; focus = false; };
150
normal = { shadow = false; };
151
dock = { shadow = false; };
152
dnd = { shadow = false; };
153
popup_menu = { shadow = true; focus = false; opacity = 0.90; };
154
dropdown_menu = { shadow = false; focus = false; };
155
above = { shadow = true; };
156
splash = { shadow = false; };
157
utility = { focus = false; shadow = false; };
158
notification = { shadow = false; };
159
desktop = { shadow = false };
160
menu = { focus = false };
161
dialog = { shadow = true; };
162
};
163
164
# ░█▀█░█▀█░▀█▀░█▄█░█▀█░▀█▀░▀█▀░█▀█░█▀█░█▀▀
165
# ░█▀█░█░█░░█░░█░█░█▀█░░█░░░█░░█░█░█░█░▀▀█
166
# ░▀░▀░▀░▀░▀▀▀░▀░▀░▀░▀░░▀░░▀▀▀░▀▀▀░▀░▀░▀▀▀
167
# requires https://github.com/jonaburg/picom (read more there too)
168
transition-length = 185
169
transition-pow-x = 0.1
170
transition-pow-y = 0.1
171
transition-pow-w = 0.1
172
transition-pow-h = 0.1
173
size-transition = true
174
175
# ░█▀▀░█▀█░█▀▄░█▀█░█▀▀░█▀▄░█▀▀
176
# ░█░░░█░█░█▀▄░█░█░█▀▀░█▀▄░▀▀█
177
# ░▀▀▀░▀▀▀░▀░▀░▀░▀░▀▀▀░▀░▀░▀▀▀
178
# requires: https://github.com/sdhand/compton or https://github.com/jonaburg/picom
179
corner-radius = 10.0;
180
rounded-corners-exclude = [
181
#"window_type = 'normal'",
182
"class_g = 'awesome'",
183
# "class_g = 'URxvt'",
184
# "class_g = 'XTerm'",
185
# "class_g = 'kitty'",
186
# "class_g = 'Alacritty'",
187
# "class_g = 'Polybar'",
188
# "class_g = 'code-oss'",
189
#"class_g = 'TelegramDesktop'",
190
# "class_g = 'firefox'",
191
# "class_g = 'Thunderbird'"
192
];
193
round-borders = 1;
194
round-borders-exclude = [
195
#"class_g = 'TelegramDesktop'",
196
];

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:

1
# Arch install
2
yay -S zsh
3
# Debian? (from quick google search)
4
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.

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

Here's my .zshrc file

1
# _
2
# _______| |__
3
# |_ / __| '_ \
4
# / /\__ \ | | |
5
# /___|___/_| |_|
6
7
# Launch Starship
8
eval "$(starship init zsh)"
9
10
# Zplug (this is the location that arch installs zpl)
11
source /usr/share/zsh/scripts/zplug/init.zsh
12
13
# Colorize older terminal apps (like man)
14
# Start blinking
15
export LESS_TERMCAP_mb=$(tput bold; tput setaf 2) # green
16
# Start bold
17
export LESS_TERMCAP_md=$(tput bold; tput setaf 2) # green
18
# Start stand out
19
export LESS_TERMCAP_so=$(tput bold; tput setaf 3) # yellow
20
# End standout
21
export LESS_TERMCAP_se=$(tput rmso; tput sgr0)
22
# Start underline
23
export LESS_TERMCAP_us=$(tput smul; tput bold; tput setaf 1) # red
24
# End bold, blinking, standout, underline
25
export LESS_TERMCAP_me=$(tput sgr0)
26
27
# aliases
28
alias ls='exa --long --header --icons --sort=type'
29
alias tree='exa --tree --level 3'
30
alias sdn="sudo shutdown -h now" # Quick shutdown
31
alias cp="cp -i" # Confirm before overwriting something
32
alias pkg="yay -Q | fzf"
33
alias yt='youtube-dl --add-metadata -i'
34
alias cz='git-cz --disable-emoji'
35
36
# load the good parts from oh-my-zsh
37
# zsh auto completion
38
zplug "lib/completion", from:oh-my-zsh
39
# setups up histoyr
40
zplug "lib/history", from:oh-my-zsh
41
# Color highlighting in terminal
42
zplug "zdharma/fast-syntax-highlighting"
43
# Auto suggests commands based on history
44
zplug "zsh-users/zsh-autosuggestions"
45
46
# Install plugins if there are plugins that have not been installed (copied from the zplug readme)
47
if ! zplug check --verbose; then
48
printf "Install? [y/N]: "
49
if read -q; then
50
echo; zplug install
51
fi
52
fi
53
54
# # Then, source plugins and add commands to $PATH
55
zplug load
56
57
# run pfetch if terminal is interactive (https://github.com/dylanaraps/pfetch)
58
[ -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.

1
# Arch install
2
yay -S starship-bin
3
# Regular install
4
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).

1
# Arch install
2
yay -S exa
3
# Debian/ubuntu
4
sudo apt install exa
5
# 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