Creating a killer customised Linux distro with Arch & i3: Part III

A blank slate

Now, since I’m assuming you’ve followed my other 2 parts of this guide to get here, you’re probably looking at something like this:

A very dull, black and maybe a little boring looking desktop.

You might be thinking; did I go back to the 90s with my PC?

Don’t worry though, I will help you making your desktop look like an amazing, abstract piece of art.

Assuming you’ve followed the previous parts of this guide, I take you have installedi3.
You also finished the initial configuration, where you assigned either Alt or the Super key for use within i3, which I will be referring to as the “Mod”-key.
You now have to create a copy of the default i3 config to a location where its contents get read by i3, while not breaking your default i3 config.
This is done as follows:
mkdir ~/.i3 followed by: sudo cp /etc/i3/config ~/.i3/config.

You can now open ~/.i3/config with your favourite editor. You will see something similar to this:

Changing the default terminal

Now, with the i3 config open, we’ll make our first change to the default i3.
Search for the line bindsym Mod1+Return exec i3-sensible-terminal. This line indicates which terminal emulator i3 will use when you press Alt+Enter.
Since we’ve installed termite earlier, we’ll tell i3 that this is the terminal emulator we’d like to use from now on.
You can do it as follows:
Change the part i3-sensible-terminal with termite. Easy as that!
Now save your config, and press your Modifier key, Shift and R to reload your script.
Open a new terminal window, and you’ll see it has changed (the right one is termite):

Changing that dull black background!

Obviously, you’ll need an image first to put as a background!
Open up your browser with firefox & and look for a nice image large enough.
I found a nice wallpaper, and created a folder Wallpapers under my home directory:

In order to “test drive” your new wallpaper, type the following command:
feh --bg-scale ~/Wallpapers/wp.jpg
If you close your terminal with Mod+Shift+q, you’ll see your new background:

If you’re happy with your new wallpaper, be sure to add this line to the bottom of your i3 config file:
exec feh --bg-scale ~/Wallpapers/wp.jpg

Transparency

I can almost hear you thinking; why would I set a wallpaper if I can’t see it?
Good question. However, you can set the transparency of your applications (mostly your terminal) with the use of compton.
You can do this as follows:
First off, create the compton configuration files with the following command:
sudo cp /etc/xdg/compton.conf ~/.config/compton.conf
Now, open up your newly created compton configuration files with your favourite editor:

With the config file open, add the following line:
opacity-rule = ["85:class_g = 'Termite'"];
What this line does, is set the transparency of the application Termite, to 85%. Feel free to tweak the number around a bit, but I’ve found 85% comfortable.
Once you’ve saved your configuration file, use the following command:
compton


As you can see, there’s a slight transparency in your terminal and you can see your background!
Kill your compton process with Ctrl-C and open your i3 configuration file again.
At the bottom of your configuration file, add the following line:
exec compton -b, where the “-b” flag starts compton as a daemon:

Launcher

i3 comes with it’s own launcher by default; dmenu, but I don’t care for it too much, honestly.
Below is a screenshot of dmenu:

I prefer rofi because it is very customisable.
Using rofi instead of dmenu works as follows:
Open your i3 configuration file and search for the line:
bindsym Mod1+d exec dmenu_run
Comment this out by adding a hash in front of it, then add the line bindsym Super_L exec rofi -show run:

Save your configuration and reload it with Mod+Shift+r.
Now, if you press the left Super key; you will see the Rofi launcher:

Obviously, it is possible that you don’t like the colour scheme of rofi.
Thankfully, the creator of Rofi, Dave Davenport, has created a theme generator, where you can create a colour config with a GUI and paste the outcome in a configuration file.
You can find the generator here.
Below you can find a modded rofi, by creating a colour scheme on aforementioned site and pasting it in ~/.config/rofi/config.

Bars

Ah, there’s nothing I like more than a good bar.
Now, before you start labeling me as an alcoholic, I’m talking about toolbars.
i3 comes with it’s own bar by default, called i3bar.
But we’re not too big of a fan of that one, are we?
The previously installed polybar looks a lot better and has way more customisable options.
Configuring it is done as follows:
First off, create a directory for the configuration files: mkdir ~/.config/polybar
Then, copy the default configuration files to the previously created directory:
sudo cp /usr/share/doc/polybar/config ~/.config/polybar/config
To test out polybar, run the following command:
polybar example &

First off, we’ll configure polybar to our liking:
Open up ~/.config/polybar/config in your favourite editor.
Then, copy the entire block [bar/example] and paste it again; this time renaming the [bar/example] to [bar/bar1] (or whatever other name you feel like).
Within this [bar/bar1], you can edit to your heart’s extent.
Check out Polybar’s wiki for more info on this.
After you’ve done this, create a file called launch.sh in your polybar config directory, containing:

#!/usr/bin/env sh

# Terminate already running bar instances
killall -q polybar
# Wait until the processes have been shut down
while pgrep -x polybar >/dev/null; do sleep 1; done

# Launch bar1
polybar bar1 &

echo "Bars launched..."

Once you’ve done this, make launch.sh executable by issuing the following command:
sudo chmod +x launch.sh
Then, open up your i3 configuration file again and do the following:
Comment out the entire i3bar section:

Subsequently, go to the bottom of the configuration file and add the following:
exec_always --no-startup-id ~/.config/polybar/launch.sh
Reload your i3 configuration file with Mod+Shift+r and you should see your new polybar!

Feel free to customise your polybar to your hearts extent, with the help of the Polybar wiki.

Obviously, if you have some questions, be sure to comment on this article and I’ll get back to you!

Knowledge is power

Let’s face it, the highlight of being in control of your OS is that you know everything about your system at a glance, at any given time.
Then what else is better than having a customisable hardware and system monitor built into your desktop?
Well, that is all possible with conky.
conky is able to read out all kinds of different information from your system, ranging from temperature to disk I/O.
To have a conky set up to configure it to your own liking, execute the following commands:
conky -C > ~/.conkyrc
What this command does is copy the default configuration file into your home directory, so you can tamper with it.
Once you issue the command conky -b, it will run as a background daemon.
To kill the process, issue pkill conky.
You can now open ~/.conkyrc and play around with it.
The variables you can use are clearly explained on the conky github page, which is listed at the end of this guide.
A few tips for conky;
To achieve transparency, change the following parameters in your config file:

own_window_type = 'override',
background = true,
own_window = true,
own_window_transparent = true

Once you’ve added or adapter these lines in your conky configuration file and save, you will see that conky will automatically refresh with the new configuration.

If you’ve followed this guide, you should have a pretty solid basis for a customised Linux installation with Arch Linux and i3 as your window manager.
Obviously ricing your desktop is an entire process and everyone will have a different way of customising their desktop.
If you enjoyed this guide, be sure to let me know in the comments and don’t hesitate to ask any questions you have!

Sources:

Leave a Reply