Contents

Archlinux Post Install with minimal plasma


Introduction

This is the continuation of the Arch Linux installation’s part one. In the part one, we’ve installed Arch with as less afford as possible. In this part we’ll install from desktop environment to our GRUB setup with BTRFS snapshots integration and a lot of possibilities! In case you haven’t checked part one yet, it’s recommended if you want to install to Arch from scratch,

Prerequisite

If you’ve followed my part one, you are probably in a black background with white bash prompt. Feel free to login with your username, ‘root’ and your root account’s password. Now let’s check our system a bit,

Intenet

Check your internet connection with ping,

1
ping 1.1.1.1

Tip: Ctrl + c to stop a process

And it should work out of the box for Ethernet. This process is as same as installation of Arch Linux (part one). If you encounter any problem, check NetworkManager ’s status with,

1
systemctl status NetworkManager

If it’s disabled, you can enable and start with, systemctl enable and systemctl start command or just rebooting your system.

Boot time

Try, systemd-analyze to print your boot time. If your boot time is less than 15 seconds, you can check Arch wiki for performance guideline.

With an old HDD, my boot time was around 11 seconds.

User Management

To learn deeply about user management’s I would recommend you to read the arch wiki. For now, I’ll create a user with root privileges so that I don’t have to stay in root. Later after installing KDE plasma desktop, I can mange users in the system setting, so, for now let’s create a user.

1
useradd -m -G wheel arch

Here, -m to create a home directory. And if it exists then it won’t be overwritten. And the -G flag is to set a group. Here wheel group users can actually run sudo commands. And finally arch is my username.

Now, let’s set a password for our new user, arch,

1
passwd arch

Now we’ve to give access to wheel group users to actually able to run sudo commands, to do so, edit a file with the following command,

1
EDITOR=nano visudo 

Here, nano is the text editors name. Feel free to use your favorite text editor.

