Build KLV Wayland Sway

Very small KL Linux variants


Moderator: Forum moderators

Post Reply
User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Build KLV Wayland Sway

Post by wiak »

EDIT: have now included a slightly fuller KL_sway variant build script that auto-includes firefox and pipewire. I've also provides iso snapshot and a few basic usage instructions. See post here: https://forum.puppylinux.com/viewtopic. ... 878#p98878

EDIT2: You likely want to sometimes open pcmanfm (and sakura terminal) as root user when running sway compositor as user spot. Here is one way how to: https://forum.puppylinux.com/viewtopic. ... 967#p98967

So you are interested in experimenting with tiling window managers, but happen to also want to experiment with Wayland?...

Since X on the rocks..., thought I'd make a basic KLV build with Wayland with Sway compositor (like i3 tiling desktop manager).

To make the build, simply download the attached script into empty build and bootfrom directory such as /KLV_sway on Linux formatted partition, remove its dummy .tar extension, make it executable (e.g. with chmod +x), and run it from that directory using command:

Code: Select all

./KLbuild_Void_wayland_sway_bash.sh

Per usual with FR, at the end of the build, the script provides exact grub stanza you can use to immediately thereafter boot it (the last UUID stanza for grub2 is recommended).

EDIT: Once at a terminal you can sudo shutdown -r now (to restart) or sudo shutdown -h now (to poweroff). DO NOT!!! use sudo reboot -f since that is too abrupt and can freeze the system since not a clean kill of processes first

I only included simple ttf font: font-bh-ttf. That was quite a small package (886k installed) and just enough for sway terminals and firefox and so on to work. You optionally may want liberation-fonts-ttf or whatever...

## IMPORTANT: PLEASE READ THESE NOTES:
In the below, 'Mod' means 'Windows key on keyboard'

# You can change timezone to your own when this KLV distro is running by using commands:
# rm /etc/localtime; ln -s /usr/share/zoneinfo/X/Y /etc/localtime # where X/Y might be e.g. Pacific/Auckland
# Alternatively, if you already have the f_ PLUGIN just modify around line 70 for your timezone prior to build.
# In w_changes=RAM2 mode, as root, you can use: snapmergepuppy to save session per usual
# For sway usage: refer, for example, to https://i3wm.org/docs/userguide.html
# For differences to i3 usage read: https://github.com/swaywm/sway/wiki/i3-Migration-Guide
# For configured key bindings: cat ~/.config/sway/config
# Mod+Enter to open simple terminal. Mod+Shift+b to open firefox; Mod+d for dmenu in top bar
# also view file for extra config details: /etc/sway/config.d/00
# You'll likely want to also install pipewire for Audio. Maybe KL team sfs addon will work?
# You can add as many valid commandlines as you want in here. Currently is relatively simplistic...
# Build includes NetworkManager so best use nmtui 'Activate a Connection', but also includes simple wiakwifi
# Mod+Shift+e to exit sway back to commandline
# For available Void Linux packages refer to: https://voidlinux.org/packages/
# JUST READ THE f_00_Void_wayland_sway_bash_no-kernel.plug TO UNDERSTAND HOW TO CUSTOMISE THE BUILD!

To save initial build time (and in case you have a working portable) browser is not installed. Set up to work with firefox after:

Code: Select all

xbps-install -Syu firefox

Thereafter can use: Mod+d then start typing firefox in resulting top bar to find firefox and launch it
or, per /etc/sway/config.d/100-wiak_global, use Mod+Shift+b

Build includes NetworkManager, so can connect to internet via:

Code: Select all

nmtui # use "Activate a Connection" option and ESC out once connected

It should be very easy learning how to build FirstRib-based KL distros using this simple build script exemplar. Just read the simple contents of the attached KLbuild_Void_wayland_sway_bash.sh script first of all, and then read the contents of the script auto-downloaded main build plug (f_00_Void_wayland_sway_bash_no-kernel.plug), which is simply a very short text file of package manager and simple config commands.

Build includes the following (those not currently commented out):

Code: Select all

xbps-install -Syu base-minimal bash sudo rsync
xbps-install -y eudev xdg-utils light chrony  # or maybe use ntpd?
xbps-install -y NetworkManager # includes wpa_supplicant as dependency
xbps-install -Sy dbus-elogind elogind polkit mesa-dri sway dmenu font-bh-ttf
# you optionally may want liberation-fonts-ttf or whatever...

# Choose your apps...
xbps-install -y grim slurp imv lxtask foot sakura geany pcmanfm
# You may want something like: xbps-install -Syu mtpaint firefox

For some detail on how such KL builds work you can refer to: https://forum.puppylinux.com/viewtopic. ... 487#p98487

Attachments
KLbuild_Void_wayland_sway_spot_firefox_pipewire.sh.tar
remove dummy tar and chmod +x prior to run
(3.26 KiB) Downloaded 48 times
KLbuild_Void_wayland_sway_bash.sh.tar
remove dummy tar and chmod +x prior to run
(3.24 KiB) Downloaded 106 times

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: Build KLV Wayland Sway

Post by wiak »

