Jiwon's Encyclopedia

I've long held a bit of a fascination on the command-line interface (CLI), but was scared to approach it. Experienced programmers vouched for the power of the command line, its efficiency, and flexibility. Furthermore, as Matt Might recommends, the command line is extremely conducive to productivity, as there are little avenues for distractions. That's why I decided to learn how to live in the command line.

Regolith Tiling Manager

Choosing a Linux Distro

Of course, if you're going to live and thrive in the command line, you should probably use Linux. I had distro hopped around a bit in recent months, trying out everything from Ubuntu to Fedora to Manjaro. While I loved using the i3 tiling window manager with Manjaro, I missed some niceties that come with Ubuntu-based distros.

  1. There are extensive guides and articles online for troubleshooting Ubuntu.
  2. Non-English language support is more seamlessly baked in.
  3. I could never get my speakers to work in Manjaro, whereas Ubuntu-based distros come with nonfree drivers that ease the process.
  4. i3, while incredibly extensible, is a nightmare to set up. For instance, something as simple as changing the desktop wallpaper is a chore for beginners.

That is when I stumbled into two projects that attempt to create a tiling window manager experience within GNOME: Regolith and Pop! Shell. The former is a custom desktop environment built on top of i3 and GNOME. The latter, on the other hand, gives tiling window management capabilities into the Pop!OS desktop environment. Since the latter is not yet released, I settled with Pop!OS + Regolith as my Linux setup.

Some may wonder why I didn't go with Ubuntu + Regolith, which works perfectly fine. Here's a few reasons why I chose Pop!OS over vanilla Ubuntu:

  1. Pop!OS comes with less bloatware than Ubuntu.
  2. Pop!OS desktop environment looks more modern out of the box than Ubuntu.
  3. Pop!OS comes with the most recent drivers that ease the process of gaming on Linux.
  4. System76 behind Pop!OS have less controversies surrounding them than Canonical.
  5. System76's roadmap of their OS is incredibly promising, and I want in on the action.

Installing and Configuring Pop!OS

The installation process of Pop!OS was painless. I simply followed the official docs and the on-screen prompt to erase the disk and install Pop!OS.

Then, these were the first things that I did to set up my work environment:

  1. I troubleshot network connections. For some reason, the school's wifi only works if I set my IP address as "stable."
  2. I set up basic system settings with the bundled Settings app. I configured some keyboard shortcuts and input languages. In particular, I remapped screenshots as my keyboard doesn't have a PrintScreen key, and I remapped the shortcut for changing input language, as it was overriden by Regolith's default keybinding.
  3. I went ahead and uninstalled all unnecessary applications.

These unnecessary applications are GUI apps that I plan to replace with CLI during this adventure. So Thunderbird, Gnome Calendar, Gnome Tasks, and any GUI text editors were exiled from my system.

On the other hand, there are some GUI apps that I installed out of necessity: Zoom, Anki, pCloud Sync, and Discord. While some rudimentary command-line applications for these services exist, they do not meet my needs. For instance, offline sync capability for pCloud is only available via Electron GUI app.

While I'd love to be able to completely substitute GUI web browsers with TUI web browsers for this experiment, some mission-critical websites rely on Javascript. Where possible, however, I will be using tools like mps-youtube, Newsboat, and Links2 for internet media consumption.

Configuring i3 Window Manager and XTerm

A great thing about i3 and XTerm, my terminal emulator of choice, is their customizability. These are some preliminary configurations I made for improved quality of life.

XTerm's appearance in ~/.Xresources

The ~/.Xresources file customizes terminal emulators' appearance. As I use XTerm instead of URXVT, I first deleted all lines specific to URXVT.

I increased the font size from 12 to 15 such that my eyes don't bleed all day:

xterm*faceName: Monospace
xterm*faceSize: 15

I made some customizations to the color scheme. These lines set the terminal as true color mode and make it pretty.

xterm*termName: xterm-256color

xterm*foreground: #d0d0d0
xterm*background: #272822

