Arch Linux (in dual boot)

Sep 7, 2020·
Julio Batista Silva
Julio Batista Silva
· 29 min read
blog

Since my consulting work depends heavily on Microsoft tools such as Office and Power BI, I have been using Windows as my main operating system.

I still do plenty of programming and, to my surprise, developing on Windows has been very good. When I need to run something that depends on Linux, such as Airflow and Redmine, I can use WSL and Docker.

One of the problems with virtualizing Linux is the performance loss. That is why I set aside about 60GB to install Arch in dual boot on my laptop.

I wrote on Twitter that I was installing Arch and people suggested I update my old guide, since a lot has changed in 8 years. So I decided to break this blog’s hiatus of more than 3 years to document my new installation process.

When I wrote my 2012 post, the official wiki was not up to date. These days it is very complete and I recommend following it for possible updates and more detail.

As in the earlier posts, let me make it clear that these are the settings I chose for my computers (a Dell Latitude 3480 and an Acer Predator Helios 300).
Some settings listed here may be incompatible with your system, or simply unnecessary depending on the Desktop Environment you use.

Do not copy and paste commands without understanding them first!

I will not go into much detail about the commands used. More information about them can be found on the internet and in the official wiki.
If you have any question or suggestion, feel free to leave a comment here or send me a DM on Twitter.

Update: Since May 2021, the Arch ISO image includes a guided installer called Archinstall. Since I am used to the manual process, I will carry on doing the installation by hand.

Partitioning the disk

I installed Windows first and, during the installation, partitioned the 240GB SSD like this:

  • 529 MB: Windows Recovery
  • 500 MB: EFI (larger than the default)
  • 150 GB: Windows
  • 60 GB: Arch Linux
  • The rest: an NTFS partition encrypted with Veracrypt, to reach from both Linux and Windows

I did not create a Swap partition. If I ever need one, I can create a swap file on the disk, in memory or in the graphics card’s memory.

I also left /, /home and /var on the same partition. /boot will be the 500 MB EFI partition. By default Windows creates that partition with 100MB, but that may not be enough if you want to load many modules or have more than one kernel.

If I had not created the partitions from Windows, I could have used a Linux tool such as cgdisk or parted

Installation USB

I downloaded the ISO image over BitTorrent and created the bootable USB using the default options of Rufus Portable. I restarted the computer and kept pressing F12 until the list with the boot-from-flash-drive option appeared. When I picked the option to install Arch, a message appeared saying it was waiting for a disk with LABEL=ARCH202008. I simply reconnected the flash drive to the USB port and the system loaded properly.

Keyboard layout

Once you land in the terminal, the first step is to configure the keyboard. Since I use a Brazilian keyboard, I ran the following command:

  • For a Brazilian keyboard:

    loadkeys br-abnt2
    
  • For an American keyboard:

    loadkeys us-acentos
    

Other options can be found with ls /usr/share/kbd/keymaps/**/*.map.gz.

Updating the system clock

timedatectl set-ntp true

Linux’s default is to keep the hardware clock in UTC, but Windows’ default is to use local time. I prefer to keep it in UTC and configure Windows through the Regedit.

Encrypting the disk

lsblk                       # To find the partition. /dev/sda5 in my case
cryptsetup -v luksFormat /dev/sda5

I found the default settings fine. More options can be found in the wiki.

If lsblk does not list your SSD (M.2 PCIe NVMe), check in the BIOS whether the SATA Mode is set to AHCI. If Windows was installed in RAID mode, you will have to restart it in safe mode and change the SATA Mode in the BIOS.

Formatting the root partition

cryptsetup luksOpen /dev/sda5 arch
mkfs.ext4 -L arch /dev/mapper/arch

Mounting the partitions

mount /dev/mapper/arch /mnt
mkdir /mnt/boot
mount /dev/sda2 /mnt/boot

Connecting to the Internet

  • Wifi

    Connect to the wifi using iwd

    iwctl --passphrase MY_PASSWORD station wlan0 connect MY_SSID
    
  • Cable

    Wired networks should work automatically. If not:

    • Set a static IP with Iproute2

    • Get a dynamic IP over DHCP: systemctl start dhcpcd@enp2s0.

      Use ip link to get the interface name.

Mirrorlist

Pacman reads the /etc/pacman.d/mirrorlist file to decide which mirrors to download packages from. It is good to keep the most up-to-date and fastest ones at the top so downloads do not take too long.

The new Arch installer should do this automatically using Reflector as soon as an internet connection is detected. Just check that everything is fine. Since I am in São Paulo, the UFSCar and UFPR mirrors ended up at the top.

Installing the main packages

In this step I install the base system and every package I will need, such as network tools, a text editor, manual pages, Xorg and PulseAudio.

pacstrap /mnt \
    base{,-devel} \
    linux{,-firmware} \

    intel-ucode \

    iwd \
    dhcpcd \
    iputils \

    zsh \
    go \
    git \
    neovim \
    python{,-pip,-pynvim} \

    man-db \
    man-pages \
    texinfo \

    xorg-server \
    xorg-xinit \
    xf86-video-intel \
    xf86-input-synaptics \

    alsa-utils \
    pipewire{,-pulse}
    wireplumber
    # pulseaudio{,-alsa,-bluetooth} \
    # pavucontrol

Fstab

genfstab -U -p /mnt >> /mnt/etc/fstab

Chroot

arch-chroot /mnt

Timezone

  • Brazil

    ln -sf /usr/share/zoneinfo/America/Sao_Paulo /etc/localtime
    
  • Germany

    ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
    

Save the time:

hwclock --systohc

Localization

I use the system in English, but I also enable pt_BR and de_DE. I tend to prefer en_GB to en_US, but that is a matter of taste.

sed -i -e 's/#en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen
sed -i -e 's/#en_GB.UTF-8 UTF-8/en_GB.UTF-8 UTF-8/' /etc/locale.gen
sed -i -e 's/#pt_BR.UTF-8 UTF-8/pt_BR.UTF-8 UTF-8/' /etc/locale.gen
sed -i -e 's/#de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf

Virtual Console

Sets the keyboard layout and the font.

echo -e "KEYMAP=br-abnt2\nFONT=latarcyrheb-sun16" > /etc/vconsole.conf

or

echo -e "KEYMAP=us-acentos\nFONT=latarcyrheb-sun16" > /etc/vconsole.conf

Network configuration

Adds the computer’s name to /etc/hosts and also blocks some malicious and advertising sites.

echo "computer_name" > /etc/hostname
curl --output /etc/hosts --url "https://someonewhocares.org/hosts/zero/hosts"
echo -e "127.0.1.1\tcomputer_name.localdomain\tcomputer_name" >> /etc/hosts