I downloaded the 20pipewire sfs from @fredx181. It's very small! However, I wanted it to try with KLV_sway (wayland), but noticed it was for X (at least using .xinitrc to start it all up).

However, with KLV_sway, after installing firefox, I found the instructions from Void Linux here worked fine getting pipewire to work for me: https://docs.voidlinux.org/config/media/pipewire.html

i.e. I just did a:

Code: Select all

xbps-install -Syu pipewire

I've just finished doing it so may have this wrong:

It seemed the pipewire package had wireplumber as dependency and also included pipewire-pulse.

I did:

Code: Select all

# mkdir -p /etc/pipewire/pipewire.conf.d
# ln -s /usr/share/examples/wireplumber/10-wireplumber.conf /etc/pipewire/pipewire.conf.d/

and also:

Code: Select all

# mkdir -p /etc/pipewire/pipewire.conf.d
# ln -s /usr/share/examples/pipewire/20-pipewire-pulse.conf /etc/pipewire/pipewire.conf.d/

Haven't installed bluetooth component libspa-bluetooth as yet.

Then I used sway config file ~/.config/sway/config (copied originally from /etc/sway/config) to autostart pipewire simply with exec pipewire line at end of that config.

It is working fine without pavucontrol just now so I haven't yet installed pipewire-pulse, but that would help set volumes and so on.

EDIT: Couple of interesting things: Though above Void Linux docs say should be started with normal user, I've actually started it logged in to sway compositor as user root... Also, I have since modified volumes via pavucontrol (after now installing pipewire-pulse) and note that settings were automatically saved. In fact I've since removed pavucontrol and pipewire-pulse and the previous volume levels (I set output device speaker to 100% actually) have remained at that setting. When I now play a youtube in firefox I just turn down the volume from the youtube icon for the moment. But yes, using pipewire-pulse and the likes of pavucontrol still seems the best approach since no easy way to adjust pipewire volume I know of otherwise.

I'm enjoying this simple sway install. It's pretty small as is with just firefox, geany and pcmanfm and now with pipewire working too. Good for practicing using sway whilst being able to browse normally and so on.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

Clarity
Posts: 3829
Joined: Fri Jul 24, 2020 10:59 pm
Has thanked: 1628 times
Been thanked: 522 times

Re: Build KLV Wayland Sway

Post by Clarity »

Looking forward to your next ISO with these 2 as basic ingredients in the build.

As you noted, X on the rocks and with this sound, KLs are leading us with both current audio and video Linux directions.

Thanks for what you and the KL developers are doing for this family of forum distros.

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: Build KLV Wayland Sway

Post by wiak »

Yes I probably will make a snapshot iso of this one, especially since it is relatively small so a convenient Sway/Wayland testbed. I needed pipewire to work first since pulseaudio just wouldn't have satisfied the otherwise up-to-date nature of the underlying components. A tiling-style compositor is certainly not what most users are accustomed to (me neither) but thanks to all the KL tiling wm experimenters recently that encouraged me to make this little KL_Sway exemplar. In practice i3 is a relatively popular tiling window manager for X, so many great tutorials and docs that conveniently also apply to Sway.

I suspect we'll gravitate towards using labwc compositor quite a bit instead since that one is stacked-mode/floating compositor and inspired by openbox, though if Xfce manages to convert its functionality to Wayland (they plan to start with weston compositor code I've read) then that will be a good alternative to the already Wayland-ready GNOME or KWin/Plasma. Enlightenment is another interesting option. However, Sway may prove to be the lightweight and interesting alternative, and you can float windows using Sway and also use tabbed windows so it is pretty versatile despite feeling strange to me.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

ISOs: KLV Wayland Sway

Post by wiak »

I created two snapshot isos of the build produced by the larger firefox_pipewire KL_sway script attached to post one of this thread.

Includes wayland compositor Sway, full firefox, pipewire, pavucontrol (has pipewire-pulse included, but no pulseaudio since not required or wanted) geany, pcmanfm, mtpaint, and more (look inside the build script in post one for details).

The two isos are basically identical except one is compressed using zstd 19 so a bit bigger but faster booting/using (so generally recommended). The other is compressed using high xz compression such that it can be fitted onto actual CD if anyone still has such a thing. No idea if KLV_sway will boot on old machines though...

recommended zstd compressed iso here: https://mega.nz/file/RnNBnAqa#dPqkyBp05 ... SD4FIxMBFY
md5sum: 22135eef121f8e3835446aead6ebec9d KLV_sway_pipewire-1.0.iso
Size: 720MB

xz high compressed iso here: https://mega.nz/file/kj0QFLrR#p9dZGBOpJ ... vlbc33kV6A
md5sum: a99925604c7bf7032a8cfd17648b63ed KLV_sway_pipewire-1.0xz.iso
Size: 613MB

USAGE:
This iso is not for these users wanting GUI ease-of-use-wizards. It is expected instead that you are familiar with and like using the commandline for lots of tasks...

Here is a quick start:

