i3 laptop configuration: how to reduce performance to 100%?
I recently realized that my laptop is not performing well enough. It lacks the power to bring everything together: Vim (+ 20 plugins), VSCode (+ the same number of extensions), Google Chrome (+ 20 tabs) and so on. It seemed to be a common problem on laptops with 4 GB of RAM, but I did not give up. I love laptops for their small size and the fact that they can run on battery anywhere. I just needed to think about how to free up extra RAM, as well as increase energy efficiency.
If you need configs right away, then scroll down to the section "Picking up the installation"
Operating system
Since I need an OS that will eat the least amount of RAM and battery, I chose Arch Linux. Classic, nothing new. Its repositories will allow me to automate a bunch of unnecessary work, and AUR will save even more time.
window manager
I decided to take the window manager, and not a full-fledged environment. Although I like sneakers (KDE), they still eat quite a lot, due to the fact that they pull a lot of libraries and dependencies with them. Well, by itself DE'shka eats quite a lot because of all sorts of unnecessary widgets.
Parsing the installer
First we need to install all the main packages (we need to configure something)
xwinwrap
Required to install .gif files as animated wallpapers
polybar
Needed in order for the window manager to display the topbar
i3
The window manager itself
i3 gaps
Window manager extension
base-devel
Components needed to install polybar
rofi
Application Launcher
okulate
Document viewer
zathura
Document viewer (fewer extensions supported, but more minimalistic)
feh
Program for viewing pictures, as well as for setting background images
vim
Main editor
queues
Additional editor
picom
Composer (a program that creates shadows, transparency, blurs the background)
kitty
Main terminal
urxvt
Additional terminal
creak
File Manager
git
Version control system
xdotool
A utility that will help in developing scripts and interacting with windows
xautolock
A utility that locks the computer when idle and launches i3-lock
i3lock color
Improved version of i3lock. The program is needed to lock the computer and enter a password
scrotum
Minimalist screenshot app
imagemagick
A program that will help when interacting with pictures (blurs them in advance, converts, changes resolution)
Configuring i3
i3 - A window manager that does not consume a lot of resources, thus, it will be useful to us in order to "emulate" other ordinary window managers. (The gift, of course, is tiling - the ability of the window manager to expand applications to the entire free part of the screen)
I will provide the config i3 in parts, so that even beginners understand everything. Let's start with the most important - the button $mod. It serves to interact with i3. All major hotkeys will pass through it.
### Tweaks ###
# Set main key (Win)
set $mod Mod4
Next, we will teach our window manager to move windows with the mouse when clicked. $mod
# Press MOD key and click on mouse to move your window
floating_modifier $mod
# Focus doesn't follow the mouse
focus_follows_mouse no
Let's install fonts for our applications, as well as for applications that depend on i3
# Fonts
font pango: JetBrains Mono 10
My idea was to make all the windows initially flying (Which turned out to be very convenient). For clarification: in i3 there are many kinds docking windows (Tilling, Fullscreen, Tabbed, Float, Stacking), they are all handy in different situations, but I see no reason to do all windows fill the entire screen. Better let them fill it when pressed $mod + f, but hang in the air by default, which I did in the following piece of code:
# Maximum width for floating windows
floating_minimum_size 400 x 350
floating_maximum_size 1800 x 900
# (1920 - 10)/2 and (1080 - 10)/2
for_window [class=".*"] floating enable
for_window [class=".*"] resize set 955 535
for_window [class=".*"] focus
In order not to confuse the expression (1920 - 10)/2 and (1080 - 10)/2 means that each window will take up a quarter of the screen, and will also be indented (from each other) by exactly 5 pixels (5 on all sides).
Next, let's bind all the main applications. All hotkeys try to follow this scheme.