Initramfs

I added encrypt, since the system partition is encrypted.

I also load the Nvidia modules, as explained further below.

$ nvim /etc/mkinitcpio.conf
  HOOKS=(base udev autodetect modconf block encrypt filesystems keyboard keymap consolefont fsck)
mkinitcpio -p linux

Pacman

Adds the multilib repository, colors pacman and adds the Pac-Man animation.

sed -i -e '/^#\[multilib\]$/,+1s/#//' /etc/pacman.conf
sed -i -e '/# Misc options/a ILoveCandy' /etc/pacman.conf
sed -i -e 's/^# Color/Color/' /etc/pacman.conf

Root password

passwd

DNS and network

You can use Iproute2, wpa_supplicant or Iwd directly to connect to wired and wireless networks, but a connection manager makes the process easier.

Some setups I have used:

  • NetworkManager

    NetworkManager was created by RedHat and is now part of the GNOME project.

    It lets you configure wired networks, wifi, modems and VPNs, both from the command line and through graphical interfaces (very well integrated with Gnome and KDE).

    sudo pacman -S networkmanager
    sudo systemctl enable NetworkManager.service
    
    $ nmcli device
    DEVICE             TYPE      STATE         CONNECTION
    enp7s0             ethernet  disconnected  --
    wlp0s20f3          wifi      disconnected  --
    p2p-dev-wlp0s20f3  wifi-p2p  disconnected  --
    lo                 loopback  unmanaged     --
    
    $ nmcli connection add type ethernet con-name Casa ifname enp7s0
    Connection 'Casa' (0acb09e3-40a4-479f-9532-a154d8d65dfc) successfully added.
    
    $ nmcli connection up Casa
    Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/1)
    
    $ nmcli device disconnect enp7s0
    Device 'enp7s0' successfully disconnected.
    

    Note: you can keep both the cable and the wifi connected at the same time, so that if you unplug the cable there is no downtime.

    $ nmcli device wifi list
    IN-USE  BSSID              SSID       MODE   CHAN  RATE        SIGNAL  BARS  SECURITY
            7C:05:07:04:38:52  MY_SSID    Infra  4     130 Mbit/s  80      ▂▄▆_  WPA2
            A4:33:D7:A7:EA:10  Neighbour 1  Infra  6   130 Mbit/s  70      ▂▄▆_  WPA2
            C0:3D:D9:88:1E:00  Neighbour 2  Infra  1   130 Mbit/s  65      ▂▄▆_  WPA2
            68:02:B8:28:9A:60  Neighbour 3  Infra  6   195 Mbit/s  60      ▂▄▆_  WPA1 WPA2
            00:26:F2:6B:D6:F2  Neighbour 4  Infra  11  54 Mbit/s   59      ▂▄▆_  WPA1 WPA2
    
    $ nmcli device wifi connect MY_SSID password MY_PASSWORD
    Device 'wlp0s20f3' successfully activated with '3eafc7d7-8a89-40ae-8b01-ade3ba474de0'.
    
    $ nmcli connection show
    NAME      UUID                                  TYPE      DEVICE
    MY_SSID   3eafc7d7-8a89-40ae-8b01-ade3ba474de0  wifi      wlp0s20f3
    Casa      0acb09e3-40a4-479f-9532-a154d8d65dfc  ethernet  --
    
    ls /etc/NetworkManager/system-connections/
    Casa.nmconnection  MY_SSID.nmconnection
    
  • systemd-networkd + systemd-resolved + iwd

    ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
    
    $ nvim /etc/iwd/main.conf
    [General]
    EnableNetworkConfiguration=true
    [Network]
    NameResolvingService=systemd
    

    The network can be started when the computer boots:

    sudo systemctl enable systemd-resolved iwd
    
  • Wicd

Users

~# useradd -m -g users -G wheel,storage,power,video,audio,rfkill -s /bin/zsh julio
~# passwd julio
~# EDITOR=nvim visudo
Uncomment the line `%wheel ALL=(ALL) ALL`

Bootloader

I am using systemd-boot. Since my processor is Intel, I also load its microcode.

~# bootctl install
~# nvim /boot/loader/entries/arch.conf
title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options cryptdevice=UUID=0a1b2c3d-…-4e5f6g:arch root=/dev/mapper/arch rootfstype=ext4 add_efi_memmap
sudo nvim /boot/loader/loader.conf
timeout 3

The UUID of the encrypted partition (/dev/sda5) can be seen by running lsblk -o +UUID.

With the bootloader configured, we can restart the computer. If all goes well, a menu will appear for picking the operating system.

sudo umount /mnt/boot
sudo umount /mnt
sudo systemctl reboot

If no display manager was installed, Arch will start in the terminal. Log in with the user created in the previous step.

Dotfiles

My dotfiles are available on GitHub. I clone the repository and create the right symlinks. When I have time, I will use rcm, chezmoi or GNU Stow to automate this.

~$ git clone https://github.com/jbsilva/dotfiles.git
~$ ln -s dotfiles/.config ~/.config
~$ ln -s dotfiles/.zsh ~/.zsh
~$ ln -s dotfiles/.zshrc ~/.zshrc
~$ ln -s dotfiles/.gitconfig ~/.gitconfig
~$ ln -s dotfiles/.p10k_console.zsh ~/.p10k_console.zsh
~$ ln -s dotfiles/.p10k.zsh ~/.p10k.zsh
~$ ln -s dotfiles/.xinitrc ~/.xinitrc
~$ ln -s dotfiles/XCompose/.XCompose ~/.XCompose
~$ ln -s dotfiles/bin ~/bin

Shell

There are many command line shell options, such as Bash, Zsh, KornShell, and Fish. To list the installed shells, run chsh -l.

I have used Zsh for years. It is POSIX compliant and becomes extremely friendly with a few plugins (PowerLevel10k, and so on), which my dotfile installs and configures automatically with zplug.

I created my user with the -s /bin/zsh parameter, but you can change the default shell with chsh -s full-path-to-shell.

Terminal emulators

There are many terminal emulators available for Linux, each with its advantages and disadvantages.

I used to use urxvt, because back then start-up time and memory use were the main factors for me. Now that I have more powerful computers, other features stand out:

  • Cross-platform (at least Linux and macOS)
  • Unicode
  • Truecolor
  • Ligatures
  • Tabs
  • GPU accelerated
  • Good documentation

Of all the ones I have tried, Kitty is the one with the most features. Unfortunately it is not perfect: it has phone home features, it uses a terminfo of its own that causes problems, and the developer often behaves rudely indeed.

Alacritty is good, but it has no tabs and perhaps never will.

Terminal multiplexers

Terminal emulators such as Kitty let you split a single window into several terminals, but most terminal multiplexers do that and much more — for instance, letting you leave a session running even after closing the terminal.

Some I have used:

  • GNU Screen
    • It is the simplest and already ships with several distributions.
  • Tmux
  • Byobu
    • It is a layer on top of Screen or Tmux. I quite like it, but the project was discontinued in February 2020.
  • Zellij
    • My current favorite. It is a new project (in 2020 it was called Mosaic) written in Rust and with plenty of interesting features.

Yay

Yay is an AUR helper/Pacman wrapper written in Go that helps a lot with installing packages.

$ git clone https://aur.archlinux.org/yay.git && \
    cd yay && \
    makepkg -sri && \
    cd .. && \
    rm -rf yay

Some extra packages I install, including the Kitty terminal, the Gimp image editor, VS Code and various utilities:

$ yay -S \
    ack \
    aws-cli-v2-bin \
    bleachbit \
    bluez \
    bluez-utils \
    calibre \
    chromium \
    code \
    ctags \
    dbeaver \
    digikam \
    discord \
    docker-compose \
    duf \
    dust \
    fcitx5-chinese-addons \
    fcitx5-im \
    ffmpeg \
    firefox \
    gimp \
    gitahead \
    goldendict \
    gparted \
    htop \
    hugo \
    imagemagick \
    insomnia-bin \
    jq \
    kitty \
    lens-bin \
    libreoffice-fresh \
    make \
    meld \
    neofetch \
    nerd-fonts-hack \
    noto-fonts-emoji \
    npm \
    ntfs-3g \
    oath-toolkit \
    obs-studio \
    okular \
    openssh \
    p7zip \
    polkit \
    qalculate-gtk \
    renameutils \
    rsync \
    rust-analyzer \
    slack-desktop \
    spotify \
    sshfs \
    telegram-desktop \
    texlive-core \
    texlive-latexextra \
    thunderbird \
    transmission-remote-gtk \
    tree \
    ttf-joypixels \
    usbutils \
    veracrypt \
    vlc \
    wget \
    xclip \
    xorg-xrandr \
    # audacity \
    # awesome-git \
    # aws-cli \
    # blueman \
    # byobu \
    # copyq \
    # feh \
    # gnome-keyring \
    # graphviz \
    # hdparm \
    # ibus \
    # ibus-libpinyin \
    # kdenlive \
    # light-git \
    # macchanger \
    # maim \
    # picom-git \
    # postman-bin \
    # redshift \
    # rofi-git \
    # sshpass \
    # teams \
    # unrar \
    # unzip

Firewall

sudo pacman -S nftables
sudo systemctl enable nftables.service
sudo nft list ruleset

Fonts

Install the fonts available in the official repository or on the AUR:

$ yay -S \
    inter-font \
    nerd-fonts-fantasque-sans-mono \
    noto-fonts \
    noto-fonts-cjk \
    noto-fonts-emoji \
    otf-san-francisco \
    otf-sfmono-patched \
    ttf-dejavu \
    ttf-liberation \
    ttf-meslo-nerd-font-powerlevel10k

Installing by hand

Fonts that are not available as packages can be installed by hand. Just add the files to some subfolder of /usr/local/share/fonts (for every user) or ~/.local/share/fonts/ (only for your user).

Example:

sudo mkdir -p /usr/local/share/fonts/{otf,ttf}
wget http://www.exljbris.com/dl/fontin2_pc.zip
sudo 7z x fontin2_pc.zip -o/usr/local/share/fonts/ttf/Fontin
sudo find /usr/local/share/fonts -type d -exec chmod 755 {} \;
sudo find /usr/local/share/fonts -type f -exec chmod 644 {} \;
$ tree /usr/local/share/fonts
/usr/local/share/fonts
├── otf
│   └── Example_Sans
│       ├── Example_Sans_B.otf
│       ├── Example_Sans_BI.otf
│       ├── Example_Sans_I.otf
│       └── Example_Sans_R.otf
└── ttf
    └── Fontin
        ├── Fontin-Bold.ttf
        ├── Fontin-Italic.ttf
        ├── Fontin-Regular.ttf
        ├── Fontin-SmallCaps.ttf
        └── ReadMe.txt
fc-cache
fc-list
…

If you want to set specific fonts to be used, edit the file $XDG_CONFIG_HOME/fontconfig/fonts.conf.

Windows fonts

You can get the fonts from the ISO or from the C:\Windows\Fonts folder of an installed Windows.

Copy the fonts to /usr/share/fonts/WindowsFonts:

sudo mkdir /usr/share/fonts/WindowsFonts
sudo cp /c/Windows/Fonts/* /usr/share/fonts/WindowsFonts/
sudo chmod 644 /usr/share/fonts/WindowsFonts/*

Alternatively, use a package such as ttf-ms-win10 or ttf-ms-win11.

git clone https://aur.archlinux.org/ttf-ms-win11
cd ttf-ms-win11
cp /c/Windows/System32/Licenses/neutral/_Default/Core/license.rtf .
cp /c/Windows/Fonts/* .
makepkg -si

Keyboards

My laptop’s keyboard is ABNT2, but sometimes I plug in keyboards with other layouts.

You can configure each keyboard individually by device id, or switch between preset profiles.

  1. Get the keyboard’s device id

    sudo pacman -S xorg-xinput
    
    $ xinput -list | grep -i Keychron
    ⎜   ↳ Keychron Keychron K2  id=11  [slave pointer  (2)]
        ↳ Keychron Keychron K2  id=10  [slave keyboard (3)]
        ↳ Keychron Keychron K2  id=19  [slave keyboard (3)]
    
    $ xinput list-props 10
    Device 'Keychron Keychron K2':
        Device Enabled (189):    1
        Device Node (313):   "/dev/input/event5"
    
    $ ls -l /dev/input/by-id/usb-Keychron*
    … /dev/input/by-id/usb-Keychron_Keychron_K2-event-if01 -> ../event6
    … /dev/input/by-id/usb-Keychron_Keychron_K2-event-kbd -> ../event5
    
  2. Configure it with setxkbmap

    $ setxkbmap -device `xinput -list | \
        grep "Keychron K2.*keyboard" | \
        sed -e 's/^.*id=\([0-9]\+\).*/\1/' | \
        head -1` \
               -layout us              \
               -variant intl           \
               -option lv3:ralt_switch \
               -option compose:rctrl    \
               -option caps:swapescape
    

    Use the commands localectl list-x11-keymap-layouts, localectl list-x11-keymap-variants us, localectl list-x11-keymap-options and the file /usr/share/X11/xkb/rules/base.lst to work out the right configuration.

    My example swaps CapsLock with Esc, uses the right control as the compose key (Multi_Key) and the right Alt for the third level.

  3. Run the command when the system starts

    $ nvim ~/bin/keyboards.sh
    #!/bin/sh
    
    # Notebook keyboard
    keyboard_id=$(
        xinput -list |
        grep "AT Translated Set 2 keyboard.*keyboard" |
        sed -e 's/^.*id=\([0-9]\+\).*/\1/' |
        head -1
    )
    if [ ! -z "$keyboard_id" ]; then
        setxkbmap -device $keyboard_id    \
                  -layout br              \
                  -option lv3:ralt_switch \
                  -option compose:menu    \
                  -option caps:swapescape
    fi
    
    # Keychron K2
    keyboard_id=$(
        xinput -list |
        grep "Keychron K2.*keyboard" |
        sed -e 's/^.*id=\([0-9]\+\).*/\1/' |
        head -1
    )
    if [ ! -z "$keyboard_id" ]; then
        setxkbmap -device $keyboard_id    \
                  -layout us              \
                  -variant intl           \
                  -option lv3:ralt_switch \
                  -option compose:rctrl   \
                  -option caps:swapescape
    fi
    
    $ nvim ~/.config/autostart/keyboards.sh.desktop
    [Desktop Entry]
    Exec=/home/julio/bin/keyboards.sh
    Icon=dialog-scripts
    Name=keyboards.sh
    Path=
    Type=Application
    X-KDE-AutostartScript=true
    
  4. Compose: c-cedilla

    In the US International with Dead Keys layout, ç can be typed with AltGr + ,, but I prefer to use ´ + c or compose + c.

    Create a ~/.XCompose (or ~/.config/ibus/Compose) based on /usr/share/X11/locale/en_US.UTF-8/Compose:

    # UTF-8 (Unicode) compose sequence
    include "%L"
    <Multi_key> <c>   : "ç"   ccedilla
    <Multi_key> <C>   : "Ç"   Ccedilla
    <dead_acute> <c>  : "ç"   ccedilla
    <dead_acute> <C>  : "Ç"   Ccedilla
    <Multi_key> <t> <o> <w> <e> <r>  : "🗼"
    

East Asian characters

You can type characters that are not on your keyboard through an input method framework such as IBUS or Fcitx5.

I am going to show how to use ibus-libpinyin and fcitx5-chinese-addons to type in Chinese. Configuring other languages with other IMEs (input method editors) is similar.

IBUS

IBus (Intelligent Input Bus) is quite popular. It even comes integrated into GNOME, but it also works well with other Desktop Environments.

  1. Install IBus

    sudo pacman -S ibus ibus-libpinyin
    
  2. Set the following environment variables:

    sudo nvim /etc/environment
    GTK_IM_MODULE=ibus
    QT_IM_MODULE=ibus
    XMODIFIERS=@im=ibus
    GLFW_IM_MODULE=ibus
    
  3. Configure IBus to start with the DE

    $ nvim ~/.config/autostart/ibus-daemon.desktop
    [Desktop Entry]
    Comment=IBus Daemon
    #Exec=ibus-daemon -drx --panel=/usr/lib/kimpanel-ibus-panel
    Exec=ibus-daemon -drx
    GenericName=IBus Daemon
    Icon=ibus-engine
    Name=IBus Daemon
    StartupNotify=true
    Terminal=true
    Type=Application
    X-KDE-SubstituteUID=false
    

    KDE has a widget called Input Method Panel, but I prefer to use IBus’s own panel.

  4. Configure IBus

    ibus-setup
    

    Under Input Method, pick Portuguese (Brazil), Chinese-Intelligent Pinyin and English (US, intl., with dead keys).

    Under General, set the <Super>space shortcut for switching between input methods.

    Under Advanced, check the option to use the system layout, so IBus does not override the layout set with setxkbmap.

  5. Change the panel’s color to match your taskbar

    gsettings set org.freedesktop.ibus.panel xkb-icon-rgba '#ffffff'
    

Fcitx5

Fcitx (Flexible Context-aware Input Tool with eXtension support) is the input method framework I use.

It is quite flexible, has many features and integrates well with KDE.

  1. Install Fcitx5

    sudo pacman -S fcitx5-im fcitx5-chinese-addons
    
  2. Set the following environment variables:

    sudo nvim /etc/environment
    GTK_IM_MODULE=fcitx
    QT_IM_MODULE=fcitx
    XMODIFIERS=@im=fcitx
    DefaultIMModule=fcitx
    SDL_IM_MODULE=fcitx
    GLFW_IM_MODULE=ibus
    

    The last line is for Kitty. It stays as ibus.

  3. Configure Fcitx5 to start with the DE

    $ nvim ~/.config/autostart/fcitx5.desktop
    [Desktop Entry]
    Name=Fcitx5
    GenericName=Fcitx5 Input Method
    Comment=Start Fcitx5
    Exec=fcitx5
    Icon=fcitx
    Terminal=false
    Type=Application
    Categories=System;Utility;
    StartupNotify=false
    X-GNOME-Autostart-Phase=Applications
    X-GNOME-AutoRestart=false
    X-GNOME-Autostart-Notify=false
    X-KDE-autostart-after=panel
    X-KDE-StartupNotify=false
    X-GNOME-Autostart-enabled=true
    
  4. Configure Fcitx5

    I recommend doing the configuration through the fcitx5-configtool graphical interface (in KDE it is integrated into the system settings at System Settings » Personalization » Regional Settings » Input Method).

    In my tests, files edited by hand ended up being overwritten with the values set through the graphical interface.

    • Config

      $ nvim ~/.config/fcitx5/config
      [Hotkey/TriggerKeys]
      0=Super+space
      
      [Behavior/DisabledAddons]
      0=cloudpinyin
      1=wayland
      2=waylandim
      
    • Layouts

      $ nvim ~/.config/fcitx5/profile
      [Groups/0]
      # Group Name
      Name="Group 1"
      # Layout
      Default Layout=us-intl
      # Default Input Method
      DefaultIM=keyboard-us-intl
      
      [Groups/0/Items/0]
      # Name
      Name=keyboard-us-intl
      # Layout
      Layout=
      
      [Groups/0/Items/1]
      # Name
      Name=pinyin
      # Layout
      Layout=
      
      [GroupOrder]
      0="Group 1"
      

      Note: the last entry in the configtool will be the DefaultIM.

    • XCB

      $ nvim ~/.config/fcitx5/conf/xcb.conf
      Allow Overriding System XKB Settings=False
      
    • UI

      pacman -S fcitx5-material-color fcitx5-nord
      
      $ nvim ~/.config/fcitx5/conf/classicui.conf
      # Use Per Screen DPI
      PerScreenDPI=False
      # Font
      Font="Noto Sans Black 10"
      # Menu Font
      MenuFont="Sans 10"
      # Theme
      Theme=Material-Color-Blue
      
    • Cloud Pinyin

      $ nvim ~/.config/fcitx5/conf/pinyin.conf
      CloudPinyinEnabled=False
      

Keychron keyboard

To make the F1,…,F12 keys work properly:

sudo nvim /etc/modprobe.d/hid_apple.conf
options hid_apple fnmode=2
sudo mkinitcpio -P

XDG user directories

Install xdg-user-dirs to create the folders.

sudo pacman -S xdg-user-dirs
$ xdg-user-dirs-update --force

Power management

There are many tools for power management. I use the following:

sudo pacman -S tlp acpid acpi_call upower xfce4-power-manager
sudo systemctl enable tlp.service
sudo systemctl enable acpid.service

Bluetooth

After installing bluez, start bluetooth.service:

sudo systemctl start bluetooth.service

Bluez’s configuration lives in /etc/bluetooth/main.conf. I use the default settings.

Most desktop environments include some GUI to make connecting easier, such as Bluedevil in KDE, but I also like to install bluez-utils to connect Bluetooth devices from the command line with bluetoothctl.

An example connecting two keyboards and a pair of headphones:

$ bluetoothctl
Agent registered

[bluetooth]# power on
[CHG] Controller 8C:8D:28:F7:3A:77 Class: 0x007c010c
Changing power on succeeded
[CHG] Controller 8C:8D:28:F7:3A:77 Powered: yes

[bluetooth]# scan on
Discovery started
[CHG] Controller 8C:8D:28:F7:3A:77 Discovering: yes
[NEW] Device 20:20:01:07:B1:89 Bluetooth 3.0 Keyboard
[NEW] Device DC:2C:26:FF:24:BD Keychron K2
[NEW] Device 60:F4:3A:12:8E:02 EDIFIER W800BT

[bluetooth]# pair 20:20:01:07:B1:89
Attempting to pair with 20:20:01:07:B1:89
[CHG] Device 20:20:01:07:B1:89 Connected: yes
[agent] PIN code: 428084
[CHG] Device 20:20:01:07:B1:89 Modalias: usb:v04E8p7021d011B
[CHG] Device 20:20:01:07:B1:89 UUIDs: …
[CHG] Device 20:20:01:07:B1:89 ServicesResolved: yes
[CHG] Device 20:20:01:07:B1:89 Paired: yes
Pairing successful

[bluetooth]# trust 20:20:01:07:B1:89
[CHG] Device 20:20:01:07:B1:89 Trusted: yes
Changing 20:20:01:07:B1:89 trust succeeded

[bluetooth]# connect 20:20:01:07:B1:89
Attempting to connect to 20:20:01:07:B1:89
[CHG] Device 20:20:01:07:B1:89 Connected: yes
Connection successful

[Bluetooth 3.0 Keyboard]# pair 60:F4:3A:12:8E:02
Attempting to pair with 60:F4:3A:12:8E:02
[CHG] Device 60:F4:3A:12:8E:02 Connected: yes
[CHG] Device 60:F4:3A:12:8E:02 UUIDs: …
[CHG] Device 60:F4:3A:12:8E:02 ServicesResolved: yes
[CHG] Device 60:F4:3A:12:8E:02 Paired: yes
Pairing successful

[Bluetooth 3.0 Keyboard]# trust 60:F4:3A:12:8E:02
[CHG] Device 60:F4:3A:12:8E:02 Trusted: yes
Changing 60:F4:3A:12:8E:02 trust succeeded

[Bluetooth 3.0 Keyboard]# connect 60:F4:3A:12:8E:02
Attempting to connect to 60:F4:3A:12:8E:02
Connection successful

[EDIFIER W800BT]# pair DC:2C:26:FF:24:BD
Attempting to pair with DC:2C:26:FF:24:BD
[CHG] Device DC:2C:26:FF:24:BD Connected: yes
[CHG] Device DC:2C:26:FF:24:BD Modalias: usb:v05ACp024Fd011B
[CHG] Device DC:2C:26:FF:24:BD UUIDs: 00001000-0000-1000-8000-00805f9b34fb
[CHG] Device DC:2C:26:FF:24:BD UUIDs: 00001124-0000-1000-8000-00805f9b34fb
[CHG] Device DC:2C:26:FF:24:BD UUIDs: 00001200-0000-1000-8000-00805f9b34fb
[CHG] Device DC:2C:26:FF:24:BD ServicesResolved: yes
[CHG] Device DC:2C:26:FF:24:BD Paired: yes
Pairing successful
[CHG] Device DC:2C:26:FF:24:BD WakeAllowed: yes
[CHG] Device DC:2C:26:FF:24:BD ServicesResolved: no
[CHG] Device DC:2C:26:FF:24:BD Connected: no

[EDIFIER W800BT]# trust DC:2C:26:FF:24:BD
[CHG] Device DC:2C:26:FF:24:BD Trusted: yes
Changing DC:2C:26:FF:24:BD trust succeeded

[EDIFIER W800BT]# connect DC:2C:26:FF:24:BD
Attempting to connect to DC:2C:26:FF:24:BD
[CHG] Device DC:2C:26:FF:24:BD Connected: yes
Connection successful

[Keychron K2]# paired-devices
Device 60:F4:3A:12:8E:02 EDIFIER W800BT
Device 20:20:01:07:B1:89 Bluetooth 3.0 Keyboard
Device DC:2C:26:FF:24:BD Keychron K2

[Keychron K2]# quit

Tip: Use FN+Z+J to reset the Keychron keyboard and redefine the connections.

asdf

asdf has plugins for almost anything. It can replace pyenv, rbenv, goenv and nvm. There is even a plugin for managing different versions of Poetry.

git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3

Use the oh-my-zsh plugin to enable it and add completions.

  • Python

    pacman -S --needed base-devel openssl zlib xz tk
    
    asdf plugin add python
    asdf install python latest:3
    asdf global python latest
    
    asdf install python latest:3.10
    asdf local python latest:3.10
    asdf uninstall python <python-version>
    
  • Ruby

    asdf plugin add ruby
    asdf install ruby latest
    asdf local ruby latest
    
  • Go

    asdf plugin add golang
    asdf install golang latest
    asdf global golang latest
    
  • Node.js

    asdf plugin add nodejs
    asdf install nodejs latest
    

The global versions are set in the ~/.tool-versions file.

Python