1. Boot the distro (could be frugal install or should work fine from Ventoy including RAM2 persistence mode)
2. Open a terminal from Sway via key combination: Mode + Enter key (Mode being the Windows key).
3. Enter command: nmtui and then Activate a Connection to connect to Internet (uses NetworkManager underneath).
4. Press key combination Mode + Shift + b to open browser (which is Firefox)
5. Press key combination Mode + d to get top bar dmenu launcher entry line. In that top line start entering command pav and hit enter once pavucontrol appears to start that up.
Then adjust the pavcontrol Playback volume pretty high to start with.
6. Visit youtube.com and play a video to check sound working and volume adjustable via pavucontrol.
7. pcmanfm, geany and mtpaint are all included in the build so it is pretty useful overall despite having few frills.
8. Assuming you are in w_changes=RAM2 mode for persistence you should enter command: snapmergepuppy in terminal to save to (the auto-created upper_changes) persistence folder.
9. When you want to shutdown your computer, in terminal use command: sudo shutdown -h now (or use sudo shutdown -r now; if you instead want to restart computer).

DO NOT use sudo reboot -f since that restarts immediately and causes a freeze since processes need auto-shutdown more carefully (which is what shutdown commands do).

For other Sway usage tricks, see first post links re: i3 tutorials/docs given in first post of this thread. https://i3wm.org/docs/userguide.html

NOTE that I'm in no hurry to polish up this sway release - it is for people who like commandline really, but could do with some additional apps and fonts added... Could also do with having libspa-bluetooth added and related bluetooth utils; I think I forgot (unless it was an auto-dependency of pipewire; I can't remember and not in it just now).

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

williwaw
Posts: 1948
Joined: Tue Jul 14, 2020 11:24 pm
Has thanked: 172 times
Been thanked: 369 times

Re: Build KLV Wayland Sway

Post by williwaw »

wiak wrote: Sat Sep 16, 2023 11:32 pm

I suspect we'll gravitate towards using labwc compositor quite a bit instead

Why not both at the same time if wayland is going to be supported?

supporting multiple wms in a single wayland effort seem like a strong use case for scripted net builds over isos.
just a few commented lines for each choice in the plug.

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: Build KLV Wayland Sway

Post by wiak »

So though pipewire audio working on current KLV wayland sway release, the quality isn't so good as on my Linux Mint system (EDIT: hmmm... seems to be fine now and I haven't added anything...). I suspect I have some underneath alsa-related configs missing or maybe pulse or pipewire configs. I'm working on it... Currently I've made a quick FR initrd install of Garuda Sway (hacking bits out of old weedogit script to do that - I will be fixing up the new firstribit version of that early next year - it's pretty convenient being able to FR a big mainline distro using FR initrd I find).

Garuda Sway is very polished/eye-candy-wise so I can see how they do that and pipewire. Mind you, most of the Sway-related keyboard commands I'm happy with in KLV_Sway aren't working so Garuda changed tons of such stuff, which annoys me a bit since don't want to learn alternatives...

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

User avatar
wiak
Posts: 4082
Joined: Tue Dec 03, 2019 6:10 am
Location: Packing - big job
Has thanked: 65 times
Been thanked: 1208 times
Contact:

Re: Build KLV Wayland Sway

Post by wiak »

THIS IS AN IMPORTANT TIP!

When using spot desktop with sway, the problem becomes how to open pcmanfm as root user and thus to also be able to use Tools > Open Current Folder in Terminal (as root user)

In spot opened terminal you can do above with following command (from S. Chauveau: https://unix.stackexchange.com/question ... er-wayland ):

Code: Select all

sudo env WAYLAND_DISPLAY="$XDG_RUNTIME_DIR/$WAYLAND_DISPLAY"  XDG_RUNTIME_DIR=/user/run/0  pcmanfm

(You can put above in a small script for convenience of course; in my test I simply made as executable script /usr/local/bin/pcmanfmr).

Unfortunately, I forgot to set default terminal used by pcmanfm, so once root user pcmanfm opens:

Edit > Preferences > Advanced

and make "Terminal emulator" sakura

NOTE that graphical apps can then be run in that root sakura terminal and will display fine (e.g. gparted once you install it...)
=============================

I think above method is better than alternative xhost methods given (and you'd need xhost command available for this method anyway, which it isn't in default KLV_sway install):

$ xhost si:localuser:root

and once finished using

$ xhost -si:localuser:root
=============================

You may notice that I'm starting to use Wayland now... Reason is that I feel a need to learn how to work in Wayland since all the X tricks I know will become irrelevant in future developments.
Hence pipewire also. It is certainly not because I have any problems with the likes of wonderful XFCE; it's just that it won't be here forever and my brain better learn now because it is easier, I'm told, to learn new tricks when we are still young! I must say I am enjoying playing with this KLV_sway_pipewire distro and moreso the more tricks I master... I particularly like the way you can drag windows via their top bar to different tiling positions or to make them floating windows with Mode+Shift+Space. Interesting, by accident I found you can join several tiles together and float the whole lot as one group.

https://www.tinylinux.info/
DOWNLOAD wd_multi for hundreds of 'distros' at your fingertips: viewtopic.php?p=99154#p99154
Αξίζει να μεταφραστεί;

Post Reply

Return to “KL minis”