Then, I’ll un-comment the line (removing # from a line),

1
2
## Uncomment to allow members of group wheel to execute any command  
%wheel ALL=(ALL:ALL) ALL

In nano text editor you can use ctrl + w to search. Then press, ctrl + o to save, followed by an enter and then ctrl + x to exit.

Minimal Plasma

Now in this post, I’ll be installing minimal KDE plasma desktop environment without any bloat or any extra packages! So that if you need further packages or services like bluetooth or printer support, you can do it later. And of course, instead of plasma, you can try anything else like, gnome, xfce or maybe a window manager!

To install minimal plasma, try,

1
pacman -S plasma-desktop

Now, it’ll give you several choices. You can go with the default values. For font you can choose, noto-sans and as a back-end for media thumbnail in the file manager, you can try vlc as it’s recommended by upstream developers.

Plasma Essential

Besides a browser, for convenience we’ll install our favorite file manager and terminal utilities. And if you’re going for plasma we’ll also try some plasma integrations like, network manager support and kde plasmoids.

Let’s let it install and let me describe what they are,

1
pacman -S firefox plasma-nm plasma-pa dolphin konsole kdeplasma-addons kde-gtk-config

And here’s a short description,

Application name Application’s description
firefox A FOSS browser, which is favorite to a lot of linux users and you can also customize it with CSS. But of course you can also use anything else that you prefer.
plasma-nm Network manager integration with plasma. With this you can easily configure network with your plasma desktop.
plasma-pa
dolphin A file manger for plasma. It’s really recommended because of it’s availability, user interface and a lot of features out of the box.
konsole A terminal app for plasma. It’s highly configurable through GUI and easy to integrate with plasma.
kdeplasma-addons [OPTIONAL] Extra addons like color picker and monitor.
kde-gtk-config It’ll allow you to customize gtk apps through kde’s setting and recommended to install

More plasma-essentials are listed on, plasma extras section. Because plasma application needs to be installed with optional dependencies for extended features!

SDDM

For plasma’s login manager we’ll use SDDM, as you can integrate it with plasma’s setting. If you want you can also try lightdm or anything you like. To install SDDM, try,

1
pacman -S sddm sddm-kcm

sddm-kcm is only recommended when you’re installing plasma. It’ll integrate your sddm with kde’s setting. So you can customize your sddm right from kde plasma’s setting.

And the enable it’s service with,

1
systemctl enable sddm

And finally, start it with,

1
systemctl start sddm

Now you’ll be greeted with a default login window. Feel free to login with your created user.

Packages

Official packages

Arch has a great collection of free and open source software. And they are quite strict about their collection. You can browse through them from here,

AUR

AUR means Arch User Repository. It contains more packages than the official one and undoubtedly one of the main reason for a lot of people to actually use Arch Linux. Learn more about it from here,

Installing a AUR packages are rather simple! You can also use AUR helpers which do the job in the background so that you don’t have to make your hands dirty. Now yay and paru AUR helpers are quite popular.

To install an AUR package git clone it and then build it with makepkg or directly build and install with makepkg -si.

Third party repo

If you’ve used AUR then you may know how time consuming certain builds can be. Some AUR packages even take several hours for example browsers. That’s where third party repository comes in. One of the popular one is chaotic-AUR. They build packages automatically and put the binary in a hosting service so that you don’t have to build manually.

Chaotic AUR

Once you install chaotic-AUR you can just use your pacman to install from chaotic AUR. To setup chaotic AUR you can go to it’s official website and follow along. Or, make sure wget is installed (sudo pacman -S --needed wget) and run this script, it’ll do the job for you(made by me). Just open terminal and run,

1
wget -q -O chaotic-AUR-installer.bash https://raw.githubusercontent.com/SharafatKarim/chaotic-AUR-installer/main/install.bash && sudo bash chaotic-AUR-installer.bash && rm chaotic-AUR-installer.bash

Package management

Pacman

Arch linux use pacman to mange it’s packages. It’s really good and fast. You can learn about it with more details in the archwiki.

And for quick reference, you can check my handy reference,

And for configuration, you can set mirror just like you did in the arch installation process (part one),

Reflector

With reflector you can easily set a mirror. To do that, first let’s make sure our package list is with sync with server by,

1
pacman -Sy

then, let’s install reflector,

1
pacman -S reflector

then, you can use reflector to generate a mirrolist. Here’s an example,

My country is Bangladesh so I can display my available local mirrors in this way,

1
reflector -c BD

and, I can save this list to my mirrorlist in this way,

1
reflector -c BD --save /etc/pacman.d/mirrorlist

Manually mirror setup

We can use a text editor to edit the mirrorlist and set our desired mirrors also. To do that, you can use nano or vim text editor or install any CLI-based text editor if you need. And there’s an online arch mirror list generator,

Simply edit the mirrorlist file, like,

1
nano /etc/pacman.d/mirrorlist

Colored pacman

And another thing, you can actually make pacman’s output colored! To do so, just edit the /etc/pacman.conf file and un-comment the line Color (removing # from a line),

1
2
3
4
# Misc options
#UseSyslog
Color ## 33'th line (default)  
#NoProgressBar

Yay

Yay is mainly an AUR helper, that can install AUR packages automatically. And you can install it from chaotic-aur or aur. If you’re downloading from aur, then perhaps you can go with yay-bin which is a binary of yay. So you don’t have to wait for it to finish installation.

If you’ve installed chaotic-aur, then install yay with,

1
sudo pacman -S yay

Or, if you wish to install from AUR, try in this way,

1
2
3
4
pacman -S --needed git base-devel
git clone https://aur.archlinux.org/yay-bin.git
cd yay-bin
makepkg -si
Tip
If your pacman is colored then so will be your yay or paru AUR helper

Pamac

Pamac is a graphical installer for pacman with AUR support. And it can help you to install dependency packages much more easily. With sorting you can also list you orphaned packages or other packages into different categories. So if you wish to use pamac, you can install it from chaotic AUR, or from AUR.

If you’ve yay installed, then you can use it now in this way,

1
yay -S pamac-aur

Shell

By default your shell is bash. And you can enhance your possibilities with an another shell like zsh or fish. You can also do a lot with your .bashrc file. If you’re looking for a nice beautiful zsh shell with useful plugins like, auto coloring, auto completion then I’ve a separate tutorial for you.

And if you need a template for bashrc or zshrc then, I’ve it for you,

Timeshift

Now you may want to take snapshots, right? Let’s install timeshift. If you’re installing from AUR then perhaps the binary version?

timeshift-autosnap

timeshift-autosnap package will trigger timeshift to take a snap everytime when pacman upgrades your system. Just install it! Available in both chaotic AUR or AUR.

To configure it, use /etc/timeshift-autosnap.conf. But default configuration should be enough! You can test it with,

1
sudo timeshift-autosnap

GRUB

grub-btrfs

It’ll add btrfs snapshots in your GRUB boot options. To use, install grub-btrfs. And regenerate the grub.cfg with,

1
grub-mkconfig -o /boot/grub/grub.cfg

GRUB timeout

Every time you start your system GRUB shows up and waits 5 seconds for you, right? You can actually remove it. And grub will be shown if and only if you hold shift key while starting. In order to achieve the fastest possible boot, instead of having GRUB wait for a timeout, it is possible for GRUB to hide the menu, unless the Shift key is held down during GRUB’s start-up.

In order to achieve this, you should add the following line to /etc/default/grub:

1
GRUB_FORCE_HIDDEN_MENU="true"

Then create the file /etc/grub.d/31_hold_shift with,

1
sudo touch /etc/grub.d/31_hold_shift

Then, open the file with,

1
xdg-open /etc/grub.d/31_hold_shift

and paste following codes, source

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#! /bin/sh
set -e

prefix="/usr"
exec_prefix="${prefix}"
datarootdir="${prefix}/share"

export TEXTDOMAIN=grub
export TEXTDOMAINDIR="${datarootdir}/locale"
source "${datarootdir}/grub/grub-mkconfig_lib"

found_other_os=

make_timeout () {

  if [ "x${GRUB_FORCE_HIDDEN_MENU}" = "xtrue" ] ; then 
    if [ "x${1}" != "x" ] ; then
      if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then
    verbose=
      else
    verbose=" --verbose"
      fi

      if [ "x${1}" = "x0" ] ; then
    cat <<EOF
if [ "x\${timeout}" != "x-1" ]; then
  if keystatus; then
    if keystatus --shift; then
      set timeout=-1
    else
      set timeout=0
    fi
  else
    if sleep$verbose --interruptible 3 ; then
      set timeout=0
    fi
  fi
fi
EOF
      else
    cat << EOF
if [ "x\${timeout}" != "x-1" ]; then
  if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then
    set timeout=0
  fi
fi
EOF
      fi
    fi
  fi
}

adjust_timeout () {
  if [ "x$GRUB_BUTTON_CMOS_ADDRESS" != "x" ]; then
    cat <<EOF
if cmostest $GRUB_BUTTON_CMOS_ADDRESS ; then
EOF
    make_timeout "${GRUB_HIDDEN_TIMEOUT_BUTTON}" "${GRUB_TIMEOUT_BUTTON}"
    echo else
    make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
    echo fi
  else
    make_timeout "${GRUB_HIDDEN_TIMEOUT}" "${GRUB_TIMEOUT}"
  fi
}

  adjust_timeout

    cat <<EOF
if [ "x\${timeout}" != "x-1" ]; then
  if keystatus; then
    if keystatus --shift; then
      set timeout=-1
    else
      set timeout=0
    fi
  else
    if sleep$verbose --interruptible 3 ; then
      set timeout=0
    fi
  fi
fi
EOF

then make it executable,

1
sudo chmod +x /etc/grub.d/31_hold_shift

And finally regenerate the grub configuration with,

1
grub-mkconfig -o /boot/grub/grub.cfg

Note: This setup uses keystatus to detect keypress event so it may not work on some machines.

Info screen after grub

When you system starts first comes grub, and then? Something like, stating linux-zen-…., right? And do you remember when you were installing arch, while booting you say some green and white combination type progress like interface. You can actually toggle them. You have to remove a kernel parameter, called quiet.

To edit kernel parameters, edit /etc/default/grub. And regenerate the grub.cfg with,

1
grub-mkconfig -o /boot/grub/grub.cfg

Detecting other OS

Probing for other operating systems is disabled for security reasons. If still want to enable this functionality install os-prober and uncomment to detect and include other operating systems.

Edit /etc/default/grub (grub config file)

1
2
3
4
5
# Probing for other operating systems is disabled for security reasons. Read
# documentation on GRUB_DISABLE_OS_PROBER, if still want to enable this
# functionality install os-prober and uncomment to detect and include other
# operating systems.
GRUB_DISABLE_OS_PROBER=false

And finally regenerate the grub.cfg with,

1
grub-mkconfig -o /boot/grub/grub.cfg

Extra partitions

Besides we’ll have to mount our extra disk partitions as well and for that purpose we’ll add NTFS support. So install ntfs-3g. And now you can mount ntfs partitions with sudo mount but it’s not an idea solution. To make changes permanently you’ve to edit fstab.

swap partition

Our swap partition should work out of the box if you’ve followed my part one of this arch install post. To verify, run, swapon or, free -h. If you need swap file or, maybe an another swap partition or you didn’t follow my guide, check this guide from manjaro. It’s good to follow,

Also check out the systemd-swap, it’s even better choice, I think instead of tradition swap, if you want.

Other partitions

If you want you can easily set other partitions to mount by default with the help of partitionmanager or gnome-disk-utility and it’s recommend to avoid errors. You can also edit fstab manually.

KDE partition manager

It’s recommended to use /mnt directory. If you want you can create a sub directory inside first with,

1
sudo mkdir /mnt/data

Later launch kde partition manager, select your partition. From the right click menu, select Edit mount point and select the path /mnt/data. Finally click ok and you can reboot your session to check changes.

Gnome Disk Utility

The same as kde partition manager but you don’t have to create the directory manually.

Editing fstab

You can manually set by editing, /etc/fstab and create an entry. To find the UUID try,

1
lsblk -f

To learn more, try arch wiki,

Performance

zram and zwap

With zram generator you can easily generate zram and you can definitely try if you’ve a bigger ram. With zram your swap won’t be used and it’s definitely a bad idea to enable both zram and zswap. And zswap is enabled by default for most cases so you don’t need to modify anything. To make sure zram is enabled, you can try,

1
sudo dmesg | grep swap

You may see somehing like, [    0.357361] zswap: loaded using pool lz4/z3fold if your zwap is running.

nohang

A low ram handler. First install nohang from AUR or chaotic AUR. It can prevent OOM(Out of Memory). Learn more here. Start and enable nohang.service or nohang-desktop.service after installing,

1
sudo systemctl enable --now nohang-desktop.service

nohang-desktop provides notification when you’re almost out of memory.

Configuration

Hosts

You can edit host files to do more than just redirecting your localhost. Like, ad-blocking, adult sites blocking and even more! Here’s a good collection of hosts and it’s regularly updated,

In the repository you’ll find a file named, host, or just follow this link, and edit your /etc/hosts file and enter those texts. And then, just run,

1
sudo systemctl restart NetworkManager.service

For convenience you can use kate text editor as it can edit system text files.

Arch Mate

To make things more easy, I’ve a python script for you. With the support of that script, you can automate chaotic AUR installation, pacman packages inspection, installing essential packages etc. Here’s the repository,

If you know python and want to contribute, feel free to send merge request or, contact with me!

Essential packages

Plasma extras

  • As for your convenience you can try some powerful applications from KDE plasma! First of all, you can try plasma-firewall alongside a back-end (ufw or firewalld).

  • Then to manage archives, you can try ark. It’s pretty much strong. But you may also have to install some optional dependencies as well to make it more strong. For example, to know what to install, head over to arch packages website, ark (x86_64)

You can install it with,

1
sudo pacman -S ark

Now on the same page, scroll down a bit, you’ll notice,

We can avoid, (make) cause we are not building this! We just want to enhance it with more formats support. We can install those normally with pacman -S but later if you uninstall ark, these optional dependencies will be little hard to find. So here’s what we will do, we can install those as dependencies, with the following command,

1
sudo pacman -S --asdeps --needed ari lrzip lzop p7zip unarchiver unrar

FLAGS –asdeps = as dependency. – needed = it won’t reinstall if already exists in system.

  • In the same way, let’s install gwenview with optional dependencies as our image viewer. And it can even support PSD with optional dependency! Here you can install qt5-imageformats and kimageformats as optional.

  • For text editing you can kate. You can use it simply or can enhance it with plugins. To enable LSP-server and markdown support, install it with full optional dependency.

  • Now if you’re thinking about power management, you can install powerdevil. With it you can mange your power settings right from your setting in plasma.

  • plasma-systemmonitor , a nice looking system monitor that you may want to try. You can also avoid it if you’re happy with htop or anything else

  • And finally for taking screenshots, we’ve spectacle. It has annotation support, and also it can integrate with your system perfectly if you’re using KDE plasma!

Upstream KDE has package and setup recommendations to get a fully-featured Plasma session. Check this out for optional features!

Recommendations

Now it’s time to install your favorite packages, I guess. For the list of essential and well-refined packages for your system I’ve a list for you. Check,

Plasma Specials

Spell check

Make sure sonnet is installed with hunspell or anything similar. And also don’t forget to install a language pack for hunspell.

If you install LibreOffice it’ll be done automatically and I’ve a guide for you, check,

Fonts

To enhance performance for terminal and other places you might want to Install noto-sans optional dependency, especially for emoji-picker.

If you face problem in default terminal and othere monospace fonts, try installing ttf-dejavu and ttf-liberation.

Acknowledgements

For helping me to collect more information and revising, special thanks to,

References