Ubuntu customizing


Whenever possible I prefer dark themes. More and more smartphone apps offer a light and dark theme. Desktop applications and operating systems seem to follow this trend.

Professionally and privately I am choosing Ubuntu as my operating system. My preferred themes so far:

Application themes

Gnome shell themes

I mostly use the Gnome shell theme that comes with the application theme. Sadly the default theme shipped with Ubuntu 19.10 Eoan (Yaru theme) does not yet support dark background colors. But there is a manual fix for the time being:

One nice Gnome shell theme worth mentioning is:

  • Pop (dark slim)
    From System76 Pop Os:
    When using default Yaru dark theme I still use this Gnome shell theme as it supports dark background for notifications (seems broken in default Yaru dark theme…. as of 19.04)

Cursor and icon themes

  • Yaru (available by default)

Gnome shell extensions

Favorite extensions

  • Better Volume Configurator
  • Blyr
  • Dash to Dock
  • Dynamic Panel Transparency
  • Disconnect Wifi
  • Frippery Move Clock
  • gTile
  • Hide Activities Button
  • NoAnnoyance
  • Remove Rounded Corners
  • Sound Input & Output Device Chooser
  • User Themes

Laptop extensions

  • Autohide Battery

Terminal and shell

Tried using fish for some time and liked it but had a hard time un-/relearning several small things that I got very used to during almost two decades using bash (e.g. $_).

Randomly stumbled upon this video on /r/linux and fell in love with the very visual PowerLevel10K theme for ZSH… which luckily is also more similar to bash in its usage:

PowerLevel10K is a drop-in replacement for PowerLevel9K. It supports all its settings but has some improvements. Take a look about some of its features: https://medium.com/@alex285/get-powerlevel9k-the-most-cool-linux-shell-ever-1c38516b0caa

ZSH + P10K + Nerd Fonts

To install the shell and setup PowerLevel10K with Nerd Fonts:

1. Install ZSH

sudo apt install zsh

2. Change default shell

chsh -s /bin/zsh

Right after I did a reboot so that the default shell was also applied when I opened gnome-terminal (CTRL+SHIFT+T)… was too lazy to look up the command to hot-reload the new configuration. Maybe logout/re-login would have sufficed too.

3. Install Oh-My-Zsh

Oh-My-Zsh is a configuration framework for ZSH.

sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

Choose the options you prefer during the install wizzard. According to the video Oh-My-Zsh will be configured to automatically be updated periodically with this method, which I find very useful.

4. Install your preferred Nerd Font

Install from https://github.com/ryanoasis/nerd-fonts

I chose “manual” installation method and downloaded the patched “Hack” font here: https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/Hack

Make sure to follow the instructions in the installation section.

Only downloading the patched TTF files somehow did not work for me. I also had to install the normal Hack font to make it work. Otherwise I could not select “Hack Nerd Font Mono” as default font in Gnome-Terminal Profile. The font just would not show up.

The steps basically were:

  1. Downloading the latest Hack font ZIP (from the above linked page install instructions section).
  2. Downloaded Regular, Bold, Italic, Bold Italic patched fonts from the above linked page (going into every folder into “completed” and downloading the two ttf file (monospace and non-monospace) without “Windows Compatible” in the name.
  3. Put all ttf files into my local font directory: “~/.fonts”

5. Set default Font in Gnome-Terminal

…or in your own favorite terminal emulator.

In Gnome-Terminal:

  • Open Preferences
  • Switch to your current profile (in my case “Default” was active)
  • Right in the “Text” tab check “Custom font” and select “Hack Nerd Font Regular” as your preferred font

6. Install PowerLevel10K Theme for ZSH

cd ~/.oh-my-zsh/themes/
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git

Choose your preferred options during the setup wizzard.

The very first three questions all verify that you Nerd Font is working as expected. If you can answer all three questions with yes then your Nerd Font was installed correctly.

You can always re-run the wizzard using “p10k configure” on the command line at a later time (config file ~/.p10k.zsh):

p10k configure

7. Update your ZSH config

vi ~/.zshrc

Set the theme, font and unset option “nomatch” to make zsh behave more similar to bash:

unsetopt nomatch

8. (Optional) Visual Code integrated terminal

If you are using Visual Code you might want to set your nerd font to be used in the integrated terminal too.

To do this you just add custom configuration parameters to your settings.json:

vi ~/.config/Code/User/settings.json

You only really just need the first line. I copied several more settings from another sample I found online:

    "terminal.integrated.fontFamily": "Hack Nerd Font",
    "terminal.integrated.cursorBlinking": true,
    "terminal.integrated.enableBold": true,

9. (Optional) TTY console

I am also frequently using the TTY console. In theory it should be possible to install a PSF (bitmap) nerd font and configure console to use the font. The easiest fix for me was to load a different zsh config when in a TTY console. That also solves coloring issues as TTY console typically only supports 8 colors instead of 256.

I made a copy of ~/.p10k.zsh and created another ~/.p10k.zsh specifically for the TTY console (not using nerd font, 8 color mode, etc).

p10k configure

After that I renamed the new ~/.p10k.zsh config to ~/.p10k.tty.zsh and restored the backup config to its original location.

Then I edited two sections in the .zshrc

vi ~/.zshrc

First section (when setting the theme):

# only set mode to nerdfont-complete if not in TTY console
if [ `tput colors` = "256" ]; then

Second section (at the end of the file):

# check if TTY console and load different configuration
if [ `tput colors` != "256" ]; then
  [[ ! -f ~/.p10k.tty.zsh ]] || source ~/.p10k.tty.zsh
  [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh