My Minimalist Over-powered Linux Setup Guide

I started off with Microsoft Windows. I’ve always lived on visual interfaces. But as I slowly started using Powershell with gitBash and WSL, I start seeing the power of the command line. That started my journey with Linux (and not wanting to buy an OS for my new laptop). I’ve enjoyed it so far and since have not looked back. This is my guide to helping you setup your first Linux machine and with a nice minimalist OS visual interface (as most of the time you’ll want to be on command line).

I’ll guide you with what I reckon are vital for your OS. Some explanation on why I pick them and code blocks that have bash commands shown after $ symbol and comments after # symbol.

OS of choice: Ubuntu 17.10

Mainstream heavily supported. And now uses GNOME shell, which has a huge community.

There are some bloatwares that I don’t use. But I’ll let you decide what you want to keep and remove.

Applications

Enhance Activity’s Search

Ubuntu’s Search is good enough and you don’t need an external application (eg: Albert) to improve your OS search capabilities.

Update: Ubuntu 17.10 isn’t using unity no longer so unity-lens plugins won’t work.

I now have Wikipedia Search Provider as gnome extension and gnome-todo, which syncs with Todoist (A ToDo app i use).

Changing the File Explorer’s address bar

One thing I didn’t like about the default windows/directory explorer was the rigid navigation bar. I’d rather type than click. Below are some commands to help you convert that into an address bar.

Before and after toggling always-use-location-entry
$ sudo apt-get install dconf-tools# Open dconf-editor
# In dconf-editor navigate to: org –> gnome –> nautilus –> preferences
# Toggle on always-use-location-entry

Shutter

The default screen capture is nice — just nice. But if you often need to take screenshots and draw over it Shutter is what you need

sudo add-apt-repository ppa:shutter/ppa
sudo apt-get update && sudo apt-get install shutter

Bleachbit

If you were a Windows user and loved CCleaner, here’s the equivalent to take your disk freeing task beyond the recycle bin https://www.bleachbit.org/download/linux install the deb file from there.

Gnome extensions

Now that Ubuntu is on Gome shells. It’s going to be easy to add extensions to the OS’s shell via the Gnome website. Below are the extensions I recommend and why. Install them through the website.

  • Apt Update Indicator — A panel indicator to notify when any of your packages have an update.
  • Caffeine — Have screensaver and screen suspend settings? This allows to override them when you’re watching a movie.
  • Clipboard Indicator — Stores all copied text in a history so you can re-use any of it later on.
  • Drop Down Terminal — When you need to do a quick apt-get install or one-off linux command, this will open a quake-like terminal so you don’t have to waste time.
  • Printers — Panel indicator to show printing status (I’ve set mine to show only when there are printing jobs).
  • Touchpad Indicator — If you’r using a laptop this is a must-have!
  • Launch new instance — We’ll be using the search dash quite a fair bit, this will open a new instance of any application we select.
  • Trash — A panel indicator to manage the recycle bin, seeing there won’t be for the minimal setup.
  • Activities Configuration — This is the crux to get the minimal top panel look. It removes all the clutter and default application tabs on the panel (perhaps forces to use the terminal more). Have a play with it.
  • Frippery Move Clock — I don’t like the look of the clock in the middle. This allows you to move it like in the screenshot.
  • Remove Dropdown Arrows — Few panel indicator have dropdowns. Once familiar the dropdown becomes white noise. This helps you get rid of it.
  • Status Area Horizontal Spacing — Customises the spacing between the icons in the top panel.
  • Emoji Selector — I love emojis, till keyboards have build-in emoji, this is the next best thing to copy emoji text.
  • System Monitor — Shows any overused memory or CPU usage in red icons.

Shell for the win!

Whilst you’re using Linux, you might as well embrace the foundation it was built upon — the shell. It will help you accomplish much without having to use the mouse; though beware there is a learning curve.

You can manage your filesystem (delete, create, move and copy and paste etc), install and run applications and do complex task all from just text commands (reminds me of my MUD heydays). If you’re serious about being a terminal user, here’s an extensive guide: https://github.com/jlevy/the-art-of-command-line

The following guide is to help install useful tools and a better shell platform/framework to ease your life in a shell world.

Gnome terminal with Neofetch’s output

Gnome-terminal

This is the default terminal. It’s simple and gets the job done. Uses tab which is a familiar mechanism. If you prefer tiling terminals Tilix is a nice option. More can be found on k4m4’s terminals-are-sexy repo.

Zsh + Prezto your new favourite Shell setup!

I won’t convince you why Zsh is the way to go instead of bash; but they will: here, here, and here.

> sudo apt-get install zsh

Prezto is a configuration framework for Zsh. It’s much lighter and faster than Oh-my-zsh. Prezto gets the job done and I don’t use the extensive plugins oh-my-zsh provides. (Alternatively, Fish shell is another out-of-the-box user-friendly shell you can explore)