I first came across Python more than 10 years ago and today, besides being my favorite programming language, it is the language I use most for work and personal projects.

The Zen of Python says:

“There should be one– and preferably only one –obvious way to do it.”

That holds for code, but for packaging the story is quite different. My feelings are well captured by this sequence of xkcd strips: xkcd 353, xkcd 927, xkcd 1987.

xkcd 927

xkcd 927

My current preferences are the following, in order:

  • For managing different Python versions: asdf or Pyenv.

  • For managing virtual environments, controlling dependencies and making package publishing easier: PDM or Poetry.

  • For more complex machine learning cases, or projects that depend on packages and binaries not available on pypi: Mambaforge.

  • IDE: VSCode with the official extension, or PyCharm.

    The problem with PyCharm is that some important features (framework integration, SQL editing, Docker integration, and so on) are paid.

Pyenv

Pyenv lets you install and use different versions of Python.

It is like asdf, but exclusive to Python. If you already use asdf for other languages, it may not make much sense to install Pyenv.

  1. Install Pyenv:

    sudo pacman -S pyenv
    
  2. Optionally, also install pyenv-virtualenv:

    yay -S pyenv-virtualenv
    
  3. Add the following lines to ~/.zshrc:

    if (( $+commands[pyenv] )); then eval "$(pyenv init --path)"; fi
    if (( $+commands[pyenv-virtualenv-init] )); then eval "$(pyenv virtualenv-init -)"; fi
    
  4. Check which versions are available and install the ones you will use:

    pyenv install --list
    pyenv install 3.8.12
    pyenv install mambaforge
    
  5. List the installed versions

    pyenv versions
    
  6. In a project’s folder, set the version to use

    pyenv local 3.8.12
    

    A file called .python-version will be created:

    $ cat .python-version
    3.8.12
    

Poetry

Update: section updated for version 1.2.

  1. Install Poetry

    I prefer not to use the system package manager for Poetry; there are a few good alternatives:

    • Script:

      wget -O install-poetry.py https://install.python-poetry.org
      python install-poetry.py --preview
      

      Note: The old installer (get-poetry.py) was replaced by install-poetry.py. Do not pass the --preview parameter if you want the latest stable version.

    • asdf:

      asdf plugin add poetry
      asdf install poetry latest
      asdf global poetry latest
      
    • pipx:

      pipx install poetry
      
  2. Add it to the PATH

    The old installer used the $HOME/.poetry/bin folder. The new one uses $HOME/.local/bin.

    Using my function in .zshrc:

    addToPathStart $HOME/.local/bin
    
  3. Install the completions

    poetry completions zsh > ~/.zprezto/modules/completion/external/src/_poetry
    

    The command above is because I use Prezto. What matters is installing it into some folder listed in $fpath.

  4. Create a new project

    poetry new meu-projeto
    cd meu-projeto
    
  5. Set the Python version using Pyenv or asdf

    pyenv local 3.8.12
    

    or

    asdf local 3.8.12
    
    $ nvim pyproject.toml
    …
    [tool.poetry.dependencies]
    python = "^3.8"
    …
    
    poetry env use -- /home/julio/.pyenv/versions/3.10.3/bin/python
    

    or

    poetry env use -- /home/julio/.asdf/installs/python/3.10.3/bin/python
    
    poetry run python --version
    poetry debug info
    
  6. Add the dependencies

    Development dependencies are passed with --group dev.

    $ poetry add --group dev \
        bandit \
        black \
        codecov \
        coverage \
        flake8 \
        gitchangelog \
        isort \
        mkdocs \
        mypy \
        pydocstyle \
        pytest \
        pytest-cov
    
    poetry add typer\[all\]
    
  7. Update Poetry

    poetry self update
    

    Remember to generate the completions again.

  8. Install poetry-plugin-up

    poetry self add poetry-plugin-up
    poetry up --latest
    

    This plugin updates the packages in pyproject.toml to the latest version.

If Poetry gets stuck on “Resolving dependencies”, try the following:

find ~/.cache/pypoetry -name '*.lock' -type f -delete
poetry env remove --all
poetry cache clear --all .
rm -rf $(poetry config cache-dir)/artifacts

Mambaforge

Mambaforge combines Mamba and Conda-Forge.

Mamba is a reimplementation of the Conda package manager in C++. It resolves dependencies very fast and downloads in parallel.

The Conda-Forge channel holds recipes written by the community for Conda. It has far more packages than the official Conda repository.

  1. If you do not want to use Pyenv, you can install Mambaforge by hand:

    wget https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh
    bash Mambaforge-Linux-x86_64.sh
    
  2. Update the base packages

    mamba update mamba
    mamba update --all
    
  3. Create and activate a virtual environment

    mamba create -n nome_do_env python=3.10 jupyterlab …
    conda activate nome_do_env
    
  4. Install a few extra packages

    $ mamba install \
          azure-identity \
          bandit \
          black \
          bokeh \
          dask \
          flake8 \
          ipywidgets \
          isort \
          jupyterlab_code_formatter \
          kafka-python \
          keras \
          koalas \
          matplotlib \
          mypy \
          numpy \
          openpyxl \
          pandas \
          plotly \
          pyarrow \
          pycodestyle \
          pydocstyle \
          pylama \
          pylint \
          pyspark \
          pytest \
          python-graphviz \
          python-wget \
          scikit-learn \
          seaborn \
          sqlalchemy \
          tenacity \
          tensorflow \
          unidecode \
          xgboost
    

PDM

PEP 582 was

rejected by the Python Steering Council in March 2023.

Like Poetry, PDM is a package and dependency manager.

The difference is that it follows the new PEPs (PEP 582, PEP 517 and PEP 621).

You can use a virtualenv, or follow PEP 582 and use a folder called __pypackages__. That folder is the equivalent of node_modules; it is added to sys.path.

Installation

  • Through a script:

    curl -sSL https://raw.githubusercontent.com/pdm-project/pdm/main/install-pdm.py | python3 -
    
  • Through asdf:

    asdf plugin add pdm
    asdf install pdm latest
    asdf local pdm latest
    
  • Completions in ZSH

    pdm completion zsh > ~/.zprezto/modules/completion/external/src/_pdm
    

Usage

  • Create a project

    pdm init
    
  • Add dependencies

    pdm add requests flask
    
  • Add development dependencies

    pdm add -dG dev jupyterlab jupyterlab-code-formatter black isort pylint mypy
    
  • Remove dependencies

    pdm remove flask
    
  • List dependencies

    pdm list --graph
    
  • Install the project

    pdm install
    
  • Install based on the .lock file

    pdm sync
    
  • Update dependencies

    • Every package

      pdm update
      
    • A specific package

      pdm update <package>
      
      • The packages in a group

        pdm update -G <group>
        
      • Force updating pinned packages

        pdm update --update-eager
        
  • Remove packages that are not listed

    pdm sync --clean
    
  • Run a binary in the environment

    pdm run jupyter lab
    

Updating

pdm self update

Rust

The recommended way to develop in Rust is to use rustup, which can be installed in two ways:

  1. The official script:

    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    
  2. Pacman:

    sudo pacman -S rustup
    rustup default stable
    

    This way is more comfortable on Arch, since it keeps Rust and the packages depending on it constantly up to date.

Test the installation:

$ rustc --version
rustc 1.53.0 (53cb7b09b 2021-06-17)
$ cargo --version
cargo 1.53.0 (4369396ce 2021-04-27)
$ rustdoc --version
rustdoc 1.53.0 (53cb7b09b 2021-06-17)
$ cargo new hello
 Created binary (application) `hello` package
$ cd hello

$ cargo run
   Compiling hello v0.1.0 (/home/julio/hello)
    Finished dev [unoptimized + debuginfo] target(s) in 0.43s
     Running `target/debug/hello`
Hello, world!

My Neovim is set up to use rust-analyzer as the LSP Server. Just install the binary:

sudo pacman -S rust-analyzer

Nvidia

One of the laptops has an integrated Intel GPU and an Nvidia GeForce RTX 2070 Max-Q, which performs better than the Intel GPU but uses more power.

You can turn one of the cards off permanently, or use Nvidia Optimus technology to switch between the cards as needed.

Install the drivers and utilities:

sudo pacman -S nvidia nvidia-utils nvidia-settings opencl-nvidia

Running a specific program on the Nvidia

To do what is called PRIME render offload, just start the program with the prime-run command. E.g.:

sudo pacman -S nvidia-prime
prime-run kdenlive

Using only the Nvidia card

sudo nvim /etc/X11/xorg.conf.d/10-nvidia-drm-outputclass.conf
Section "OutputClass"
    Identifier "intel"
    MatchDriver "i915"
    Driver "modesetting"
EndSection

Section "OutputClass"
    Identifier "nvidia"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "AllowEmptyInitialConfiguration"
    Option "PrimaryGPU" "yes"
    ModulePath "/usr/lib/nvidia/xorg"
    ModulePath "/usr/lib/xorg/modules"
EndSection
$ nvim ~/.xinitrc (or /usr/share/sddm/scripts/Xsetup for SDDM)
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
setxkbmap br -option caps:swapescape

To make sure the module is loaded before the graphical interface.

sudo nvim /etc/modprobe.d/nvidia-drm-nomodeset.conf
options nvidia-drm modeset=1
sudo nvim /etc/mkinitcpio.conf
MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)
sudo mkinitcpio -P

(Note: If the /boot partition has little free space, you can turn off the generation of the fallback image by commenting out the related lines in /etc/mkinitcpio.d/linux.preset. If that is not enough, you will have to resize the partitions.)

sudo systemctl reboot
nvidia-smi
sudo pacman -S virtualgl
glxspheres64

Tearing

Screen tearing is when parts of different frames are shown on screen at the same time.

This problem was quite noticeable when watching videos on the monitor connected over HDMI. Test it with the video https://youtu.be/MfL_JkcEFbE and with the site https://www.vsynctester.com.

  1. Browser configuration

    Check whether enabling layers.acceleration.force-enabled in Firefox’s about:config improves anything.

  2. Force composition

    This option can increase latency, but it is what solved my problem.

    Check the current settings:

    $ nvidia-settings --query CurrentMetaMode
      Attribute 'CurrentMetaMode' (Predator:0.0): id=50, switchable=yes, source=RandR :: DPY-2: nvidia-auto-select @1920x1080 +1920+0 {ViewPortIn=1920x1080, ViewPortOut=1920x1080+0+0}
    

    Enable ForceCompositionPipeline (or ForceFullCompositionPipeline):

    nvidia-settings --assign CurrentMetaMode="nvidia-auto-select +1920+0 { ForceCompositionPipeline = On }"
    

    The +1920+0 offset is because the laptop’s screen is full HD and sits to the left of the external monitor.

    Check the new settings:

    $ nvidia-settings --query CurrentMetaMode
      Attribute 'CurrentMetaMode' (Predator:0.0): id=50, switchable=no, source=nv-control :: DPY-2: nvidia-auto-select @1920x1080 +1920+0 {ViewPortIn=1920x1080, ViewPortOut=1920x1080+0+0,
      ForceCompositionPipeline=On}
    

    Add that command to a file that runs at start-up, such as autostart, xinit or Xsetup.

    ~/bin/nvidia-force_comp_pipeline.sh:

    #!/bin/sh
    s="$(nvidia-settings -q CurrentMetaMode -t)"
    echo "$s"
    if [[ "${s}" != "" ]]; then
      s="${s#*" :: "}"
      echo "$s"
      if [[ "${s}" != "NULL" ]]; then
        nvidia-settings -a CurrentMetaMode="${s//\}/, ForceCompositionPipeline=On\}}"
      fi
    fi
    

    /usr/share/sddm/scripts/Xsetup:

    #!/bin/sh
    # Xsetup - run as root before the login dialog appears
    
    # Keyboards
    kb_script="/home/julio/bin/keyboards.sh"
    [ -s "$kb_script" ] && \. "$kb_script"
    
    # Nvidia
    xrandr --setprovideroutputsource modesetting NVIDIA-0
    xrandr --auto
    
    # Force Composition Pipeline
    nfcp_script="/home/julio/bin/nvidia-force_comp_pipeline.sh"
    [ -s "$nfcp_script" ] && \. "$nfcp_script"
    

    If your monitors are fixed, you can use /etc/X11/xorg.conf.d/20-nvidia.conf:

    Section "Screen"
        …
        Option  "MetaModes" "nvidia-auto-select +0+0 {ForceFullCompositionPipeline=On}"
        …
    EndSection
    

Window Managers and Desktop Environments

Awesome

For AwesomeWM, I like Gerome Matilla’s configuration. It is a little bloated, but the layouts are very pretty and have interesting features.

KDE

KDE Plasma is a very good DE with default settings that suit me nicely.

I used to avoid KDE on my old computers because it was not light enough, but with my current hardware that is no longer much of a problem.

I recommend installing the following packages:

sudo pacman -S ark \
        dolphin \
        gwenview \
        packagekit-qt5 \
        plasma-browser-integration \
        sddm \
        spectacle

Swapping Caps Lock for ESC can be done under System Settings » Keyboard » Advanced » Caps Lock behavior » Swap Esc and Caps Lock.

