Miriway: the snap

Miriway

A bit of history

Mir started out as a library for developing compositors in general and specifically for Unity8 (now Lomiri). While Lomiri is still an active community project, in recent years the focus for Mir has been Ubuntu Frame.

While there have been proof-of-concept examples of more complex compositors it wasn’t until last summer that I decided to revisit using Mir for a “desktop environment”. The result of this is Miriway a Mir based Wayland compositor with enough configuration options to support a range of desktop environments.

What is Miriway not?

Miriway isn’t a full featured desktop environment but it could, in principle, be used to build one.

It also isn’t fully “desktop ready” as there are quite a lot of “papercut” concerns that need to be fixed in Mir.

But it does provide a way to test Mir and other components of a desktop environment that makes these “papercuts” visible and much more likely to be fixed.

The Miriway snap

Miriway is available as a snap:

This combines Miriway with some additional desktop components (at the time of writing these are yambar, swaybg, synapse and Xwayland) to provide a (very basic) desktop environment.

sudo snap install --edge --classic miriway

After this you can select “Miriway” from the “cog menu” at login:

You don’t have to use Miriway as a snap, it can be downloaded, built and installed from github. But if you do this (or have done this in the past) beware that there are some differences in the configuration that can confuse the snap distribution.

If you have experimented with Miriway in the past, you may want to delete (or rename) the following files to avoid incompatibility with the snap:

  • /usr/local/etc/xdg/xdg-miriway/miriway-shell.config
  • ~/.config/miriway-shell.config

Configuring the Miriway snap

Installing the snap creates a couple of default configuration files:

$ find /etc/xdg/xdg-miriway/ -type f
/etc/xdg/xdg-miriway/yambar/config.yml
/etc/xdg/xdg-miriway/miriway-shell.config

When you start Miriway these are the configuration files that will be used unless miriway-shell.config has been overridden. For example, you can copy the default miriway-shell.config to ~/.config and modify it, the snap will then use this version. Here is the default content:

~$ cat /etc/xdg/xdg-miriway/miriway-shell.config 
x11-window-title=Miriway
idle-timeout=600
app-env-amend=XDG_SESSION_TYPE=wayland:GDK_USE_PORTAL=none:XDG_CURRENT_DESKTOP=Miriway:GTK_A11Y=none
shell-component=dbus-update-activation-environment --systemd DISPLAY WAYLAND_DISPLAY XDG_SESSION_TYPE XDG_CURRENT_DESKTOP
xwayland-path=/snap/miriway/current/usr/bin/Xwayland

ctrl-alt=t:miriway-unsnap /snap/miriway/current/usr/local/bin/miriway-terminal
shell-component=swaybg -i /usr/share/backgrounds/warty-final-ubuntu.png
shell-component=yambar --config="/etc/xdg/xdg-miriway/yambar/config.yml"
shell-component=miriway-unsnap /snap/miriway/current/usr/bin/synapse --startup
shell-meta=a:miriway-unsnap /snap/miriway/current/usr/bin/synapse

meta=Left:@dock-left
meta=Right:@dock-right
meta=Space:@toggle-maximized
meta=Home:@workspace-begin
meta=End:@workspace-end
meta=Page_Up:@workspace-up
meta=Page_Down:@workspace-down
ctrl-alt=BackSpace:@exit

The lines you are most likely to customise are the following:

ctrl-alt=t:miriway-unsnap /snap/miriway/current/usr/local/bin/miriway-terminal
shell-component=swaybg -i /usr/share/backgrounds/warty-final-ubuntu.png
shell-component=yambar --config="/etc/xdg/xdg-miriway/yambar/config.yml"
shell-component=miriway-unsnap /snap/miriway/current/usr/bin/synapse --startup
shell-meta=a:miriway-unsnap /snap/miriway/current/usr/bin/synapse

The shell-component= lines specify that swaybg, yambar and synapse (from the snap) are started as part of the shell. You can add to (or replace) these with components from your host environment. But if you do this, prefix the command with miriway-unsnap. For example, you could replace yambar with mate-panel:

shell-component=miriway-unsnap mate-panel

Similarly, shell-meta=a: gives a command to launch when Meta-A is pressed. This can also be replaced (again prefixed with miriway-unsnap):

shell-meta=a:miriway-unsnap wofi --show drun --location top_left

The future

The Miriway snap makes it easy to experiment with Mir in a desktop scenario and the Mir team has been “dogfooding” Miriway. As a result we have made some improvements and we are committed to improving this experience over the coming months.

4 Likes

Here’s my config, using the MATE panel:

shell-component=miriway-unsnap mate-panel
ctrl-alt=t:miriway-unsnap gnome-terminal

# Got used to this one…
meta=Up:@toggle-maximized

# This makes my Caps key a Compose one
keymap=pl++compose:caps

# This lets me work with two displays
display-config=static=/home/michal/.config/miriway.display

# This enables middle-click paste and works around a Firefox bug:
# https://bugzilla.mozilla.org/show_bug.cgi?id=1791417
add-wayland-extensions=zwp_primary_selection_device_manager_v1

MATE currently has the unhelpful behaviour of setting DISPLAY=$WAYLAND_DISPLAY, so I’m not using their terminal or launcher (mate-panel --run-dialog).

My display config:

layouts:
  default:
    cards:
    - card-id: 0
      DisplayPort-1:
        state: disabled
  dual:
    cards:
    - card-id: 0
      eDP-1:
        position: [1920, 0]
        scale: 1.5

This lets me switch between the two setups (“default” and “dual”) by issuing:

echo "dual" > ~/.config/miriway.display-layout

You can read more about the display configuration in the Ubuntu Frame documentation.

1 Like

I have a couple of extra bits:

# Have a policykit agent running; requires lxqt-policykit installed
shell-component=miriway-unsnap systemd-run --user --scope --slice=background.slice lxqt-policykit-agent
# A nice notification agent; requires sway-notification-center installed
shell-component=miriway-unsnap systemd-run --user --scope --slice=background.slice swaync

They also get run through systemd-run, to place them in the (more-appropriate) background slice.

(I’ve also tried to add swaylock, but that’s blocked on extra protocol support, notably ext_screenlock)

It would also be helpful to get systemd user-session integration; that can make xdg-autostart work (by just enabling the systemd thingy necessary), and is a useful place to hook various services. It looks like This i3 setup could be repurposed pretty easily; we probably don’t want to invoke systemd directly in Miriway (at least for now :smiling_imp: ).

Unfortunately, this leaves everything spawned by synapse inheriting the snap environment, which breaks… a lot, most notably 3D acceleration. Launchers really need to either be snap aware, or outside the snap :frowning:

Agreed. Looking to fix that.

[edit]
Fixed. (And the default config described above updated to match)

I’ll also share my current setup (shamelessly stealing ideas from @raof above):

Additional installed packages

I installed these packages natively (outside the snap):

sudo apt install lxqt-policykit sway-notification-center gnome-console

Miriway config changes

  1. Change terminal to gnome-console (a.k.a. kgx)
  2. Add policykit and notification agents
~$ diff {/etc/xdg/xdg-miriway,~/.config}/miriway-shell.config
7c7
< ctrl-alt=t:miriway-unsnap /snap/miriway/current/usr/local/bin/miriway-terminal
---
> ctrl-alt=t:miriway-unsnap kgx
11a12,14
> 
> shell-component=miriway-unsnap systemd-run --user --scope --slice=background.slice lxqt-policykit-agent
> shell-component=miriway-unsnap systemd-run --user --scope --slice=background.slice swaync

[Note]

Revised after some changes to the snap fixed some of the issues the original worked around.

1 Like