Void Linux Minimal Setup
- Foreword
- Drivers and Session Management
- Audio and Audio Control
- Basic Window Manager Setup
- Menus and Bars
- Alternative Programs
Foreword⌗
This guide is meant as the follow on to the prior guide. This largely picks up where we left off, with a TTY and basic networking enabled. I will break down some common steps taken immediately after a fresh install, including services I consider important which you may also find use. Consider all of this optional.
this guide is a work in progress and primarily exists as a reference tool for myself.
Commands in explanations will be highlighted in green
Files and directories will be highlighted in blue
Drivers and Session Management⌗
Void, when installed via chroot as we did in the other guide, will not come with video drivers or session management. Out of the box, without the following three packages, you will likely be unable to start a graphical interface or utilize the system in a non-tty capacity.
Are these needed?⌗
Not necessarily, however, for desktop use they are essentially required. If you were hosting a headless http server similar to what’s explained on my other guide, these packages would not be required. If you plan on utilizing any sort of GUI program, these are needed.
elogind
vs seatd
⌗
The easiest out of the box solution is to install and enable elogind
as described below. elogind
is/was a component of systemd, and upon running it will create the /run/systemd directory. seatd
is a more barebones solution that accomplishes the same thing with some tweaking. To use seatd
, install it, enable it via runit as shown below, and add yourself to the _seat
group.
One consideration to take into account is the fact that seatd
does not handle groups the same way elogind
does. For instance, after the installation of something like pulseaudio
, elogind
will automatically handle running it in the background assuming the pulseaudio
service has been enabled via runit. seatd
on the other hand, will require you to enable pulseaudio
as well as adding your user account to the audio
group. More or less every service is like this, including services such as _flatpak
and kvm
should you decide to use flatpaks or KVM/QEMU virtualization.
$ cat /etc/group | grep seatd && cat /etc/group | grep audio
...
# _seatd:x:992
# audio:x:12:pulse
...
$ usermod -a -G 992 $USER
$ usermod -a -G 12 $USER
Installation⌗
This will install the following packages; dbus
, elogind
, xf86-video-amdgpu
and xf86-input-libinput
. The first two packages are more or less essential for every desktop use case, as they facilitate user processes to communicate with one another. Without them, you will be restricted to utilizing single programs via TTY. The final two packages are AMD’s video driver and a generic X.Org input driver. If do not have an AMD video card, replace it with your appropriate driver.
$ sudo xbps-install dbus elogind xf86-video-amdgpu xf86-input-libinput
Activation via runit⌗
Now that we have those three packages installed, dbus
and elogind
are required to run as daemons. Let’s enable them before we move on.
# Runit looks in /var/service for services to start.
# This is accomplished by symlinking from /etc/sv/ to /var/service
$ sudo ln -s /etc/sv/elogind /var/service/
$ sudo ln -s /etc/sv/dbus /var/service/
# Now that they've been symlinked, let's enable them
$ sudo sv up elogind
$ sudo sv up dbus
Audio and Audio Control⌗
As discussed above, there are many ways to impliment and control audio on Void Linux. For ease of use, you may opt to install elogind
and pulseaudio
, then simply ensure both services are enabled via runit. We will discuss deployment of audio under seatd
as well as control of audio via terminal.
Installation of Pulseaudio⌗
The solution we will utilize is pulseaudio
, which I’ve noticed has the least amount of issues especially with many games (cataclysm-tiles, gzdoom, ss14 etc and any other game requiring SDL audio). It’s absolutely possible to impliment any other audio solution, however, pulseaudio
in my experience has been the easiest to manage.
$ sudo xbps-install pulseaudio
...
$ sudo ln -sf /etc/sv/pulseaudio/ /var/service/
$ sudo sv up pulseaudio
# Now we must get the group number of the audio group
# and add our account to it
$ sudo cat /etc/group | grep audio
...
audio:x:12:pulse
...
# Let's add our account to the audio group, which is represented by group number 12
$ sudo usermod -a -G 12 $USER
Installation of PAmix
⌗
Now upon restart, pulseaudio will be running. But how do we control it?
We will utilize a program called pamix
to control pulseaudio via terminal.
$ sudo xbps-install PAmix
To run pamix, simply run pamix
via your terminal
Basic Window Manager Setup⌗
Installation of I3WM⌗
i3wm is a tiling window manager which, at it’s core, simply lays out floating windows in a pattern of your choosing. We will get more into it’s configuration and usage later on.
First, we will need the i3
and xinit
package. xinit
will allow us to start I3WM from a TTY upon logging in.
sudo xbps-install i3 xinit alacritty
now we must create the file which xinit
will read from upon executing it
$ touch ~/.xinitrc
$ vim ~/.xinitrc
...
exec dbus-run-session i3
upon creation of this file, invoke the startx
command to tell xinit
to initialize and read from the file we just made. we will now be in i3wm
Configuration of I3WM⌗
By default, i3wm reads from /etc/i3/config. A good place to start configuring it would be to copy it into your ~/.config/ directory and begin your edits
cp /etc/i3/config ~/.config/i3/
vim ~/.config/i3/
...
# Look for the line containing "bindsym Mod1+Return exec i3-sensible-terminal"
# We will edit this to Alacritty
bindsym $Mod1+Return exec alacritty
Now upon entering your i3 environment, holding your Mod1 key (default left alt) and pressing enter, an alacritty terminal window will spawn.
There are near endless ways to configure i3wm.
Configuration of i3lock⌗
By default, there is no screen locker for i3wm. i3lock
is one of the simplest ways to accomplish this, although it will require deliberately activating it via key combination when you want to lock your screen. This does NOT prevent a potential bad actor from accessing a TTY login prompt via ctrl+alt+F1-12 keys, rather simply prevents usage of your current screen session.
First, let’s get the i3lock
package
$ sudo xbps-install i3lock
Now, this can be configured via our ~/.config/i3/config file. We will assign a new mod key and combination to activate it when needed.
# It doesn't matter where you put these lines
# For sake of readability, I tend to put them close to lines either similar in function
# or similar keystrokes
vim ~/.config/i3/config
...
set $alt Mod1
bindsym $alt+l exec i3lock -c 000000
# the "-c 000000" argument will make the background pure black"
Now, upon holding either alt key and pressing L, your screen will lock. Simply type your user’s password and hit enter to unlock.
Setting Wallpapers with feh
⌗
feh
is a simple image viewing utility. We will go over it’s installation and usage as both an image viewer and wallpaper setter. First off, let’s get it.
There are three easy steps to automate this. First, installing feh. Second, making a bash function. Third, automating I3wm to pull from what the bash function does.
First, to install feh
$ sudo xbps-install feh
Now, a basic feh
configuration which it will reference in ~/.config/feh
$ mkdir -p ~/.config/feh
$ vim ~/.config/feh/themes
...
# -D will tell it to start in slideshow mode
# the -4 tells it to start paused and move on in 4 second increments
# if you enter a directory and open an image in feh, press H and it will begin a
# slideshow moving down the file structure
# --no-fehbg surpresses it from generating a file in your ~/ directory
# change 171717 to whatever hex color matches the rest of your theme
feh -D -4 --scale-down --no-febhg -B #171717
Now, let’s make a wallpaper directory. This is where our current wallpaper will be stored, both in use and referenced by i3 when starting up.
$ mkdir ~/Pictures/Wallpapers
Now we will make a simple bash function to select and set a wallpaper. This functions by taking $1
, which in shell simply means the words immediately following the name of the command.
vim ~/.bashrc
...
fehbg ()
{
cp "$1" ~/Pictures/CurrentWallpaper && feh --bg-fill --no-fehbg "$1"
}
...
To use the function, simply reload your environment by typing bash
. It will be permanent in all future sessions of bash, this manual step is only needed this time.
Now that it’s usable, you may use it on any image file to change the background and generate/overwrite a ~/Pictures/CurrentWallpaper file
fehbg ~/Pictures/Wallpapers/gruvboxlines.jpg
Now, let’s simply tell i3wm to run feh every time it starts.
$ vim ~/.config/i3/config
...
# Add this line to auto
exec feh --bg-scale --no-fehbg ~/Pictures/CurrentWallpaper
This setup is permanent and automatic. If you run fehbg in the middle of usage, it’ll replace the old CurrentWallpaper file with whatever you told it to, and I3 will remember to set it every single time you log in.
Menus and Bars⌗
Rofi⌗
First, we must install rofi.
$ sudo xbps-install rofi
This will place some sample and default configurations within /usr/share/rofi/ which we can use for a reference later.
Now, let’s set up Rofi to work with i3wm. This is very simple and involves assigning a key in i3wm to call Rofi, and generating a configuration file which rofi will pull from upon hitting that combo.
vim ~/.config/i3/config
...
# This line will make it so rofi opens when you hit Mod+D
bindcode $mod+40 exec "rofi -show drun"
Now, let’s set up a sample configuration file for Rofi. Mine may be accessed here There are many good examples out there on the internet for rofi configurations. Mine may be a good starting point.
Polybar⌗
Polybar is a program which generates and manages “bars” for screens, similar to how the taskbar works on windows. Setting up polybar is a little more involved than rofi in my experience, but once you have a good config, it’s easy to modify and manage. Polybar comes with system tray functionality for GUI programs which generate them upon running, such as KeepassXC
First, we must install it.
$ sudo xbps-install polybar
Now we must tell i3wm to begin polybar upon entrance into i3wm. To do this, we will once more go into i3’s config file
$ vim ~/.config/i3/config
...
# Put this line in somewhere to automatically start polybar when you start i3
...
exec polybar
In brief, polybar reads the config file located in ~/.config/polybar/config.ini. Polybar is very customizable. For a quick breakdown on how it functions, read this
Alternative Programs⌗
iwd
& openresolv
for wireless⌗
iwd
is a minimal, modern wireless daemon that works as a good drop in replacement for wpa_supplicant
for most desktop use cases. it supports openresolv
as it’s dhcp backend. once this is all set up, it’ll be safe to disable and uninstall wpa_supplicant
and it’s dependency dhcpcd
, as iwd
comes with it’s own dhcp program
first, we must install the two programs if not already installed
$ sudo xbps-install iwd openresolv
now, let’s configure iwd
to utilize openresolv
and enable it’s DHCP
$ mkdir /etc/iwd && touch /etc/iwd/main.conf
$ nano /etc/iwd/main.conf
Once inside, use these settings.
[General]
EnableNetworkConfiguration=True
[Network]
NameResolvingService=resolvconf
EnableIPv6=false
[Scan]
DisablePeriodicScan=true
Now, we may disable wpa_supplicant
, enable iwd
and see if it works after a restart
$ sudo rm -rf /var/service/wpa_supplicant
$ sudo ln -sf /etc/sv/iwd /var/service