# Enter into zsh
> zsh
# Choose option (1) Continue to main menu$ git clone --recursive https://github.com/sorin-ionescu/prezto.git "${ZDOTDIR:-$HOME}/.zprezto"$ setopt EXTENDED_GLOB
$ for rcfile in "${ZDOTDIR:-$HOME}"/.zprezto/runcoms/^README.md(.N); do ln -s "$rcfile" "${ZDOTDIR:-$HOME}/.${rcfile:t}" done
# Set default shell to zsh
chsh -s /bin/zsh

Log out and log in

Now log back into your terminal and type zprezto-update . This will check if there are any update. If there were, follow the instructions below

$ cd $ZPREZTODIR
$ git pull
$ git submodule update --init --recursive

Time to Configure ~/.zpreztorc with Pure prompt theme and the recommended modules. This will give you autocomplete, history search, command suggestion when entered wrong, and highlight commands with colours.

zstyle ':prezto:module:prompt' theme 'pure'
# The order matters.
zstyle ':prezto:load' pmodule \
'environment' \
'terminal' \
'command-not-found' \
'history' \
'directory' \
'spectrum' \
'utility' \
'completion' \
'syntax-highlighting' \
'history-substring-search' \
'autosuggestions' \
'prompt'

Neofetch

Displays information about your shell and linux environment. Notice the info on the terminal screenshot? That’s neofetch.

$ sudo add-apt-repository ppa:dawidd0811/neofetch
$ sudo apt update && sudo apt install neofetch

If you’d like this to be your opening display for a zsh terminal, update .zshrc to include neofetch command at the end.

Recommended terminal size for a full neofetch view would be 90 columns and 28 rows.

zsh-notify

Uses the desktop’s notification to indicate when a command completes or when it took more than 30 seconds to complete.

$ git clone https://github.com/marzocchi/zsh-notify.git ~/.zsh-notify
$ echo 'source $HOME/.zsh-notify/notify.plugin.zsh' >> ~/.zshrc

CLI Tools

Colorls

The ls command is one of the best way to view files, even beats Window’s dir . If you’re someone who wants to see more information quickly on your file directory and love color and emoji, this add-on to the CLI suits you. (If you prefer minimal, color-coded and speed, Exa could be an altenative to try out)

An example of colorls aliased to ls

Colorls installation is slightly complicated, so i’m going to break down the steps:

  1. Install Ruby
# If you're a Ruby dev, I recommend this: https://gist.github.com/jonyeezs/0cd34840004ca2052ff74378e15b39c0
# Or simply
$ sudo apt-get install ruby-full

2. Install the fonts

The instructions given is base on the font i use: Ubuntu mono regular (which is the default). To find out your font go to Tweaks tool >Fonts > Monospace.

Now go to Nerd-Fonts and download the icons. Below are the commands to do that for Ubuntu mono regular.

mkdir -p ~/.local/share/fonts
cd ~/.local/share/fonts && curl -fLo "Ubuntu Mono Nerd Font Complete Mono.ttf" https://github.com/ryanoasis/nerd-fonts/blob/master/patched-fonts/UbuntuMono/Regular/complete/Ubuntu%20Mono%20Nerd%20Font%20Complete%20Mono.ttf?raw=true

Now go back to Tweak > fonts. Re-select the monospace font to Ubuntu Mono Nerd Font Complete Mono.

3. Install colorls

gem install colorls

4. Include following code into~/.zshrc

source $(dirname $(gem which colorls))/tab_complete.sh
alias ls='colorls --sd'

5. Profit by restarting your zsh: . ~/.zshrc

# Display as single line files 
$ ls -1
# With hidden files
$ ls -a
# With all information
$ ls -al
# Display as tree structure whilst hiding files that maybe unnecessary to show
$ ls -tA

To update gem update colorls .

Enhancd

Enhances the humble cd command. It remembers your previous navigated directories and no more ../../../../ back pedal. An easy way to have a cd history.

$ wget https://github.com/jhawthorn/fzy/releases/download/0.9/fzy_0.9-1_amd64.deb
$ sudo dpkg -i fzy_0.9-1_amd64.deb
$ git clone --depth 1 https://github.com/junegunn/fzf.git ~/.fzf
# The following command will have prompts. Do as you will
$ ~/.fzf/install
$ git clone https://github.com/b4b4r07/enhancd ~/.enhancd
$ echo 'source ~/.enhancd/init.sh' >> ~/.zshrc
$ echo 'ENHANCD_FILTER=fzy:fzf; export ENHANCD_FILTER' >> ~/.zshrc
$ echo "ENHANCD_HOOK_AFTER_CD='ls -A';export ENHANCD_HOOK_AFTER_CD" >> ~/.zshrc

$ . ~/.zshrc
# Most use scenarios# 1. View options in a search finder
$ cd
# 2. List the last 10 navigated directories
$ cd -
# 3. Navigate to parent directories
$ cd ..

TLDR

manual for curl with examples

Sometimes you want to see what a command does. Manuals can be long and hard to navigate. This basically makes it tldr. There’s an alternate that gives colors but its not often this gets used.

Here’s how to install:

$ sudo curl -o /usr/local/bin/tldr https://raw.githubusercontent.com/raylee/tldr/master/tldr
$ sudo chmod +x /usr/local/bin/tldr

