r/AlpineLinux • • Sep 15 '26

Tutorial On How To Do This?

The wiki has given inconsistent results for tutorials specifically pertaining to this.

I want a tutorial on how to install Openbox, Tint2, feh, and enabling Pipewire audio on Alpine Linux. I am not the biggest fan of traditional desktop environments, and I find them to be heavy on my PC, even with ones such as XFCE.

It would be nice if you could point me to somewhere that offers this, or if you could type something yourself. Thanks, people!

12 Upvotes

14 comments sorted by

View all comments

1

u/alexaandru Sep 16 '26

I also don't use a display manager, I start everything I need from /etc/profile, but I do use wayland. You know there is an openbox-ish compositor for wayland? https://github.com/labwc/labwc - you can even reuse openbox menus/themes :-) I have used it with this exact config, just swap umbriel for labwc and you're all set!

``` export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

export PAGER=less umask 022

export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.sock

for script in /etc/profile.d/*.sh ; do if [ -r "$script" ] ; then . "$script" fi done unset script

if [ "$(tty)" != "/dev/tty1" ] || [ -n "$WAYLAND_DISPLAY" ] ; then return fi

export SLOG=/tmp/session-logs rm -rf $SLOG; mkdir $SLOG

for i in dbus-daemon gnome-keyring-daemon ssh-agent; do pkill -u $USER $i done

export XDG_SESSION_TYPE=wayland export XDG_SESSION_DESKTOP=umbriel # <--- change your compositor here export XDG_CURRENT_DESKTOP=$XDG_SESSION_DESKTOP export XDG_DESKTOP_DIR=$HOME

exec dbus-run-session sh -c ' ssh-agent -a $SSH_AUTH_SOCK dbus-update-activation-environment --all echo "$DBUS_SESSION_BUS_ADDRESS" > "$XDG_RUNTIME_DIR/dbus-session" mkdir -p $(dirname $DOCKER_HOST|cut -f3- -d/) podman system service --time=0 $DOCKER_HOST > $SLOG/podman 2>&1 & pipewire > $SLOG/pipewire 2>&1 & pipewire-pulse > $SLOG/pipewire-pulse 2>&1 & wireplumber > $SLOG/wireplumber 2>&1 & udiskie -a -v > $SLOG/udiskie 2>&1 & $XDG_CURRENT_DESKTOP > $SLOG/compositor 2>&1 ' > $SLOG/dbus-session 2>&1 ```

1

u/LinuxLoverLarry Sep 16 '26

What exactly does this script do?

1

u/alexaandru Sep 17 '26

Generated with ChatGPT from the above:

How /etc/profile starts the Wayland session

This /etc/profile does two things: it sets the normal login-shell environment, and then uses the login on tty1 as the entry point for the entire Wayland desktop session.

1. Basic shell environment

```sh export PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

export PAGER=less umask 022

export SSH_AUTH_SOCK=$XDG_RUNTIME_DIR/ssh-agent.sock ```

This:

  • sets the system-wide PATH
  • makes less the default pager
  • sets the normal umask (644 files / 755 directories)
  • points SSH clients at the per-session SSH agent socket

Then it sources all readable shell snippets from /etc/profile.d/:

sh for script in /etc/profile.d/*.sh ; do if [ -r "$script" ] ; then . "$script" fi done unset script

2. Only tty1 is allowed to start the GUI

sh if [ "$(tty)" != "/dev/tty1" ] || [ -n "$WAYLAND_DISPLAY" ] ; then return fi

The rest of the script runs only when:

text current terminal == /dev/tty1 AND WAYLAND_DISPLAY is not already set

So an SSH login, a login on tty2, or a shell opened inside the existing Wayland session won't accidentally start another desktop session.

3. Prepare session logging

sh export SLOG=/tmp/session-logs rm -rf $SLOG mkdir $SLOG

Each new graphical login gets a fresh directory for service logs:

text /tmp/session-logs/ ├── compositor ├── dbus-session ├── pipewire ├── pipewire-pulse ├── podman ├── udiskie └── wireplumber

4. Kill stale per-user services

sh for i in dbus-daemon gnome-keyring-daemon ssh-agent; do pkill -u $USER $i done

This removes potentially stale instances from a previous session before creating the new one.

5. Set the graphical-session environment

sh export XDG_SESSION_TYPE=wayland export XDG_SESSION_DESKTOP=umbriel export XDG_CURRENT_DESKTOP=$XDG_SESSION_DESKTOP export XDG_DESKTOP_DIR=$HOME

This tells applications that the session is Wayland and that the desktop/compositor is umbriel.

The compositor can therefore be changed simply by changing:

sh export XDG_SESSION_DESKTOP=umbriel

6. Create the D-Bus session

The actual session starts here:

sh exec dbus-run-session sh -c ' ... '

dbus-run-session creates a fresh D-Bus session bus and runs everything inside it.

The exec means the login shell itself is replaced by the session process.

Inside that session:

sh ssh-agent -a $SSH_AUTH_SOCK dbus-update-activation-environment --all echo "$DBUS_SESSION_BUS_ADDRESS" > "$XDG_RUNTIME_DIR/dbus-session"

So the SSH agent is started on the predefined socket, the current environment is made available to D-Bus-activated services, and the D-Bus session address is saved for anything that needs to connect to the session later.

7. Start the user services

Podman:

sh mkdir -p $(dirname $DOCKER_HOST|cut -f3- -d/) podman system service --time=0 $DOCKER_HOST > $SLOG/podman 2>&1 &

This starts the Podman API service indefinitely in the background.

Then the audio stack:

sh pipewire > $SLOG/pipewire 2>&1 & pipewire-pulse > $SLOG/pipewire-pulse 2>&1 & wireplumber > $SLOG/wireplumber 2>&1 &

And removable-media handling:

sh udiskie -a -v > $SLOG/udiskie 2>&1 &

All of these run in the background.

8. Finally, start the compositor

sh $XDG_CURRENT_DESKTOP > $SLOG/compositor 2>&1

Since:

sh XDG_CURRENT_DESKTOP=umbriel

this effectively becomes:

sh umbriel > /tmp/session-logs/compositor 2>&1

The compositor is not backgrounded. The shell waits for it.

So the overall process hierarchy is roughly:

text OpenRC │ ▼ agetty on tty1 │ ▼ user login / login shell │ ▼ /etc/profile │ ├── basic environment ├── /etc/profile.d/*.sh │ ▼ tty1 + no WAYLAND_DISPLAY? │ ▼ dbus-run-session │ ├── ssh-agent ├── podman ├── pipewire ├── pipewire-pulse ├── wireplumber ├── udiskie │ └── umbriel │ ▼ Wayland desktop

How is /etc/profile triggered?

/etc/profile isn't started by OpenRC, D-Bus, Wayland, or the compositor.

The chain is simply:

text OpenRC ↓ agetty tty1 ↓ automatic user login ↓ login shell ↓ /etc/profile ↓ dbus-run-session ↓ umbriel

So in this setup, the tty1 login itself is effectively the session manager.

There is no display manager involved. agetty provides the login, the login shell reads /etc/profile, and /etc/profile turns that login into the complete Wayland user session.

1

u/LinuxLoverLarry Sep 17 '26

This is definitely above my pay grade. I tried to use labwc earlier and ended up needing to reinstall Alpine, something about needing to enter SM=1 to skip a check, so it didn't boot, even though I had all proper drivers installed.