xterm*color0: #303030
xterm*color1: #d0d0d0
xterm*color2: #66AA11
xterm*color3: #c47f2c
xterm*color4: #30309b
xterm*color5: #7e40a5
xterm*color6: #3579A8
xterm*color7: #9999AA
xterm*color8: #303030
xterm*color9: #ff0090
xterm*color10: #80FF00
xterm*color11: #ffba68
xterm*color12: #5f5fee
xterm*color13: #bb88dd
xterm*color14: #4eb4fa
xterm*color15: #d0d0d0

xterm*boldMode: true

xterm*pointerColor: white
xterm*pointerColorBackground: black
xterm*cursorColor: yellow
xterm*cursorBlink: true

Terminal QoL

Adding the following line in ~/.inputrc will make directory and file autocompletion case insensitive. It's nice to not have to remember whether some files start with uppercase or lowercase!

set completion-ignore-case on

These are some terminal aliases stored in ~/.bashrc I can't live without:

# Displays subdirectories and files in list form, with human-redable file size, including hidden files
alias ll="lls -lha" 

# Displays weather forecast in metric, meters per second (wind velocity), and in narrow formatting
alias wttr="curl wttr.in/?mMn

# Use neovim as the default text editor instead of vim or vi
alias vim="nvim"
alias vi="nvim"

# Use htop as the default process monitor instead of top
alias top="htop"

# Update all packages in Ubuntu-based distros
alias upup="sudo apt-get upgrade && sudo apt-get update"

# Update all packages in arch-based distros
alias pacup="sudo pacman -Syu"

Configuring i3 Window Manager

The configurations for i3 is stored in ~.i3/config and is easily modifiable by reading the comments and documentation.

I made xterm the default terminal instead of urxvt:

bindsym $mod+Return exec xterm # Launch xterm instead of urxvt via keybinding
bindsym $mod+Ctrl+b exec xterm -e 'bmenu' # Launch bmenu in xterm instead of urxvt
bindsym $mod+F5 exec xterm 'cmus' # Make cmus in xterm the default music player
bindsym $mod+F6 exec xterm 'ranger' # Launch ranger file manager from xterm

I made firefox the default web browser:

bindsym $mod+F2 exec firefox

i3 uses jkl; keys for navigation by default. I changed them to the vim-style hjkl keybindings:

# Change focus
bindsym $mod+h focus left
bindsym $mod+j focus down
bindsym $mod+k focus up
bindsym $mod+l focus right

# Move focused window
bindsym $mod+Shift+h move left
bindsym $mod+Shift+j move down
bindsym $mod+Shift+k move up
bindsym $mod+Shift+l move right

This may be an unpopular choice, but I removed all workspaces escept two and the scratchpad. This helps me stay focused without having lots of applications open in the background, fragmenting my attention. I would, of course, create more workspaces on a laptop with small screen real-estate or a multi-monitor setup.

set $ws1 1
set $ws2 2

bindsym $mod+1 workspace $ws1
bindsym $mod+Ctrl+1 move container to workspace $ws1
bindsym $mod+Shift+1 move container to workspace $ws1; workspace $ws1

bindsym $mod+2 workspace $ws2
bindsym $mod+Ctrl+2 move container to workspace $ws2
bindsym $mod+Shift+2 move container to workspace $ws2; workspace $ws2

I removed pamac-manager (install applications) and pcmanfm (file browser) from opening in floating mode by commenting these lines:

# for_window [class="application name here"] floating enable

I removed all gaps in between workspaces to maximize screen real-estate:

gaps inner 0
gaps outer 0

I increased the time it takes for the screen to autolock from 10 minutes to 2 hours:

exec --no-startup-id xautolock -time 120 -locker blurlock

I made some programs automatically start when i3 launches:

# ibus input language UI
exec_always ibus-daemon -drx --panel /usr/lib/ibus/ibus-ui-gtk3

# pcloud client for syncing files to local drive
exec_always pcloud

©️ CC-BY Jiwon Chang 2021