Yank

This allows you to copy parts of an output from a terminal. Had huge tables but just wanted to copy that one cell? Mouse drags can be a real drag! Install this

$ sudo apt-get install yank# To yank straight to clipboard add this alias to ~/.zshrc
alias yank='yank-cli -- xsel -b'
# all other opts availabe through yank-cli
# Try these commands
$ ls -lh | yank
$ ps ux | yank-cli | xargs kill

gkill

I do this alot in windows, kill processes. When things go sour and I want to end my relationship with a process that just won’t leave me, kill it. Gkill offers that in a nice interactive shell way. You’ll need to install go-lang first

$ umake go
$ go get github.com/heppu/gkill
# Find out the path where bin/gkill was installed
$ sudo find / -name "gkil"
# Set the path to ~/.zprofile as example like my /home/jonathan..
path=(
/usr/local/{bin,sbin}
/home/jonathan/go/bin
$path
)
# restart the shell and try it
$ gkill

Programmer segment of the post

love posh-git when i was on Windows. Thankful this guy ported it over to linux, what a champ! If you look slightly above my prompt on my terminal screenshot, you’d notice a [master ↓ +1 ~4 -0] , that’s posh-git showing you the current status of your git repo. Here’s how you can have this beauty:

$ git clone https://github.com/lyze/posh-git-sh.git ~/.posh-git-sh

open ~/.zprezto/modules/prompt/functions/prompt_pure_setup and edit these lines

# import the git-prompt
. ~/.posh-git-sh/git-prompt.sh
prompt_pure_preprompt_render() {
...
# Slightly further down, change the git info as below
...
# Add git branch and dirty status info.
typeset -gA prompt_pure_vcs_info
if [[ -n $prompt_pure_vcs_info[branch] ]]; then
preprompt_parts+=("%F{$git_color}"'$(__posh_git_echo)%f')
fi
# Git pull/push arrows.
# if [[ -n $prompt_pure_git_arrows ]]; then
# preprompt_parts+=('%F{cyan}${prompt_pure_git_arrows}%f')
# fi

Empowering your Git Command line.

I use Meld for visual diff tool. It doesn’t over-complicate 3-way merges and simplistic in design.

$ sudo apt-get install intltool itstool gir1.2-gtksource-3.0 libxml2-utils
$ git clone https://git.gnome.org/browse/meld ~/.meld
$ cd ~/.meld
$ sudo python3 setup.py install
$ git config --global merge.tool meld
$ git config --global mergetool.meld.trustExitCode true
# To upgrade
$ cd ~/.meld
$ git pull
$ sudo python3 setup.py install

Sometimes default diff on command line can be a pain. Great improvements have been made, but i still prefer this add on diff-so-fancy. It suits up diff, may somewhat look like it’s overly imagery but I like how it separates what I need to see. Here’s how you can download it:

$ npm i -g diff-so-fancy
$ git config --global core.pager "diff-so-fancy | less --tabs=4 -RFX"

Follow instructions in this guide for more setup help: https://github.com/jonyeezs/gitreference/wiki/Getting-your-Git-up

Containerize your world

Docker is a great way to develop your applications in a self contained environment or . You may have heard of Canonical’s Snap— same concept but this is highly adopted for developers whereas Snap is the consumer side for applications.

$ sudo apt-get update
$ sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Ensure you have the right gpg from instructions on https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository$ sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
$ sudo apt-get update
$ sudo apt-get install docker-ce
# Verify docker is installed successfully
$ sudo docker run hello-world
# If you don't wish to type sudo for every docker command, Here's how
$ sudo groupadd docker
$ sudo gpasswd -a $USER docker
$ newgrp docker
$ docker run hello-world
# Helpful if you use dockly too...
# And here's how to upgrade
$ sudo apt-get remove docker
$ sudo apt-get update
$ sudo apt-get install docker-ce

Terminal for life with TUIs

Terminal UIs keeps you on the terminal without opening applications. Sometimes it feels gimmicky but these are a few useful ones I like.

HTop

View your processes visually and interactively, like Windows Task Manager’s process tab.

$ sudo apt-get install htop

GRV — Git Repository Viewer

If you want to keep staying in terminal, this is another sweet plugin that will let you navigate your branches, view commits and its diffs.

grv for a git repository
$ sudo wget -O /usr/local/bin/grv https://github.com/rgburke/grv/releases/download/v0.1.2/grv_v0.1.2_linux64
$ sudo chmod +x /usr/local/bin/grv
# Go to any git repository and type:
$ grv

GRV is insanely powerful! I don’t use most of the features other than viewing commit history. If you’re interested check out their thorough documentation.

Dockly

If you use Docker, here’s one for you. You get to see all your containers, their health and as well their logs. Check out their repo for a gif demo.

$ npm install -g dockly
$ dockly

Well that’s all from me. Enjoy your new setup and if there’s anything else you’d like to recommend, comment below and I’ll look into it. Hopefully I love it and add it to my guide.

Faith bound. Once suffered from Impostor syndrome. Now unafraid to lack. I share now and then my thoughts as a programmer and as a christian.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store