Configuring Sway

I’m publishing my config for the sway compositor. I am managing it via dotbare, for those who are familiar with such things, and want an easy way to get my latest changes.

I have included instructions in the readme to set this up using the official images. If there’s interest, I would be willing to publish pre-configured images.

This is a bit experimental, and some applications are broken under sway (in particular) and wayland (in general), but I already find it much more useful than the default LXDE environment, given the unique nature of the uConsole. I await your feedback.

For the impatient, here’s some screenshots:




3 Likes

I’ve been playing around with the PostmarketOS distro, which had SXMO as an option. The Wayland version of SXMO is built on top of Sway… and I’m enjoying it.

I have been thinking of switching from SXMO to a more vanilla version of Sway, so I’ll check out your config. Thanks for putting in the work.

how’s performance?
(20 chars)

Funny you should ask: it’s hard to say, because I don’t do anything terribly heavy weight. Mostly editing text files and some light browsing. I’ve been meaning to try some games, but I’m actually not much of a gamer and don’t know where to start. Maybe quake2 or Aleph One.

Being that sway is a wayland compositor, and as low-footprint as it gets, performance isn’t likely to be better than this (modulo bugs). Sway starts in a couple seconds. Noticeable, but not annoying.

I ran a very similar config on my pocketCHIP, and it was very responsive even on that much slower machine. Sway launches considerably faster on this CM4-based board than on the pocketCHIP. Almost as fast as on my X220.

Window management functions are instantaneous. Very snappy. Really doesn’t get better than this.

Firefox and chromium both seem to work well. Even video playback seems good, though I don’t plan on doing much of that – my goal is a low-distraction environment.

I may spend some time with surf, and see how that feels in comparison. The main appeal being that surf has its keyboard shortcuts, and with this little computer, that would make browsing much easier.

Basically, I’m trying to take the trackball out of the equation as much as possible – don’t get me wrong, I like the trackball. It’s a must-have feature. It’s better than a touch-screen for legacy X11 apps, and comes in handy more often than I’d like. But my goal is to make it something I hardly ever touch.

P.S. If there’s anything you want me to try, I might be willing to do a screen capture and share it.

can you try rapidly switching back and forth between multiple heavy windows (like opengl shit)

trying to judge this vs picom

I’ll try it: I don’t have any good way to capture HDMI at the moment, and any software-based screen capture would necessarily incur overhead.

If you can think of enough different stuff to try, make a list and I could maybe do it in a couple days.

In the mean time, I basically documented exactly how to set this all up. I would encourage you to just try it. Just clone your system SD card, or start on a fresh install. I could use help trouble-shooting the README and the install-deps script.

i’ll give it a try
i’m way too crossfaded to do any system maintanence right now thiough, so tomorrow

That is probably wise. I don’t plan to depend on the uConsole for a while, but it is fun to play with, and so I am a little bit cavalier. But I’m still sticking to the stock OS as much as possible until I learn this thing a bit more.

Apologies if anyone pulled in the past couple of hours (I doubt anyone has). I pushed a dodgy update that wasn’t quite ready for regular use.

Basically, I couldn’t find a wayland-compatible tool that would convert gamepad events to keyboard events, so I started rolling my own solution. It actually works. Kindof. But I noticed some issues with it after a short time, and so I have moved this code to a branch. In the future, I won’t push experimental changes to the config to main, and main should always be ready to run.

Haven’t tried it yet, but if you haven’t rebuilt the wheel already I think this might work. GitHub - sezanzeb/input-remapper: 🎮 ⌨ An easy to use tool to change the behaviour of your input devices.

Edit: Alright, I’ve tried it myself and it doesn’t work in PostmarketOS.

BTW, if anyone’s trying to get shutdown commands to function in SwayWM under PostmarketOS (which doesn’t have systemd), loginctl poweroff works.

just in case someone is interested: i uploaded my personal config for a feature complete sway based system, but its only supplied as a reference, as i’m sure i’ve forgotten a few steps in between.

Hey, that’s cool!

How do you like alpine?

tbh, needs a lot of thinking outside of the box and a lot of compiling your own stuff, but it works pretty well and as long as you need only basic packages, its surprisingly easy to use.

postmarketos on the other hand is sth i would not like to install again :wink:

I’d love to know more about what you had to do – I get it though, it’s hard to keep notes.

What about postmarketos did you find particularly painful?

I want to get to other distros at some point – after all, I can just swap SD cards – but I have some higher priority projects.

–Brandon

Well, first of all, postmarketOS was not booting up at all after rollout because a few config files were absurdly misconfigured and there were references to files which were simply forgotten in the bundling process of the initial image. As we know, even a missing background file will stop sway from booting - so this is a big drawback for a “simple to install” OS.

Also, the restrictions of tinywm make everything a lot more painful.
PulseAudio is working out of the box, but it’s buggy as hell.

As I’m not really fluent in setting up a desktop Linux (more of a server guy), it took me a whole day simply figuring out what was wrong.

The restrictions and tradeoffs in postmarketOS make sense when you have very old phone hardware or an ultra-low-power computer, but the Raspberry Pi 4 doesn’t require these, so it is, in fact, a bad pick.

Sadly, I only have a Compute Module 4 with eMMC, which is fast indeed, but requires disassembly for trying a new OS or fixing it if something went horribly wrong. Also, I’m pretty sure the connectors of the CM module are not designed for frequent reassembly. That’s why I’m not very keen on trying to build my own image from scratch - but if someone would supply a working (and up-to-date!) Arch, Debian, or Alpine base image (console) that is running from a CM4 with eMMC, I would happily switch over.

Yeah when I learned that the emmc models can’t boot from flash, I opted for the non emmc, for this exact reason. I’d consider getting a different pi board, save the emmc for when you find the distro and config you want.

How fast does it boot from EMMC? It seems like mine boots pretty fast once you get to the init phase, but before that there’s several seconds with a black screen which is where I assume I’m paying for the slow flash reads. How long does it take to start a heavyweight app like Firefox? That’s another one where I suspect the SD card is the bottleneck. Fortunately I spend most of my time in the shell :stuck_out_tongue:

My config repo (which I see had an influence) incldues a shell script to install dependencies on the stock image. If you want to go back to that, then maybe try that – I am hoping a few folks will try it on a fresh image and help me get it right. I have done my best to make it as legible and easy to modify as a bash script can be. Let me know if I missed anything. I’d be interested in taking some of your config changes, like adding wofi and waybar. If you fork my repo, you can maintain your tweaks on top of mine as a branch.

I also want to get to building custom images. Some scripting around qemu / docker to at least automate package installation. The state of things a couple years ago was that QEMU had partial support for RPI hardware, but didn’t fully emulate the broadcom gpu. It looks like perhaps that’s changed, but it won’t have the wacky display that the uConsole uses, so there are limits to what can be tested this way.

I also plan to take a look at buildroot, if you want truly minimalist built-from-scratch images. You need a hefty machine to do the cross-builds, and again, a lot of trial and error. But with buildroot you can pack a lot of functionality into a ~60 - 100mb base image, and the toolchain generates the disk image for you, ready to flash.

sorry, took a little while, was on vacation.
The boot process is pretty slow, dont have a direct comparison, but i assume most of the time its not the drive which is the bottleneck. Firefox starts in about 2s.

Yes i used your repo as a starting point (also gave credit to it in the readme :wink: )
right now i’m working on creating an image from scratch based on debian bookworm with the “tutorial” posted for kali linux machines - the reason is not that alpine is a bad system, but i assume the retropie emulator packages are much more optimized than everything i could do on my own and i would love to be able to start PSX roms with sound and more than 4FPS.