Install kdeconnect on the computer and on Android devices to sync notifications, share files, share the clipboard, use Android as a mouse and keyboard, and more.

Try the OpenGL and XRender options under System Settings » Hardware » Display and Monitor » Compositor » Rendering backend. The best option is probably OpenGL, but I have seen reports of problems with Nvidia cards.

If you do not want media controls shown on the lock screen, run the following command:

kwriteconfig5 --file kscreenlockerrc --group Greeter --group LnF --group General --key showMediaControls --type bool false

If the fonts are too large, force the DPI under System Settings » Fonts » Force font DPI: 96.

Tiling in KDE: Kröhnkite

  1. Move the taskbar to the top of the screen;

  2. Reduce the bar’s size (I set it to 30);

  3. Right click the taskbar, click Show Alternatives and pick “Icons-only Task Manager”;

  4. Right click on the Pager » Configure Pager

    • Show application icons on window outlines
    • Text display: Desktop number
  5. System Settings » Workspace » Window Management » KWin Scripts » Get New Scripts…

  6. Enable Kröhnkite’s settings

    mkdir -p ~/.local/share/kservices5/
    ln -s ~/.local/share/kwin/scripts/krohnkite/metadata.desktop ~/.local/share/kservices5/krohnkite.desktop
    

    A button to configure Kröhnkite will appear on the KWin Scripts screen. There I do the following:

    • Enable the Quarter layout
    • Gaps between tiles: 3 px
    • Prevent windows from minimizing
    • Remove borders of tiled windows
  7. System Settings » Appearance » Window Decorations » Edit Theme » Window-Specific Overrides » Add

    • Regular expression to match: .*
    • Border size: Tiny
    • Hide window title bar
  8. Go to System Settings » Workspace » Workspace Behavior » Virtual Desktops and add as many desktops as you want (I left 8, shown in two rows);

  9. System Settings » Workspace » Workspace Behavior » Desktop Effects » Focus » Dim Inactive;

  10. System Settings » Workspace » Window Management » Window Behavior » Focus » Multiscreen behavior: Separate screen focus;

  11. Border color

    kwriteconfig5 --file ~/.config/kdeglobals --group WM --key frame 61,174,233
    kwriteconfig5 --file ~/.config/kdeglobals --group WM --key inactiveFrame  239,240,241
    
  12. Remove the windows’ minimum size

    • System Settings » Workspace » Window Management » Window Rules
    • Add New…
    • Window class: Unimportant
    • Window types: Normal Window
    • Add Properties…
    • Minimum Size: Force 0 x 0
  13. Change the shortcuts under System Settings » Workspace » Shortcuts » KRunner

    • KRunner: Meta + R
  14. Change the shortcuts under System Settings » Workspace » Shortcuts » KWin

    • Switch to Desktop n: Meta + n
    • Switch to Previous Screen: Meta + ,
    • Switch to Next Screen: Meta + .
    • Window to Desktop n: Meta+Shift+Fn (Using Meta + F1,…,F8, because Meta+Shift+6 does not work with a US intl. keyboard.)
    • Window to Previous Screen: Meta + <
    • Window to Next Screen: Meta + >
    • Krohnkite: Float All: Meta+Shift+F
    • Krohnkite: Right: Meta+L (use ctrl+alt+L to lock the screen)

Android integration

MTP devices can only be reached by one program.

To sync a tablet with Calibre, KDE must not have mounted the device beforehand.

Kill the kiod5 process.

Gnome

Gnome is a complete and quite popular DE. I do not much like the default settings, but after a few quick adjustments it becomes quite usable:

sudo pacman -S gnome gnome-tweaks gnome-shell-extension-appindicator evolution
sudo systemctl enable gdm
dconf write /org/gnome/desktop/input-sources/xkb-options "['caps:swapescape']"

Through Tweaks, enable the app indicator extension and the minimize and maximize buttons.

Install Pipewire so screen sharing works on Wayland:

sudo pacman -S pipewire xdg-desktop-portal-gtk

Wine

  • Install some of the following packages (not all of them are needed)
$ sudo pacman -S \
    wine-staging \
    wine-gecko \
    wine-mono \
    winetricks \
    zenity \
    playonlinux
$ sudo pacman -S \
    giflib \
    lib32-giflib \
    libpng \
    lib32-libpng \
    libldap \
    lib32-libldap \
    gnutls \
    lib32-gnutls \
    mpg123 \
    lib32-mpg123 \
    openal \
    lib32-openal \
    v4l-utils \
    lib32-v4l-utils \
    libpulse \
    lib32-libpulse \
    alsa-plugins \
    lib32-alsa-plugins \
    alsa-lib \
    lib32-alsa-lib \
    libjpeg-turbo \
    lib32-libjpeg-turbo \
    libxcomposite \
    lib32-libxcomposite \
    libxinerama \
    lib32-libxinerama \
    ncurses \
    lib32-ncurses \
    opencl-icd-loader \
    lib32-opencl-icd-loader \
    libxslt \
    lib32-libxslt \
    libva \
    lib32-libva \
    gtk3 \
    lib32-gtk3 \
    gst-plugins-base-libs \
    lib32-gst-plugins-base-libs \
    vulkan-icd-loader \
    lib32-vulkan-icd-loader \
    cups \
    samba \
    dosbox
  • Install the Windows fonts as explained earlier

  • Run winetricks

    With zenity installed, a GUI will appear to help create prefixes, install dependencies, and install and uninstall programs.

    The prefixes are created in ~/.local/share/wineprefixes/.

  • Call a program from the command line

    WINEPREFIX="~/.local/share/wineprefixes/prefix_name" wine ~/.local/share/wineprefixes/prefix_name/drive_c/Program.exe
    

VPNs

Most VPNs have an installer of their own (which will often already be available on the AUR).

Prefer WireGuard to OpenVPN when possible.


Julio Batista Silva
Authors
Senior Cloud Developer

I’m a Brazilian-German computer engineer based in Germany, passionate about tech, science, photography, and languages.

I’ve been programming for about two decades already, exploring everything from mobile apps and web development to machine learning. These days I focus on cloud SRE and data engineering.

I volunteer in the open source and Python communities, helping organize PyCon DE and PyData Berlin, serving on the PSF D&I Work Group, mentoring, and contributing code and translations.

On my blog, I share Linux tips, setup guides, and personal notes I’ve written for future reference. I hope others find them helpful as well. The content is available in multiple languages.

Browse my gallery for some of my photography.

Away from the keyboard, you’ll find me at concerts, playing clarinet, cycling, scuba diving, or exploring new places, cultures, and cuisines.

Always happy to connect! 🙂

comments powered by Disqus