<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=La9</id>
	<title>Alpine Linux - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=La9"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/wiki/Special:Contributions/La9"/>
	<updated>2026-04-27T14:28:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Setting_up_ZFS_on_LUKS&amp;diff=22148</id>
		<title>Setting up ZFS on LUKS</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Setting_up_ZFS_on_LUKS&amp;diff=22148"/>
		<updated>2022-07-27T14:27:07Z</updated>

		<summary type="html">&lt;p&gt;La9: native encryption&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Native Encryption =&lt;br /&gt;
&lt;br /&gt;
ZFS now has native support for encryption.  This has many advantages over ZFS on LUKS including multi-disk, encrypted zfs send, portable across *BSD/Linux and others.&lt;br /&gt;
&lt;br /&gt;
For a Root on ZFS guide with native encryption, see [https://openzfs.github.io/openzfs-docs/Getting%20Started/Alpine%20Linux/Root%20on%20ZFS/1-preparation.html here].&lt;br /&gt;
&lt;br /&gt;
= Introduction =&lt;br /&gt;
&lt;br /&gt;
This documentation describes how to set up Alpine Linux using ZFS with a pool that is located in an encrypted partition. To encrypt the partition the Device Mapper crypt (dm-crypt) module and Linux Unified Key Setup (LUKS) is used.&lt;br /&gt;
&lt;br /&gt;
Note that you must install the &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; directory on an unecrypted partition to boot correctly.&lt;br /&gt;
&lt;br /&gt;
We&#039;ll be using the syslinux bootloader and traditional BIOS booting.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
* An instance Alpine on a medium other than the one you&#039;ll boot from, see [[Installation|official installation guide.]]&lt;br /&gt;
{{Note|We can&#039;t use the live environment from the installation isos, because we&#039;ll install the ZFS kernel module and that isn&#039;t possible with a read-only /boot (as provided by the iso).}}&lt;br /&gt;
&lt;br /&gt;
== Hard Disk Device Name ==&lt;br /&gt;
&lt;br /&gt;
The following documentation uses the &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; device as the installation destination. If your environment uses a different device name for your hard disk, use the corresponding device name in the examples.&lt;br /&gt;
&lt;br /&gt;
= Setting up Alpine Linux Using ZFS on Top of a LUKS Partition =&lt;br /&gt;
&lt;br /&gt;
To install Alpine Linux in a ZFS pool on top of a LUKS encrypted partition, you cannot use the [[Installation|official installation]] procedure. The installation requires several manual steps you must run in the Alpine Linux Live CD environment.&lt;br /&gt;
&lt;br /&gt;
== Preparing the Installation Environment ==&lt;br /&gt;
&lt;br /&gt;
Before you begin to install Alpine Linux on the medium you intend to boot from, prepare the installation you already have:&lt;br /&gt;
&lt;br /&gt;
* Update the &amp;lt;code&amp;gt;apk&amp;lt;/code&amp;gt; cache:&lt;br /&gt;
&lt;br /&gt;
 # apk update&lt;br /&gt;
&lt;br /&gt;
* Install the following packages required to set up ZFS and LUKS:&lt;br /&gt;
&lt;br /&gt;
 # apk add haveged cryptsetup e2fsprogs syslinux zfs zfs-$(uname -r | rev | cut -d&#039;-&#039; -f1 | rev)&lt;br /&gt;
 # modprobe zfs&lt;br /&gt;
&lt;br /&gt;
* Optionally, start the &amp;lt;code&amp;gt;haveged&amp;lt;/code&amp;gt; service for unpredictable random numbers used for encryption:&lt;br /&gt;
&lt;br /&gt;
 # rc-service haveged start&lt;br /&gt;
&lt;br /&gt;
== Creating the Partition Layout ==&lt;br /&gt;
&lt;br /&gt;
Linux requires an unencrypted &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; partition to boot. You can assign the remaining space for the encrypted ZFS pool.&lt;br /&gt;
&lt;br /&gt;
* Start the &amp;lt;code&amp;gt;fdisk&amp;lt;/code&amp;gt; utility to set up partitions:&lt;br /&gt;
&lt;br /&gt;
 # fdisk /dev/sda&lt;br /&gt;
&lt;br /&gt;
:* Create the &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; partition:&lt;br /&gt;
::* Enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;100m&amp;lt;/code&amp;gt; to create a new 100 MB primary partition.&lt;br /&gt;
&lt;br /&gt;
:* Set the &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; partition active:&lt;br /&gt;
::* Enter &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;1&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
:* Create the LUKS partition:&lt;br /&gt;
::* Enter &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt; &amp;amp;rarr; &amp;lt;code&amp;gt;2&amp;lt;/code&amp;gt; to start creating the next partition. Press &amp;lt;code&amp;gt;Enter&amp;lt;/code&amp;gt; to select the default start cylinder. Enter the partition size. For example, &amp;lt;code&amp;gt;512m&amp;lt;/code&amp;gt; for 512 MB or &amp;lt;code&amp;gt;5g&amp;lt;/code&amp;gt; for 5 GB. Alternatively, press &amp;lt;code&amp;gt;Enter&amp;lt;/code&amp;gt; to set the maximum available size.&lt;br /&gt;
&lt;br /&gt;
:* To verify the settings, press &amp;lt;code&amp;gt;p&amp;lt;/code&amp;gt;. The output should look similar to this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Device     Boot  Start      End  Sectors  Size Id Type&lt;br /&gt;
/dev/sda1  *      2048   206847   204800  100M 83 Linux&lt;br /&gt;
/dev/sda2       206848 41943039 41736192 19.9G 83 Linux&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Press &amp;lt;code&amp;gt;w&amp;lt;/code&amp;gt; to save the changes.&lt;br /&gt;
&lt;br /&gt;
* Optionally, fill the LUKS partition with random values:&lt;br /&gt;
&lt;br /&gt;
 # haveged -n 0 | dd of=/dev/sda2&lt;br /&gt;
&lt;br /&gt;
{{Note|Depending on the size of the partition, this process can take from several minutes to many hours.}}&lt;br /&gt;
&lt;br /&gt;
== Encrypting the ZFS Partition == &lt;br /&gt;
&lt;br /&gt;
* To encrypt the partition which will later contain the LVM PV:&lt;br /&gt;
&lt;br /&gt;
 # cryptsetup luksFormat /dev/sda2&lt;br /&gt;
&lt;br /&gt;
:{{Note|Alpine Linux uses the &amp;lt;code&amp;gt;en-us&amp;lt;/code&amp;gt; keyboard mapping when prompting for the password to encrypt the partition at boot time. If you changed the keyboard map in the temporary environment, the password you enter during encrypting the partition in this step, may not match the password you will enter during the system boots.}}&lt;br /&gt;
: If you prefer setting an individual hashing algorithm and hashing schema:&lt;br /&gt;
:* To run a benchmark:&lt;br /&gt;
&lt;br /&gt;
 # cryptsetup benchmark&lt;br /&gt;
&lt;br /&gt;
:* To encrypt the partition using individual settings, enter, for example:&lt;br /&gt;
&lt;br /&gt;
 # cryptsetup -v -c serpent-xts-plain64 -s 512 --hash whirlpool --iter-time 5000 --use-random luksFormat /dev/sda2&lt;br /&gt;
&lt;br /&gt;
== Creating the filesystems ==&lt;br /&gt;
&lt;br /&gt;
* Open the LUKS partition:&lt;br /&gt;
&lt;br /&gt;
 # cryptsetup open --type luks /dev/sda2 crypt&lt;br /&gt;
&lt;br /&gt;
=== Creating the ZFS pool ===&lt;br /&gt;
&lt;br /&gt;
 # zpool create -o ashift=12 -O normalization=formD -O atime=off -m none -R /mnt -O compression=lz4 tank /dev/mapper/crypt&lt;br /&gt;
&lt;br /&gt;
Meaning of the &amp;lt;code&amp;gt;zpool create&amp;lt;/code&amp;gt; options:&lt;br /&gt;
&lt;br /&gt;
{| cellpadding=&amp;quot;5&amp;quot; border=&amp;quot;1&amp;quot; class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|- &lt;br /&gt;
! Option&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| zpool create&lt;br /&gt;
| Creating the zpool&lt;br /&gt;
|-&lt;br /&gt;
| -o ashift=12&lt;br /&gt;
| 4K blocks&lt;br /&gt;
|-&lt;br /&gt;
| -O normalization=formD&lt;br /&gt;
| Set the default Unicode (UTF-8) normalization to &#039;formD&#039;&lt;br /&gt;
|-&lt;br /&gt;
| -O atime=off&lt;br /&gt;
| Disabling updates to file access time. This reduces writes to disk, but might cause issues with mailers, like &amp;lt;code&amp;gt;mutt&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
| -m none&lt;br /&gt;
| No mountpoint, as we&#039;ll handle this later.&lt;br /&gt;
|-&lt;br /&gt;
| -R /mnt&lt;br /&gt;
| Set the altroot to &amp;lt;code&amp;gt;/mnt&amp;lt;/code&amp;gt;. It&#039;s like a temporary mountpoint for the pool.&lt;br /&gt;
|-&lt;br /&gt;
| -O compression=lz4&lt;br /&gt;
| Use lz4 compression for the pool. Is generally recommended.&lt;br /&gt;
|-&lt;br /&gt;
| tank&lt;br /&gt;
| The pool name. &amp;lt;code&amp;gt;tank&amp;lt;/code&amp;gt; will be used in throughout this guide.&lt;br /&gt;
|-&lt;br /&gt;
| /dev/mapper/crypt&lt;br /&gt;
| The path to the block device ZFS will use.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After completing this, confirm that the pool has been created:&lt;br /&gt;
&lt;br /&gt;
 # zpool status&lt;br /&gt;
&lt;br /&gt;
Should return something like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  pool: tank&lt;br /&gt;
 state: ONLINE&lt;br /&gt;
  scan: none requested&lt;br /&gt;
config:&lt;br /&gt;
&lt;br /&gt;
	NAME         STATE     READ WRITE CKSUM&lt;br /&gt;
	tank         ONLINE       0     0     0&lt;br /&gt;
	  crypt      ONLINE       0     0     0&lt;br /&gt;
&lt;br /&gt;
errors: No known data errors&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Creating the required datasets ===&lt;br /&gt;
&lt;br /&gt;
 # zfs create -o mountpoint=none -o canmount=off tank/ROOT&lt;br /&gt;
 # zfs create -o mountpoint=/ tank/ROOT/alpine&lt;br /&gt;
&lt;br /&gt;
=== Creating optional datasets (feel free to add your own) ===&lt;br /&gt;
&lt;br /&gt;
 # zfs create -o mountpoint=/home tank/HOME&lt;br /&gt;
 # zfs create -o mountpoint=/var/log tank/LOG&lt;br /&gt;
&lt;br /&gt;
== Creating the &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; filesystem ==&lt;br /&gt;
&lt;br /&gt;
 # mkfs.ext4 /dev/sda1&lt;br /&gt;
&lt;br /&gt;
== Mounting the &amp;lt;code&amp;gt;/boot&amp;lt;/code&amp;gt; filesystem ==&lt;br /&gt;
&lt;br /&gt;
* Create &amp;lt;code&amp;gt;/mnt/boot/&amp;lt;/code&amp;gt; directory and mount the &amp;lt;code&amp;gt;/dev/sda1&amp;lt;/code&amp;gt; partition in this directory:&lt;br /&gt;
&lt;br /&gt;
 # mkdir /mnt/boot/&lt;br /&gt;
 # mount -t ext4 /dev/sda1 /mnt/boot/&lt;br /&gt;
&lt;br /&gt;
== Installing Alpine Linux ==&lt;br /&gt;
&lt;br /&gt;
In this step you will install Alpine Linux in the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory, which contains the mounted file system structure.&lt;br /&gt;
&lt;br /&gt;
* Install Alpine Linux:&lt;br /&gt;
&lt;br /&gt;
 # setup-disk -m sys /mnt/&lt;br /&gt;
&lt;br /&gt;
: The installer downloads the latest packages to install the base installation. Additionally, the installer automatically creates the entries for the mount points in the &amp;lt;code&amp;gt;fstab&amp;lt;/code&amp;gt; file (but we&#039;ll have to edit it manually later), which are currently mounted in the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory.&lt;br /&gt;
&lt;br /&gt;
: {{Note|The automatic writing of the master boot record (MBR) fails in this step. Later, you&#039;ll write the MBR to the disk manually.}}&lt;br /&gt;
&lt;br /&gt;
* To enable the operating system to decrypt the LUKS partition at boot time, create the &amp;lt;code&amp;gt;/mnt/etc/crypttab&amp;lt;/code&amp;gt; file. Enter the following line into the file to decrypt the &amp;lt;code&amp;gt;/dev/sda2&amp;lt;/code&amp;gt; partition using the &amp;lt;code&amp;gt;luks&amp;lt;/code&amp;gt; module and map it to the &amp;lt;code&amp;gt;lvmcrypt&amp;lt;/code&amp;gt; name:&lt;br /&gt;
&lt;br /&gt;
 crypt    /dev/sda2    none    luks&lt;br /&gt;
&lt;br /&gt;
* Delete the zfs entries in &amp;lt;code&amp;gt;/mnt/etc/fstab&amp;lt;/code&amp;gt; as ZFS mounts them automagically. Your fstab should look similar to this:&lt;br /&gt;
&lt;br /&gt;
  UUID=6b4f2c9c-0a0f-4a8c-a73b-d2b47920ad6f	/boot	ext4	rw,relatime,stripe=4,data=ordered	0 2&lt;br /&gt;
&lt;br /&gt;
* Edit the &amp;lt;code&amp;gt;/mnt/etc/mkinitfs/mkinitfs.conf&amp;lt;/code&amp;gt; file and append the &amp;lt;code&amp;gt;cryptsetup&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;zfs&amp;lt;/code&amp;gt; module to the &amp;lt;code&amp;gt;features&amp;lt;/code&amp;gt; parameter:&lt;br /&gt;
&lt;br /&gt;
 features=&amp;quot;ata base ide scsi usb virtio ext4 lvm &amp;lt;u&amp;gt;cryptsetup zfs&amp;lt;/u&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
* Rebuild the initial RAM disk:&lt;br /&gt;
&lt;br /&gt;
 # mkinitfs -c /mnt/etc/mkinitfs/mkinitfs.conf -b /mnt/ $(ls /mnt/lib/modules/)&lt;br /&gt;
&lt;br /&gt;
: The command uses the settings from the &amp;lt;code&amp;gt;mkinitfs.conf&amp;lt;/code&amp;gt; file set in the &amp;lt;code&amp;gt;-c&amp;lt;/code&amp;gt; parameter to generate the RAM disk. The command is executed in the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory and the RAM disk is generated using the modules for the installed kernel. Without setting the kernel version using the &amp;lt;code&amp;gt;$(ls /mnt/lib/modules/&amp;lt;/code&amp;gt;) option, &amp;lt;code&amp;gt;mkinitfs&amp;lt;/code&amp;gt; tries to generate the RAM disk using the kernel version installed in the temporary environment, which can differ from the latest one installed by the &amp;lt;code&amp;gt;setup-disk&amp;lt;/code&amp;gt; utility.&lt;br /&gt;
&lt;br /&gt;
* Edit the &amp;lt;code&amp;gt;/mnt/etc/update-extlinux.conf&amp;lt;/code&amp;gt; file, set the root ZFS dataset and append the following kernel options to the &amp;lt;code&amp;gt;default_kernel_opts&amp;lt;/code&amp;gt; parameter:&lt;br /&gt;
&lt;br /&gt;
 root=tank/ROOT/alpine&lt;br /&gt;
 default_kernel_opts=&amp;quot;... &amp;lt;u&amp;gt;cryptroot=/dev/sda2 cryptdm=crypt rootfstype=zfs&amp;lt;/u&amp;gt;&amp;quot;&lt;br /&gt;
&lt;br /&gt;
: The &amp;lt;code&amp;gt;cryptroot&amp;lt;/code&amp;gt; parameter sets the name of the device that contains the root file system. The &amp;lt;code&amp;gt;cryptdm&amp;lt;/code&amp;gt; parameter sets the name of the mapping previously set in the &amp;lt;code&amp;gt;crypttab&amp;lt;/code&amp;gt; file. The &amp;lt;code&amp;gt;rootfstype&amp;lt;/code&amp;gt; option sets the root filesystem type to zfs.&lt;br /&gt;
&lt;br /&gt;
* Because the &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt; utility operates only on the &amp;lt;code&amp;gt;/boot/&amp;lt;/code&amp;gt; directory, temporarily change the root to the &amp;lt;code&amp;gt;/mnt/&amp;lt;/code&amp;gt; directory and update the boot loader configuration:&lt;br /&gt;
&lt;br /&gt;
 # chroot /mnt/&lt;br /&gt;
 # update-extlinux&lt;br /&gt;
 # exit&lt;br /&gt;
&lt;br /&gt;
: Ignore the errors the &amp;lt;code&amp;gt;update-extlinux&amp;lt;/code&amp;gt; utility displays.&lt;br /&gt;
&lt;br /&gt;
* Write the MBR to the &amp;lt;code&amp;gt;/dev/sda&amp;lt;/code&amp;gt; device:&lt;br /&gt;
&lt;br /&gt;
 # dd bs=440 count=1 conv=notrunc if=/mnt/usr/share/syslinux/mbr.bin of=/dev/sda&lt;br /&gt;
&lt;br /&gt;
== Unmounting the filesystems ==&lt;br /&gt;
&lt;br /&gt;
* Unmount &amp;lt;code&amp;gt;/mnt/boot/&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
 # umount /mnt/boot/&lt;br /&gt;
&lt;br /&gt;
* Unmount all zfs filesystems:&lt;br /&gt;
&lt;br /&gt;
 # zfs unmount -a&lt;br /&gt;
&lt;br /&gt;
* Export all zfs pools:&lt;br /&gt;
&lt;br /&gt;
 # zpool export -a&lt;br /&gt;
&lt;br /&gt;
* Close the &amp;lt;code&amp;gt;lvmcrypt&amp;lt;/code&amp;gt; device:&lt;br /&gt;
&lt;br /&gt;
 # cryptsetup luksClose crypt&lt;br /&gt;
&lt;br /&gt;
* Reboot the system:&lt;br /&gt;
&lt;br /&gt;
 # reboot&lt;br /&gt;
&lt;br /&gt;
= Troubleshooting =&lt;br /&gt;
&lt;br /&gt;
== General Procedure ==&lt;br /&gt;
&lt;br /&gt;
In case your system fails to boot, you can verify the settings and fix incorrect configurations:&lt;br /&gt;
&lt;br /&gt;
* [[#Preparing_the_Temporary_Installation_Environment|Prepare the temporary installation environment]]&lt;br /&gt;
&lt;br /&gt;
* Load the ZFS kernel module:&lt;br /&gt;
&lt;br /&gt;
 # modprobe zfs&lt;br /&gt;
&lt;br /&gt;
* [[#Mounting_the_File_Systems|Mount the file systems]]&lt;br /&gt;
&lt;br /&gt;
 # zpool import -R /mnt tank&lt;br /&gt;
 # mount -t ext4 /dev/sda1 /mnt/boot&lt;br /&gt;
&lt;br /&gt;
* Verify that you run the steps described in the [[#Installing_Alpine_Linux|Installing Alpine Linux]] section correctly. Update the configuration if necessary.&lt;br /&gt;
&lt;br /&gt;
* [[#Unmounting_the_Volumes_and_Partitions|Unmount the volumes and partitions]]&lt;br /&gt;
&lt;br /&gt;
{{Todo|Multiple Disk ZFS on LUKS?}}&lt;br /&gt;
&lt;br /&gt;
[[Category:Storage]]&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Root_on_ZFS_with_native_encryption&amp;diff=22146</id>
		<title>Root on ZFS with native encryption</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Root_on_ZFS_with_native_encryption&amp;diff=22146"/>
		<updated>2022-07-27T14:24:20Z</updated>

		<summary type="html">&lt;p&gt;La9: update openzfs docs&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a guide for installing Alpine Linux with its root partition on an encrypted ZFS volume, using ZFS&#039;s own encryption capabilities. The system will be encrypted when powered off and will need to be unlocked by typing a passphrase at boot. To be able to boot the system, the `/boot` partition remains unencrypted.&lt;br /&gt;
&lt;br /&gt;
= OpenZFS Guide =&lt;br /&gt;
&lt;br /&gt;
A guide on OpenZFS website supports native encryption, UEFI boot and legacy boot, and multi-disk.  See [https://openzfs.github.io/openzfs-docs/Getting%20Started/Alpine%20Linux/Root%20on%20ZFS/1-preparation.html here].&lt;br /&gt;
&lt;br /&gt;
= Downloading Alpine =&lt;br /&gt;
&lt;br /&gt;
Download the &#039;&#039;&#039;extended&#039;&#039;&#039; release from https://www.alpinelinux.org/downloads/ as only it contains the zfs kernel modules at the time of writing (2022-02-12).&lt;br /&gt;
&lt;br /&gt;
Write it to a USB device and boot from it.&lt;br /&gt;
&lt;br /&gt;
= Initial Setup =&lt;br /&gt;
&lt;br /&gt;
Run the following to start the installation procedure:&lt;br /&gt;
&lt;br /&gt;
    setup-alpine&lt;br /&gt;
&lt;br /&gt;
Answer all the questions, and hit ctrl-c when promted for which disk you&#039;d like to use.&lt;br /&gt;
&lt;br /&gt;
== Optional: SSH access ==&lt;br /&gt;
&lt;br /&gt;
This section is optional and it assumes internet connectivity. You may enable sshd so you can ssh into the box and copy and paste the rest of the commands from these instructions into a terminal window.&lt;br /&gt;
&lt;br /&gt;
Edit `/etc/ssh/sshd_config` and search for `Permit`. Change the value after `PermitRootLogin` to read `yes`&lt;br /&gt;
&lt;br /&gt;
save and exit to shell. Run `service sshd restart`&lt;br /&gt;
&lt;br /&gt;
Now you can ssh in as root. Do not forget to go back and comment this line out when you&#039;re done since it will be enabled on the resulting machine. You will be reminded again at the end of this doc.&lt;br /&gt;
&lt;br /&gt;
= Add required packages  =&lt;br /&gt;
&lt;br /&gt;
    apk add zfs sfdisk e2fsprogs syslinux&lt;br /&gt;
&lt;br /&gt;
= Partition setup =&lt;br /&gt;
&lt;br /&gt;
We&#039;re assuming that `/dev/sda` is the target storage device here and in the rest of the document, but the name of the storage device you wish to install to may be different. To see a list of storage devices and determine the correct one, type `sfdisk -l`.&lt;br /&gt;
&lt;br /&gt;
    echo -e &amp;quot;/dev/sda1: start=1M,size=100M,bootable\n/dev/sda2: start=101M&amp;quot; | sfdisk --quiet --label dos /dev/sda&lt;br /&gt;
&lt;br /&gt;
== Create device nodes ==&lt;br /&gt;
&lt;br /&gt;
    mdev -s&lt;br /&gt;
&lt;br /&gt;
== Create the /boot filesystem ==&lt;br /&gt;
&lt;br /&gt;
    mkfs.ext4 /dev/sda1&lt;br /&gt;
&lt;br /&gt;
= ZFS setup =&lt;br /&gt;
== Create the root zpool ==&lt;br /&gt;
&lt;br /&gt;
    modprobe zfs&lt;br /&gt;
    zpool create -f -o ashift=12 \&lt;br /&gt;
        -O acltype=posixacl -O canmount=off -O compression=lz4 \&lt;br /&gt;
        -O dnodesize=auto -O normalization=formD -O relatime=on -O xattr=sa \&lt;br /&gt;
        -O encryption=aes-256-gcm -O keylocation=prompt -O keyformat=passphrase \&lt;br /&gt;
        -O mountpoint=/ -R /mnt \&lt;br /&gt;
        rpool /dev/sda2&lt;br /&gt;
&lt;br /&gt;
You will have to enter your passphrase at this point. Choose wisely, as your passphrase is most likely [https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions#5-security-aspects the weakest link in this setup].&lt;br /&gt;
&lt;br /&gt;
A few notes on the options supplied to zpool:&lt;br /&gt;
&lt;br /&gt;
- `ashift=12` is recommended here because many drives today have 4KiB (or larger) physical sectors, even though they present 512B logical sectors&lt;br /&gt;
&lt;br /&gt;
- `acltype=posixacl` enables POSIX ACLs globally&lt;br /&gt;
&lt;br /&gt;
- `normalization=formD` eliminates some corner cases relating to UTF-8 filename normalization. It also enables `utf8only=on`, meaning that only files with valid UTF-8 filenames will be accepted.&lt;br /&gt;
&lt;br /&gt;
- `xattr=sa` vastly improves the performance of extended attributes, but is Linux-only. If you care about using this pool on other OpenZFS implementation don&#039;t specify this option.&lt;br /&gt;
&lt;br /&gt;
After completing this, confirm that the pool has been created:&lt;br /&gt;
&lt;br /&gt;
    # zpool status&lt;br /&gt;
&lt;br /&gt;
Should return something like:&lt;br /&gt;
&lt;br /&gt;
      pool: rpool&lt;br /&gt;
     state: ONLINE&lt;br /&gt;
      scan: none requested&lt;br /&gt;
    config:&lt;br /&gt;
&lt;br /&gt;
        NAME        STATE     READ WRITE CKSUM&lt;br /&gt;
        rpool       ONLINE       0     0     0&lt;br /&gt;
          sda2      ONLINE       0     0     0&lt;br /&gt;
&lt;br /&gt;
    errors: No known data errors&lt;br /&gt;
&lt;br /&gt;
== Create the required datasets and mount root ==&lt;br /&gt;
&lt;br /&gt;
    zfs create -o mountpoint=none -o canmount=off rpool/ROOT&lt;br /&gt;
    zfs create -o mountpoint=legacy rpool/ROOT/alpine&lt;br /&gt;
    mount -t zfs rpool/ROOT/alpine /mnt/&lt;br /&gt;
&lt;br /&gt;
== Mount the `/boot` filesystem ==&lt;br /&gt;
&lt;br /&gt;
    mkdir /mnt/boot/&lt;br /&gt;
    mount -t ext4 /dev/sda1 /mnt/boot/&lt;br /&gt;
&lt;br /&gt;
== Enable ZFS&#039; services ==&lt;br /&gt;
&lt;br /&gt;
    rc-update add zfs-import sysinit&lt;br /&gt;
    rc-update add zfs-mount sysinit&lt;br /&gt;
&lt;br /&gt;
= Install Alpine Linux =&lt;br /&gt;
&lt;br /&gt;
    setup-disk /mnt&lt;br /&gt;
    dd if=/usr/share/syslinux/mbr.bin of=/dev/sda # write mbr so we can boot&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Reboot and enjoy! =&lt;br /&gt;
&lt;br /&gt;
😉&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;NOTE:&#039;&#039;&#039;&lt;br /&gt;
If you went with the optional step, be sure to disable root login after you reboot.&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=User:R3/Root_on_ZFS_with_Native_Encryption&amp;diff=22145</id>
		<title>User:R3/Root on ZFS with Native Encryption</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=User:R3/Root_on_ZFS_with_Native_Encryption&amp;diff=22145"/>
		<updated>2022-07-27T14:19:16Z</updated>

		<summary type="html">&lt;p&gt;La9: update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Official OpenZFS Documentation ==&lt;br /&gt;
&lt;br /&gt;
A guide is available for Root on ZFS installation on OpenZFS website:&lt;br /&gt;
&lt;br /&gt;
https://openzfs.github.io/openzfs-docs/Getting%20Started/Alpine%20Linux/Root%20on%20ZFS/1-preparation.html&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=PipeWire&amp;diff=22139</id>
		<title>PipeWire</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=PipeWire&amp;diff=22139"/>
		<updated>2022-07-27T06:20:16Z</updated>

		<summary type="html">&lt;p&gt;La9: /* Installation and configuration */ rm refs to pipewire-media-session&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft|The instructions below have not been thoroughly tested and may break things.}}&lt;br /&gt;
&lt;br /&gt;
[https://pipewire.org/ PipeWire] is a multimedia processing engine that aims to improve audio and video handling on Linux.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Audio Group ===&lt;br /&gt;
&lt;br /&gt;
When elogind is not available, the user has to be added to the &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; group. The user must re-log-in in for this to take effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# addgroup &amp;lt;user&amp;gt; audio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D-Bus ===&lt;br /&gt;
&lt;br /&gt;
PipeWire requires a running [https://www.freedesktop.org/wiki/Software/dbus/ D-Bus] session. If you use a full desktop environment this will probably be started automatically, but with minimal window managers it must be done manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add dbus dbus-openrc&lt;br /&gt;
# rc-service dbus start&lt;br /&gt;
# rc-update add dbus default&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;code&amp;gt;dbus-run-session&amp;lt;/code&amp;gt; whenever you start an X or Wayland session. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ dbus-run-session -- sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XDG_RUNTIME_DIR ===&lt;br /&gt;
&lt;br /&gt;
If you are not using a Desktop Manager, ensure that your &amp;lt;code&amp;gt;XDG_RUNTIME_DIR&amp;lt;/code&amp;gt; is set to a user-writable location. By default for pulseaudio this is {{Path|/run/user/1000/}} or {{Path|/tmp}}. If this is not set, pipewire will create a directory in your home folder instead, called &amp;lt;code&amp;gt;~/pulse&amp;lt;/code&amp;gt;, and on attempting to run Pavucontrol or pactl, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pactl list&lt;br /&gt;
Connection failure: Connection refused&lt;br /&gt;
pa_context_connect() failed: Connection refused&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation and configuration ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire wireplumber&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Using [https://gitlab.freedesktop.org/pipewire/wireplumber WirePlumber] rather than the pipewire-media-session (which comes with pipewire) is [https://gitlab.freedesktop.org/pipewire/media-session/-/blob/master/README.md recommended] but not required.}}&lt;br /&gt;
&lt;br /&gt;
=== Realtime scheduling ===&lt;br /&gt;
&lt;br /&gt;
For realtime scheduling, it is recommended to use rtkit,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add rtkit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and then add your user to the `rtkit` group.&lt;br /&gt;
&lt;br /&gt;
Alternatively, ensure your user has the right ulimit permissions. You generally need (limits.conf format):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@audio - memlock 256&lt;br /&gt;
@audio - nice -11&lt;br /&gt;
@audio - rtprio 88&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows a member of the audio group to have the right permissions for PipeWire to use realtime scheduling without rtkit.&lt;br /&gt;
&lt;br /&gt;
=== ALSA ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire-alsa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ALSA support works out of the box if you have the pipewire-alsa package. You may need the &amp;lt;code&amp;gt;snd_seq&amp;lt;/code&amp;gt; kernel module.&lt;br /&gt;
&lt;br /&gt;
=== PulseAudio ===&lt;br /&gt;
&lt;br /&gt;
PipeWire can run a [https://www.freedesktop.org/wiki/Software/PulseAudio/ PulseAudio] daemon which should allow all existing PulseAudio applications to be used with the PipeWire backend. You need to have &amp;lt;code&amp;gt;pipewire-pulse&amp;lt;/code&amp;gt; installed.&lt;br /&gt;
&lt;br /&gt;
=== JACK ===&lt;br /&gt;
&lt;br /&gt;
If you will be using PipeWire for [https://jackaudio.org/ JACK] applications install the required package (pipewire-jack). Things should work with just that.&lt;br /&gt;
&lt;br /&gt;
=== Video ===&lt;br /&gt;
&lt;br /&gt;
Video should work out-of-the-box with v4l2 devices (e.g. a lot of webcams) and [https://gstreamer.freedesktop.org/ GStreamer] applications.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth audio ===&lt;br /&gt;
&lt;br /&gt;
* Enable PulseAudio support as described above&lt;br /&gt;
* Install bluetooth service packages: &amp;lt;code&amp;gt;bluez bluez-openrc pipewire-spa-bluez&amp;lt;/code&amp;gt;&lt;br /&gt;
* Optional: install GUI manager for bluetooth &amp;lt;code&amp;gt;blueman&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable and start bluetooth service: &amp;lt;code&amp;gt;rc-update add bluetooth; rc-service bluetooth start&amp;lt;/code&amp;gt;&lt;br /&gt;
* Restart PipeWire&lt;br /&gt;
* Use commandline program  &amp;lt;code&amp;gt;bluetoothctl&amp;lt;/code&amp;gt; or GUI program &amp;lt;code&amp;gt;blueman-manager&amp;lt;/code&amp;gt; to scan and pair bluetooth audio devices.&lt;br /&gt;
* Use pavucontrol to adjust volume and manually select high definition bluetooth codecs.&lt;br /&gt;
&lt;br /&gt;
== Screen sharing on Wayland ==&lt;br /&gt;
&lt;br /&gt;
You will need the right [https://github.com/flatpak/xdg-desktop-portal xdg-desktop-portal] backend for your desktop environment. Screen sharing is known to work on:&lt;br /&gt;
* GNOME with &amp;lt;code&amp;gt;xdg-desktop-portal-gtk&amp;lt;/code&amp;gt;&lt;br /&gt;
* KDE Plasma with &amp;lt;code&amp;gt;xdg-desktop-portal-kde&amp;lt;/code&amp;gt; and Firefox&lt;br /&gt;
* Sway with &amp;lt;code&amp;gt;xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; and Firefox, see [[Sway]] for details&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Start the PipeWire media server. You&#039;ll probably get quite a few errors but just ignore them for now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ /usr/libexec/pipewire-launcher&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note| PipeWire doesn&#039;t auto-start a session manager anymore. &lt;br /&gt;
In 3.14 and earlier, the PipeWire default config was edited in packaging to auto-start pipewire-media-session as the default session manager. Since we now have wireplumber available as an alternative session manager, this has been changed in favor of a launch wrapper for pipewire at /usr/libexec/pipewire-launcher. When executed, this will launch pipewire, pipewire-media-session or wireplumber, and pipewire-pulse, depending on what modules are available. If you were launching /usr/bin/pipewire and the session manager manually before, please use the new launcher wrapper instead. WirePlumber can now also be used as a proper alternative for pipewire-media-session.}}&lt;br /&gt;
&lt;br /&gt;
In a different terminal window check the default output device. I don&#039;t yet know how this default can be changed for all applications, so you&#039;d better hope it&#039;s right!&lt;br /&gt;
&lt;br /&gt;
wireplumber:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ wpctl status&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test sound is working using an audio file in a format supported by [http://www.mega-nerd.com/libsndfile/ libsndfile] (e.g. flac, opus, ogg, wav).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire-tools&lt;br /&gt;
$ pw-cat -p test.flac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have a microphone test audio recording is working.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pw-cat -r --list-targets&lt;br /&gt;
$ pw-cat -r recording.flac&lt;br /&gt;
(Speak for a while then stop it with Ctrl+c)&lt;br /&gt;
$ pw-cat -p recording.flac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test PulseAudio clients using a media player (most use PulseAudio) and if you use JACK test that too:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add jack-example-clients&lt;br /&gt;
$ jack_simple_client&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should hear a sustained beep.&lt;br /&gt;
&lt;br /&gt;
If you are happy everything is working, make PipeWire start automatically when your X or Wayland session starts. For example, you could add the &amp;lt;code&amp;gt;/usr/libexec/pipewire-launcher&amp;lt;/code&amp;gt; command to &amp;lt;code&amp;gt;~/.xinitrc&amp;lt;/code&amp;gt; or your window manager&#039;s config file.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== `wpctl status` shows no targets ===&lt;br /&gt;
&lt;br /&gt;
First, check whether ALSA knows about your sound card:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aplay -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If sound devices are found, the issue is with your pipewire configuration.  Consider double-checking the instructions above.&lt;br /&gt;
&lt;br /&gt;
Otherwise, your sound card may not be supported in the version of the Linux Kernel you&#039;re running.  You should search online for fixes relating to your current kernel version and the codec of your sound card.  You can find each of these with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uname -r&lt;br /&gt;
cat /proc/asound/card0/codec* | grep Codec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Quick Configuration ==&lt;br /&gt;
&lt;br /&gt;
You might want to use pavucontrol to have a simple GUI app for controlling sound, outputs, etc, in which case:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pavucontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [https://gitlab.freedesktop.org/pipewire/pipewire PipeWire source repository]&lt;br /&gt;
* [https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home PipeWire Wiki]&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/PipeWire PipeWire on the ArchWiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Pipewire PipeWire on the Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Multimedia]]&lt;br /&gt;
[[Category:Sound]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Talk:Sway&amp;diff=22138</id>
		<title>Talk:Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Talk:Sway&amp;diff=22138"/>
		<updated>2022-07-27T06:12:07Z</updated>

		<summary type="html">&lt;p&gt;La9: re&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setting up eudev ==&lt;br /&gt;
Hi, first-time user here. While following this page&#039;s instructions I found that setup-udev command doesn&#039;t exist, and couldn&#039;t find anything about which package provides it. My guess is it&#039;s old and the page is just out of date. However, my own quest to get sway working took me through so much confusion that I&#039;m not sure which steps were actually necessary for me, so I don&#039;t know for certain what to replace it with. I suspect what setup-udev did was start all of the udev services (udev, udev-postmount, udev-settle, and udev-trigger).&lt;br /&gt;
&lt;br /&gt;
Hello.  The package &#039;&#039;&#039;eudev&#039;&#039;&#039;, which should be installed by the very first command in the page, provides /sbin/setup-udev. [[User:La9|La9]] ([[User talk:La9|talk]]) 06:09, 27 July 2022 (UTC)&lt;br /&gt;
&lt;br /&gt;
: Alternatively you can try &#039;&#039;&#039;setup-devd udev&#039;&#039;&#039;, this will auto install packages for you. [[User:La9|La9]] ([[User talk:La9|talk]]) 06:12, 27 July 2022 (UTC)&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Talk:Sway&amp;diff=22137</id>
		<title>Talk:Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Talk:Sway&amp;diff=22137"/>
		<updated>2022-07-27T06:09:49Z</updated>

		<summary type="html">&lt;p&gt;La9: re&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Setting up eudev ==&lt;br /&gt;
Hi, first-time user here. While following this page&#039;s instructions I found that setup-udev command doesn&#039;t exist, and couldn&#039;t find anything about which package provides it. My guess is it&#039;s old and the page is just out of date. However, my own quest to get sway working took me through so much confusion that I&#039;m not sure which steps were actually necessary for me, so I don&#039;t know for certain what to replace it with. I suspect what setup-udev did was start all of the udev services (udev, udev-postmount, udev-settle, and udev-trigger).&lt;br /&gt;
&lt;br /&gt;
Hello.  The package &#039;&#039;&#039;eudev&#039;&#039;&#039;, which should be installed by the very first command in the page, provides /sbin/setup-udev. [[User:La9|La9]] ([[User talk:La9|talk]]) 06:09, 27 July 2022 (UTC)&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Elogind&amp;diff=22126</id>
		<title>Elogind</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Elogind&amp;diff=22126"/>
		<updated>2022-07-24T11:06:49Z</updated>

		<summary type="html">&lt;p&gt;La9: configure display manager&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;elogind&#039;&#039;&#039; is a login manager and provides support for &lt;br /&gt;
&lt;br /&gt;
* setting up necessary permissions for the desktop environment or window manager&lt;br /&gt;
* handling poweroff, reboot, suspend and hibernate via &#039;&#039;&#039;loginctl&#039;&#039;&#039; command&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add elogind polkit-elogind&lt;br /&gt;
# rc-update add elogind&lt;br /&gt;
# rc-service elogind start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== logind.conf ===&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/elogind/logind.conf&amp;lt;/code&amp;gt; to configure handling of power events, such as suspending the computer when power button is pressed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sed -i &#039;s|#HandlePowerKey=poweroff|HandlePowerKey=suspend|&#039; /etc/elogind/logind.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Working with Desktop Environments ===&lt;br /&gt;
&lt;br /&gt;
If using a Window Manager or Desktop Environment, such as [[Sway]], the user must ensure that login session is correctly configured.  When correctly configured, loginctl command should output the following:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# using sway and sddm&lt;br /&gt;
localhost:~$ loginctl&lt;br /&gt;
SESSION  UID USER SEAT  TTY &lt;br /&gt;
     c1  105 sddm seat0     &lt;br /&gt;
     c2 1000 User seat0 tty8&lt;br /&gt;
&lt;br /&gt;
2 sessions listed.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the output is &amp;lt;code&amp;gt;No session available.&amp;lt;/code&amp;gt;, such as in the case of launching Sway from tty, suspend and many other functionality will not work.  The user then must configure a display manager such as greetd, sddm or lightdm.&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22123</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22123"/>
		<updated>2022-07-23T15:45:47Z</updated>

		<summary type="html">&lt;p&gt;La9: dbus&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
* [[Nvidia Video]]&lt;br /&gt;
Add user to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seatd daemon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[elogind]], optional for suspend on lid close support.&lt;br /&gt;
&lt;br /&gt;
Install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    bemenu               \ # wayland menu&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure XDG_RUNTIME_DIR.  Add the following to shell init scripts, for the default ash shell it is ~/.profile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if test -z &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir&lt;br /&gt;
  if ! test -d &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
    mkdir &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
    chmod 0700 &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For inter-program communication and functionality such as screensharing, install and enable dbus and PipeWire, see [[PipeWire]].&lt;br /&gt;
&lt;br /&gt;
Re-login or reboot to allow above modifications to take effect.&lt;br /&gt;
&lt;br /&gt;
Launch Sway with dbus support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
=== Firefox screensharing ===&lt;br /&gt;
&lt;br /&gt;
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.&lt;br /&gt;
&lt;br /&gt;
To launch Firefox natively under Wayland and to enable support for screensharing, you need:&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[PipeWire]]&lt;br /&gt;
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package&lt;br /&gt;
* Install wofi for screen selection&lt;br /&gt;
* Launch support programs on sway startup:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec pipewire #pipewire must be launched first&lt;br /&gt;
exec /usr/libexec/xdg-desktop-portal-wlr&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
* Export the following variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MOZ_ENABLE_WAYLAND=&amp;quot;1&amp;quot;&lt;br /&gt;
export XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
export XDG_SESSION_TYPE=wayland&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scaling for high resolution screens ===&lt;br /&gt;
&lt;br /&gt;
Without further configuration, program interfaces might be too small to use on high resolution screens.&lt;br /&gt;
&lt;br /&gt;
==== Via sway ====&lt;br /&gt;
&lt;br /&gt;
Sway supports the per-display configuration of&lt;br /&gt;
&lt;br /&gt;
* fractional (e.g., 1.5x), and&lt;br /&gt;
* integer scaling (e.g., 2x) &lt;br /&gt;
&lt;br /&gt;
However, fractional scaling is discouraged due to both the performance impact and the blurry output it produces. In this case, where 1x scaling is too small and 2x scaling is too large, program-specific GTK/QT based scaling is recommended.  See below.&lt;br /&gt;
&lt;br /&gt;
To enable Sway scaling, the user can first preview different scaling factors with &amp;lt;code&amp;gt;wdisplays&amp;lt;/code&amp;gt; package.  Note the output name (eDP-1, LVDS-1) and try apply scaling factors such as 1 and 2.  To make changes permanent, add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output &amp;lt;name&amp;gt; scale &amp;lt;factor&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to ~/.config/sway/config.&lt;br /&gt;
&lt;br /&gt;
==== Via GTK/Qt ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE=2&lt;br /&gt;
&lt;br /&gt;
# for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=&amp;quot;physical&amp;quot;&lt;br /&gt;
# or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make clipboard content persistent ===&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from test repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22120</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22120"/>
		<updated>2022-07-22T06:31:01Z</updated>

		<summary type="html">&lt;p&gt;La9: preview&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
* [[Nvidia Video]]&lt;br /&gt;
Add user to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seatd daemon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[elogind]], optional for suspend on lid close support.&lt;br /&gt;
&lt;br /&gt;
Install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    bemenu               \ # wayland menu&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure XDG_RUNTIME_DIR.  Add the following to shell init scripts, for the default ash shell it is ~/.profile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if test -z &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir&lt;br /&gt;
  if ! test -d &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
    mkdir &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
    chmod 0700 &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-login or reboot to allow above modifications to take effect.&lt;br /&gt;
&lt;br /&gt;
Launch Sway with dbus support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
=== Launching program under Wayland ===&lt;br /&gt;
&lt;br /&gt;
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.&lt;br /&gt;
&lt;br /&gt;
To launch Firefox natively under Wayland and to enable support for screensharing, you need:&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[PipeWire]]&lt;br /&gt;
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package&lt;br /&gt;
* Install wofi for screen selection&lt;br /&gt;
* Launch support programs on sway startup: Add &amp;lt;code&amp;gt;exec pipewire&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/libexec/xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; to ~/.config/sway/config&lt;br /&gt;
* Export the following variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MOZ_ENABLE_WAYLAND=&amp;quot;1&amp;quot;&lt;br /&gt;
export XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
export XDG_SESSION_TYPE=wayland&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scaling for high resolution screens ===&lt;br /&gt;
&lt;br /&gt;
Without further configuration, program interfaces might be too small to use on high resolution screens.&lt;br /&gt;
&lt;br /&gt;
==== Via sway ====&lt;br /&gt;
&lt;br /&gt;
Sway supports the per-display configuration of&lt;br /&gt;
&lt;br /&gt;
* fractional (e.g., 1.5x), and&lt;br /&gt;
* integer scaling (e.g., 2x) &lt;br /&gt;
&lt;br /&gt;
However, fractional scaling is discouraged due to both the performance impact and the blurry output it produces. In this case, where 1x scaling is too small and 2x scaling is too large, program-specific GTK/QT based scaling is recommended.  See below.&lt;br /&gt;
&lt;br /&gt;
To enable Sway scaling, the user can first preview different scaling factors with &amp;lt;code&amp;gt;wdisplays&amp;lt;/code&amp;gt; package.  Note the output name (eDP-1, LVDS-1) and try apply scaling factors such as 1 and 2.  To make changes permanent, add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output &amp;lt;name&amp;gt; scale &amp;lt;factor&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to ~/.config/sway/config.&lt;br /&gt;
&lt;br /&gt;
==== Via GTK/Qt ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE=2&lt;br /&gt;
&lt;br /&gt;
# for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=&amp;quot;physical&amp;quot;&lt;br /&gt;
# or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make clipboard content persistent ===&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from test repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22119</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22119"/>
		<updated>2022-07-22T06:28:37Z</updated>

		<summary type="html">&lt;p&gt;La9: relogin to take effect&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
* [[Nvidia Video]]&lt;br /&gt;
Add user to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seatd daemon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[elogind]], optional for suspend on lid close support.&lt;br /&gt;
&lt;br /&gt;
Install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    bemenu               \ # wayland menu&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure XDG_RUNTIME_DIR.  Add the following to shell init scripts, for the default ash shell it is ~/.profile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if test -z &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir&lt;br /&gt;
  if ! test -d &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
    mkdir &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
    chmod 0700 &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Re-login or reboot to allow above modifications to take effect.&lt;br /&gt;
&lt;br /&gt;
Launch Sway with dbus support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
=== Launching program under Wayland ===&lt;br /&gt;
&lt;br /&gt;
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.&lt;br /&gt;
&lt;br /&gt;
To launch Firefox natively under Wayland and to enable support for screensharing, you need:&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[PipeWire]]&lt;br /&gt;
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package&lt;br /&gt;
* Install wofi for screen selection&lt;br /&gt;
* Launch support programs on sway startup: Add &amp;lt;code&amp;gt;exec pipewire&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/libexec/xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; to ~/.config/sway/config&lt;br /&gt;
* Export the following variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MOZ_ENABLE_WAYLAND=&amp;quot;1&amp;quot;&lt;br /&gt;
export XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
export XDG_SESSION_TYPE=wayland&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scaling for high resolution screens ===&lt;br /&gt;
&lt;br /&gt;
Without further configuration, program interfaces might be too small to use on high resolution screens.&lt;br /&gt;
&lt;br /&gt;
==== Via sway ====&lt;br /&gt;
&lt;br /&gt;
Sway supports the per-display configuration of&lt;br /&gt;
&lt;br /&gt;
* fractional (e.g., 1.5x), and&lt;br /&gt;
* integer scaling (e.g., 2x) &lt;br /&gt;
&lt;br /&gt;
However, fractional scaling is discouraged due to both the performance impact and the blurry output it produces. In this case, where 1x scaling is too small and 2x scaling is too large, program-specific GTK/QT based scaling is recommended.  See below.&lt;br /&gt;
&lt;br /&gt;
To enable Sway scaling, the user can first try out different scaling factors with &amp;lt;code&amp;gt;wdisplays&amp;lt;/code&amp;gt; package.  Note the output name (eDP-1, LVDS-1) and try apply scaling factors such as 1 and 2.  To make changes permanent, add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output &amp;lt;name&amp;gt; scale &amp;lt;factor&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to ~/.config/sway/config.&lt;br /&gt;
&lt;br /&gt;
==== Via GTK/Qt ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE=2&lt;br /&gt;
&lt;br /&gt;
# for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=&amp;quot;physical&amp;quot;&lt;br /&gt;
# or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make clipboard content persistent ===&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from test repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22118</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22118"/>
		<updated>2022-07-22T05:36:47Z</updated>

		<summary type="html">&lt;p&gt;La9: qt qpa platform&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
* [[Nvidia Video]]&lt;br /&gt;
Add user to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seatd daemon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[elogind]], optional for suspend on lid close support.&lt;br /&gt;
&lt;br /&gt;
Install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    wofi                 \ # wayland menu for application selection and screensharing&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure XDG_RUNTIME_DIR.  Add the following to shell init scripts, for the default ash shell it is ~/.profile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if test -z &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir&lt;br /&gt;
  if ! test -d &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
    mkdir &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
    chmod 0700 &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch Sway with dbus support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
=== Launching program under Wayland ===&lt;br /&gt;
&lt;br /&gt;
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.&lt;br /&gt;
&lt;br /&gt;
To launch Firefox natively under Wayland and to enable support for screensharing, you need:&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[PipeWire]]&lt;br /&gt;
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package&lt;br /&gt;
* Install wofi for screen selection&lt;br /&gt;
* Launch support programs on sway startup: Add &amp;lt;code&amp;gt;exec pipewire&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/libexec/xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; to ~/.config/sway/config&lt;br /&gt;
* Export the following variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MOZ_ENABLE_WAYLAND=&amp;quot;1&amp;quot;&lt;br /&gt;
export XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
export XDG_SESSION_TYPE=wayland&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scaling for high resolution screens ===&lt;br /&gt;
&lt;br /&gt;
Without further configuration, program interfaces might be too small to use on high resolution screens.&lt;br /&gt;
&lt;br /&gt;
==== Via sway ====&lt;br /&gt;
&lt;br /&gt;
Sway supports the per-display configuration of&lt;br /&gt;
&lt;br /&gt;
* fractional (e.g., 1.5x), and&lt;br /&gt;
* integer scaling (e.g., 2x) &lt;br /&gt;
&lt;br /&gt;
However, fractional scaling is discouraged due to both the performance impact and the blurry output it produces. In this case, where 1x scaling is too small and 2x scaling is too large, program-specific GTK/QT based scaling is recommended.  See below.&lt;br /&gt;
&lt;br /&gt;
To enable Sway scaling, the user can first try out different scaling factors with &amp;lt;code&amp;gt;wdisplays&amp;lt;/code&amp;gt; package.  Note the output name (eDP-1, LVDS-1) and try apply scaling factors such as 1 and 2.  To make changes permanent, add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output &amp;lt;name&amp;gt; scale &amp;lt;factor&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to ~/.config/sway/config.&lt;br /&gt;
&lt;br /&gt;
==== Via GTK/Qt ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE=2&lt;br /&gt;
&lt;br /&gt;
# for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=&amp;quot;physical&amp;quot;&lt;br /&gt;
# or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make clipboard content persistent ===&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from test repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22117</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22117"/>
		<updated>2022-07-22T05:35:04Z</updated>

		<summary type="html">&lt;p&gt;La9: remove spurious whitespace&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
* [[Nvidia Video]]&lt;br /&gt;
Add user to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seatd daemon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[elogind]], optional for suspend on lid close support.&lt;br /&gt;
&lt;br /&gt;
Install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    wofi                 \ # wayland menu for application selection and screensharing&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure XDG_RUNTIME_DIR.  Add the following to shell init scripts, for the default ash shell it is ~/.profile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if test -z &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir&lt;br /&gt;
  if ! test -d &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
    mkdir &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
    chmod 0700 &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch Sway with dbus support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
=== Launching program under Wayland ===&lt;br /&gt;
&lt;br /&gt;
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.&lt;br /&gt;
&lt;br /&gt;
To launch Firefox natively under Wayland and to enable support for screensharing, you need:&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[PipeWire]]&lt;br /&gt;
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package&lt;br /&gt;
* Install wofi for screen selection&lt;br /&gt;
* Launch support programs on sway startup: Add &amp;lt;code&amp;gt;exec pipewire&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/libexec/xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; to ~/.config/sway/config&lt;br /&gt;
* Export the following variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MOZ_ENABLE_WAYLAND=&amp;quot;1&amp;quot;&lt;br /&gt;
export XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
export XDG_SESSION_TYPE=wayland&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scaling for high resolution screens ===&lt;br /&gt;
&lt;br /&gt;
Without further configuration, program interfaces might be too small to use on high resolution screens.&lt;br /&gt;
&lt;br /&gt;
==== Via sway ====&lt;br /&gt;
&lt;br /&gt;
Sway supports the per-display configuration of&lt;br /&gt;
&lt;br /&gt;
* fractional (e.g., 1.5x), and&lt;br /&gt;
* integer scaling (e.g., 2x) &lt;br /&gt;
&lt;br /&gt;
However, fractional scaling is discouraged due to both the performance impact and the blurry output it produces. In this case, where 1x scaling is too small and 2x scaling is too large, program-specific GTK/QT based scaling is recommended.  See below.&lt;br /&gt;
&lt;br /&gt;
To enable Sway scaling, the user can first try out different scaling factors with &amp;lt;code&amp;gt;wdisplays&amp;lt;/code&amp;gt; package.  Note the output name (eDP-1, LVDS-1) and try apply scaling factors such as 1 and 2.  To make changes permanent, add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output &amp;lt;name&amp;gt; scale &amp;lt;factor&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to ~/.config/sway/config.&lt;br /&gt;
&lt;br /&gt;
==== Via GTK/Qt ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE=2&lt;br /&gt;
&lt;br /&gt;
# for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=&amp;quot;physical&amp;quot;&lt;br /&gt;
# or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make clipboard content persistent ===&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from test repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=NVIDIA&amp;diff=22116</id>
		<title>NVIDIA</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=NVIDIA&amp;diff=22116"/>
		<updated>2022-07-22T05:24:46Z</updated>

		<summary type="html">&lt;p&gt;La9: nouveau&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Nouveau ==&lt;br /&gt;
&#039;&#039;&#039;Nouveau&#039;&#039;&#039; is the open-source driver for NVIDIA GPUs.&lt;br /&gt;
&lt;br /&gt;
=== Wayland ===&lt;br /&gt;
&lt;br /&gt;
Install the following packages as needed:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;mesa-dri-gallium&amp;lt;/code&amp;gt;: &#039;&#039;&#039;necessary&#039;&#039;&#039; Mesa drivers.&lt;br /&gt;
* &amp;lt;code&amp;gt;mesa-va-gallium&amp;lt;/code&amp;gt;: VA-API drivers, for hardware accelerated video encoding and decoding&lt;br /&gt;
&lt;br /&gt;
If driver auto-selection does not work, e.g. no mouse cursor under Sway, manual driver selection might be needed:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;export MESA_LOADER_DRIVER_OVERRIDE=nouveau&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For VA-API:&lt;br /&gt;
* &amp;lt;code&amp;gt;export LIBVA_DRIVER_NAME=nouveau&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Proprietary Driver ==&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22115</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22115"/>
		<updated>2022-07-22T05:21:06Z</updated>

		<summary type="html">&lt;p&gt;La9: Nvidia Video&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
* [[Nvidia Video]]&lt;br /&gt;
Add user to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seatd daemon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[elogind]], optional for suspend on lid close support.&lt;br /&gt;
&lt;br /&gt;
Install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    wofi                 \ # wayland menu for application selection and screensharing&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure XDG_RUNTIME_DIR.  Add the following to shell init scripts, for the default ash shell it is ~/.profile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if test -z &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir&lt;br /&gt;
  if ! test -d &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
    mkdir &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
    chmod 0700 &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch Sway with dbus support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Launching program under Wayland ===&lt;br /&gt;
&lt;br /&gt;
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.&lt;br /&gt;
&lt;br /&gt;
To launch Firefox natively under Wayland and to enable support for screensharing, you need:&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[PipeWire]]&lt;br /&gt;
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package&lt;br /&gt;
* Install wofi for screen selection&lt;br /&gt;
* Launch support programs on sway startup: Add &amp;lt;code&amp;gt;exec pipewire&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/libexec/xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; to ~/.config/sway/config&lt;br /&gt;
* Export the following variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MOZ_ENABLE_WAYLAND=&amp;quot;1&amp;quot;&lt;br /&gt;
export XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
export XDG_SESSION_TYPE=wayland&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scaling for high resolution screens ===&lt;br /&gt;
&lt;br /&gt;
Without further configuration, program interfaces might be too small to use on high resolution screens.&lt;br /&gt;
&lt;br /&gt;
==== Via sway ====&lt;br /&gt;
&lt;br /&gt;
Sway supports the per-display configuration of&lt;br /&gt;
&lt;br /&gt;
* fractional (e.g., 1.5x), and&lt;br /&gt;
* integer scaling (e.g., 2x) &lt;br /&gt;
&lt;br /&gt;
However, fractional scaling is discouraged due to both the performance impact and the blurry output it produces. In this case, where 1x scaling is too small and 2x scaling is too large, program-specific GTK/QT based scaling is recommended.  See below.&lt;br /&gt;
&lt;br /&gt;
To enable Sway scaling, the user can first try out different scaling factors with &amp;lt;code&amp;gt;wdisplays&amp;lt;/code&amp;gt; package.  Note the output name (eDP-1, LVDS-1) and try apply scaling factors such as 1 and 2.  To make changes permanent, add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output &amp;lt;name&amp;gt; scale &amp;lt;factor&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to ~/.config/sway/config.&lt;br /&gt;
&lt;br /&gt;
==== Via GTK/Qt ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE=2&lt;br /&gt;
&lt;br /&gt;
# for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=&amp;quot;physical&amp;quot;&lt;br /&gt;
# or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make clipboard content persistent ===&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from test repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Radeon_Video&amp;diff=22114</id>
		<title>Radeon Video</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Radeon_Video&amp;diff=22114"/>
		<updated>2022-07-22T05:19:52Z</updated>

		<summary type="html">&lt;p&gt;La9: wayland update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Wayland ==&lt;br /&gt;
&lt;br /&gt;
Install the following packages as needed:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;mesa-dri-gallium&amp;lt;/code&amp;gt;: &#039;&#039;&#039;necessary&#039;&#039;&#039; Mesa drivers.&lt;br /&gt;
* &amp;lt;code&amp;gt;mesa-va-gallium&amp;lt;/code&amp;gt;: VA-API drivers, for hardware accelerated video encoding and decoding&lt;br /&gt;
&lt;br /&gt;
If driver auto-selection does not work, e.g. no mouse cursor under Sway, manual driver selection might be needed:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;export MESA_LOADER_DRIVER_OVERRIDE=r300&amp;lt;/code&amp;gt;: for AMD&#039;s Radeon R300, R400, and R500 GPUs.&lt;br /&gt;
* &amp;lt;code&amp;gt;export MESA_LOADER_DRIVER_OVERRIDE=r600&amp;lt;/code&amp;gt;: for AMD&#039;s Radeon R600 GPUs up to Northern Islands. Officially supported by AMD.&lt;br /&gt;
* &amp;lt;code&amp;gt;export MESA_LOADER_DRIVER_OVERRIDE=radeonsi&amp;lt;/code&amp;gt;: for AMD&#039;s Southern Island GPUs and later. Officially supported by AMD.&lt;br /&gt;
&lt;br /&gt;
For VA-API:&lt;br /&gt;
* &amp;lt;code&amp;gt;export LIBVA_DRIVER_NAME=r600&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export LIBVA_DRIVER_NAME=radeonsi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Xorg ==&lt;br /&gt;
&lt;br /&gt;
Install either the Free Software driver &amp;lt;code&amp;gt;xf86-video-ati&amp;lt;/code&amp;gt; or the proprietary amdgpu firmware &amp;lt;code&amp;gt;linux-firmware-amdgpu&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modprobe fbcon&amp;lt;/code&amp;gt; might be needed to avoid black screen when leaving Xorg.&lt;br /&gt;
&lt;br /&gt;
[[Category:Drivers]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Radeon_Video&amp;diff=22113</id>
		<title>Radeon Video</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Radeon_Video&amp;diff=22113"/>
		<updated>2022-07-22T05:18:50Z</updated>

		<summary type="html">&lt;p&gt;La9: wayland update&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{TOC right}}&lt;br /&gt;
&lt;br /&gt;
== Wayland ==&lt;br /&gt;
&lt;br /&gt;
Install the following packages as needed:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;mesa-dri-gallium&amp;lt;/code&amp;gt;: &#039;&#039;&#039;necessary&#039;&#039;&#039; Mesa drivers.&lt;br /&gt;
* &amp;lt;code&amp;gt;mesa-va-gallium&amp;lt;/code&amp;gt;: VA-API drivers, for hardware accelerated video encoding and decoding&lt;br /&gt;
&lt;br /&gt;
If driver auto-selection does not work, e.g. no mouse cursor under Sway, manual driver selection might be needed:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;export MESA_LOADER_DRIVER_OVERRIDE=r300&amp;lt;/code&amp;gt;: for AMD&#039;s Radeon R300, R400, and R500 GPUs.&lt;br /&gt;
* &amp;lt;code&amp;gt;export MESA_LOADER_DRIVER_OVERRIDE=r600&amp;lt;/code&amp;gt;: for AMD&#039;s Radeon R600 GPUs up to Northern Islands. Officially supported by AMD.&lt;br /&gt;
* &amp;lt;code&amp;gt;export MESA_LOADER_DRIVER_OVERRIDE=radeonsi&amp;lt;/code&amp;gt;: for AMD&#039;s Southern Island GPUs and later. Officially supported by AMD.&lt;br /&gt;
&lt;br /&gt;
For VA-API:&lt;br /&gt;
* &amp;lt;code&amp;gt;export LIBVA_DRIVER_NAME=r600&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;export LIBVA_DRIVER_NAME=radeonsi&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Xorg ==&lt;br /&gt;
&lt;br /&gt;
Install either the Free Software driver &amp;lt;code&amp;gt;xf86-video-ati&amp;lt;/code&amp;gt; or the proprietary amdgpu firmware &amp;lt;code&amp;gt;linux-firmware-amdgpu&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;modprobe fbcon&amp;lt;/code&amp;gt; might be needed to avoid black screen when leaving Xorg.&lt;br /&gt;
&lt;br /&gt;
[[Category:Drivers]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22112</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22112"/>
		<updated>2022-07-22T04:55:27Z</updated>

		<summary type="html">&lt;p&gt;La9: hidpi&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
&lt;br /&gt;
Add user to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seatd daemon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[elogind]], optional for suspend on lid close support.&lt;br /&gt;
&lt;br /&gt;
Install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    wofi                 \ # wayland menu for application selection and screensharing&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure XDG_RUNTIME_DIR.  Add the following to shell init scripts, for the default ash shell it is ~/.profile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if test -z &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir&lt;br /&gt;
  if ! test -d &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
    mkdir &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
    chmod 0700 &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch Sway with dbus support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Launching program under Wayland ===&lt;br /&gt;
&lt;br /&gt;
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.&lt;br /&gt;
&lt;br /&gt;
To launch Firefox natively under Wayland and to enable support for screensharing, you need:&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[PipeWire]]&lt;br /&gt;
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package&lt;br /&gt;
* Install wofi for screen selection&lt;br /&gt;
* Launch support programs on sway startup: Add &amp;lt;code&amp;gt;exec pipewire&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/libexec/xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; to ~/.config/sway/config&lt;br /&gt;
* Export the following variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MOZ_ENABLE_WAYLAND=&amp;quot;1&amp;quot;&lt;br /&gt;
export XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
export XDG_SESSION_TYPE=wayland&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Scaling for high resolution screens ===&lt;br /&gt;
&lt;br /&gt;
Without further configuration, program interfaces might be too small to use on high resolution screens.&lt;br /&gt;
&lt;br /&gt;
==== Via sway ====&lt;br /&gt;
&lt;br /&gt;
Sway supports the per-display configuration of&lt;br /&gt;
&lt;br /&gt;
* fractional (e.g., 1.5x), and&lt;br /&gt;
* integer scaling (e.g., 2x) &lt;br /&gt;
&lt;br /&gt;
However, fractional scaling is discouraged due to both the performance impact and the blurry output it produces. In this case, where 1x scaling is too small and 2x scaling is too large, program-specific GTK/QT based scaling is recommended.  See below.&lt;br /&gt;
&lt;br /&gt;
To enable Sway scaling, the user can first try out different scaling factors with &amp;lt;code&amp;gt;wdisplays&amp;lt;/code&amp;gt; package.  Note the output name (eDP-1, LVDS-1) and try apply scaling factors such as 1 and 2.  To make changes permanent, add&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output &amp;lt;name&amp;gt; scale &amp;lt;factor&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
to ~/.config/sway/config.&lt;br /&gt;
&lt;br /&gt;
==== Via GTK/Qt ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE=2&lt;br /&gt;
&lt;br /&gt;
# for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=&amp;quot;physical&amp;quot;&lt;br /&gt;
# or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Make clipboard content persistent ===&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from test repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22111</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22111"/>
		<updated>2022-07-21T17:30:09Z</updated>

		<summary type="html">&lt;p&gt;La9: custom dpi for qt applications&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
&lt;br /&gt;
Add user to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seatd daemon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[elogind]], optional for suspend on lid close support.&lt;br /&gt;
&lt;br /&gt;
Install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    wofi                 \ # wayland menu for application selection and screensharing&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure XDG_RUNTIME_DIR.  Add the following to shell init scripts, for the default ash shell it is ~/.profile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if test -z &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir&lt;br /&gt;
  if ! test -d &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
    mkdir &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
    chmod 0700 &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch Sway with dbus support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Launching program under Wayland ==&lt;br /&gt;
&lt;br /&gt;
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.&lt;br /&gt;
&lt;br /&gt;
To launch Firefox natively under Wayland and to enable support for screensharing, you need:&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[PipeWire]]&lt;br /&gt;
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package&lt;br /&gt;
* Install wofi for screen selection&lt;br /&gt;
* Launch support programs on sway startup: Add &amp;lt;code&amp;gt;exec pipewire&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/libexec/xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; to ~/.config/sway/config&lt;br /&gt;
* Export the following variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MOZ_ENABLE_WAYLAND=&amp;quot;1&amp;quot;&lt;br /&gt;
export XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
export XDG_SESSION_TYPE=wayland&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HiDPI ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE=2&lt;br /&gt;
&lt;br /&gt;
# for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=&amp;quot;physical&amp;quot;&lt;br /&gt;
# or if still too small, use a custom DPI&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=192 # 2x scaling&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
== Make clipboard content persistent ==&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from test repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Bluetooth_audio&amp;diff=22110</id>
		<title>Bluetooth audio</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Bluetooth_audio&amp;diff=22110"/>
		<updated>2022-07-21T16:13:15Z</updated>

		<summary type="html">&lt;p&gt;La9: redirect to pipewire&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== PulseAudio ==&lt;br /&gt;
&lt;br /&gt;
Before you can connect your device to Bluetooth speakers or headphones, you&#039;ll have to make sure {{Pkg|pulseaudio-bluez}} is installed.&lt;br /&gt;
&lt;br /&gt;
== PipeWire ==&lt;br /&gt;
&lt;br /&gt;
See [[PipeWire]] page.&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22109</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22109"/>
		<updated>2022-07-21T16:12:00Z</updated>

		<summary type="html">&lt;p&gt;La9: fix formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
&lt;br /&gt;
Add user to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seatd daemon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[elogind]], optional for suspend on lid close support.&lt;br /&gt;
&lt;br /&gt;
Install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    wofi                 \ # wayland menu for application selection and screensharing&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure XDG_RUNTIME_DIR.  Add the following to shell init scripts, for the default ash shell it is ~/.profile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if test -z &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir&lt;br /&gt;
  if ! test -d &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
    mkdir &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
    chmod 0700 &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch Sway with dbus support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Launching program under Wayland ==&lt;br /&gt;
&lt;br /&gt;
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.&lt;br /&gt;
&lt;br /&gt;
To launch Firefox natively under Wayland and to enable support for screensharing, you need:&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[PipeWire]]&lt;br /&gt;
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package&lt;br /&gt;
* Install wofi for screen selection&lt;br /&gt;
* Launch support programs on sway startup: Add &amp;lt;code&amp;gt;exec pipewire&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/libexec/xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; to ~/.config/sway/config&lt;br /&gt;
* Export the following variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MOZ_ENABLE_WAYLAND=&amp;quot;1&amp;quot;&lt;br /&gt;
export XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
export XDG_SESSION_TYPE=wayland&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HiDPI ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE=2&lt;br /&gt;
&lt;br /&gt;
# for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=&amp;quot;physical&amp;quot;&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
== Make clipboard content persistent ==&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from test repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22108</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22108"/>
		<updated>2022-07-21T16:11:35Z</updated>

		<summary type="html">&lt;p&gt;La9: persistent clipboard&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
&lt;br /&gt;
Add user to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seatd daemon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[elogind]], optional for suspend on lid close support.&lt;br /&gt;
&lt;br /&gt;
Install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    wofi                 \ # wayland menu for application selection and screensharing&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure XDG_RUNTIME_DIR.  Add the following to shell init scripts, for the default ash shell it is ~/.profile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if test -z &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir&lt;br /&gt;
  if ! test -d &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
    mkdir &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
    chmod 0700 &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch Sway with dbus support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Launching program under Wayland ==&lt;br /&gt;
&lt;br /&gt;
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.&lt;br /&gt;
&lt;br /&gt;
To launch Firefox natively under Wayland and to enable support for screensharing, you need:&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[PipeWire]]&lt;br /&gt;
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package&lt;br /&gt;
* Install wofi for screen selection&lt;br /&gt;
* Launch support programs on sway startup: Add &amp;lt;code&amp;gt;exec pipewire&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/libexec/xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; to ~/.config/sway/config&lt;br /&gt;
* Export the following variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MOZ_ENABLE_WAYLAND=&amp;quot;1&amp;quot;&lt;br /&gt;
export XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
export XDG_SESSION_TYPE=wayland&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HiDPI ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE=2&lt;br /&gt;
&lt;br /&gt;
# for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=&amp;quot;physical&amp;quot;&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
== Make clipboard content persistent ==&lt;br /&gt;
By default the clipboard content does not persist after terminating the program: you copy some text from Firefox and then exit Firefox, the copied text is also lost.&lt;br /&gt;
&lt;br /&gt;
Install clipman from test repo and add the following to sway config:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
exec wl-paste --type text/plain --watch clipman store --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
bindsym $mod+h exec clipman pick --tool wofi --histpath=&amp;quot;~/.local/state/clipman-primary.json&amp;quot;&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=PipeWire&amp;diff=22107</id>
		<title>PipeWire</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=PipeWire&amp;diff=22107"/>
		<updated>2022-07-21T16:07:41Z</updated>

		<summary type="html">&lt;p&gt;La9: /* Installation and configuration */ bluetooth&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Draft|The instructions below have not been thoroughly tested and may break things.}}&lt;br /&gt;
&lt;br /&gt;
[https://pipewire.org/ PipeWire] is a multimedia processing engine that aims to improve audio and video handling on Linux.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
=== Audio Group ===&lt;br /&gt;
&lt;br /&gt;
When elogind is not available, the user has to be added to the &amp;lt;code&amp;gt;audio&amp;lt;/code&amp;gt; group. The user must log in for this to take effect.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# addgroup &amp;lt;user&amp;gt; audio&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== D-Bus ===&lt;br /&gt;
&lt;br /&gt;
PipeWire requires a running [https://www.freedesktop.org/wiki/Software/dbus/ D-Bus] session. If you use a full desktop environment this will probably be started automatically, but with minimal window managers it must be done manually.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add dbus dbus-openrc dbus-x11&lt;br /&gt;
# rc-service dbus start&lt;br /&gt;
# rc-update add dbus default&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then use &amp;lt;code&amp;gt;dbus-launch&amp;lt;/code&amp;gt; whenever you start an X or Wayland session. For example:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== XDG_RUNTIME_DIR ===&lt;br /&gt;
&lt;br /&gt;
If you are not using a Desktop Manager, ensure that your &amp;lt;code&amp;gt;XDG_RUNTIME_DIR&amp;lt;/code&amp;gt; is set to a user-writable location. By default for pulseaudio this is {{Path|/run/user/1000/}} or {{Path|/tmp}}. If this is not set, pipewire will create a directory in your home folder instead, called &amp;lt;code&amp;gt;~/pulse&amp;lt;/code&amp;gt;, and on attempting to run Pavucontrol or pactl, you will get the following error:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pactl list&lt;br /&gt;
Connection failure: Connection refused&lt;br /&gt;
pa_context_connect() failed: Connection refused&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation and configuration ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire wireplumber&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|Using [https://gitlab.freedesktop.org/pipewire/wireplumber WirePlumber] rather than the pipewire-media-session (which comes with pipewire) is [https://gitlab.freedesktop.org/pipewire/media-session/-/blob/master/README.md recommended] but not required.}}&lt;br /&gt;
&lt;br /&gt;
Create a custom configuration file in {{Path|/etc/pipewire/pipewire.conf}}:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# mkdir /etc/pipewire&lt;br /&gt;
# cp /usr/share/pipewire/pipewire.conf /etc/pipewire/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Replace pipewire-media-session with wireplumber:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# sed -i &#039;s|#*{ path = &amp;quot;/usr/bin/pipewire-media-session.*|{ path = &amp;quot;wireplumber&amp;quot;  args = &amp;quot;&amp;quot; }|&#039; /etc/pipewire/pipewire.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Enable the &amp;lt;code&amp;gt;snd_seq&amp;lt;/code&amp;gt; kernel module for ALSA support.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# modprobe snd_seq&lt;br /&gt;
# echo snd_seq &amp;gt;&amp;gt; /etc/modules&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Realtime scheduling ===&lt;br /&gt;
&lt;br /&gt;
For realtime scheduling, it is recommended to use rtkit,&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add rtkit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
and then add your user to the `rtkit` group.&lt;br /&gt;
&lt;br /&gt;
Alternatively, ensure your user has the right ulimit permissions. You generally need (limits.conf format):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
@audio - memlock 256&lt;br /&gt;
@audio - nice -11&lt;br /&gt;
@audio - rtprio 88&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This allows a member of the audio group to have the right permissions for PipeWire to use realtime scheduling without rtkit.&lt;br /&gt;
&lt;br /&gt;
=== ALSA ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire-alsa&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ALSA support works out of the box if you have the pipewire-alsa package&lt;br /&gt;
&lt;br /&gt;
=== PulseAudio ===&lt;br /&gt;
&lt;br /&gt;
PipeWire can run a [https://www.freedesktop.org/wiki/Software/PulseAudio/ PulseAudio] daemon which should allow all existing PulseAudio applications to be used with the PipeWire backend.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire-pulse&lt;br /&gt;
# sed -i &#039;s|#*{ path = &amp;quot;/usr/bin/pipewire&amp;quot; args = &amp;quot;-c pipewire-pulse.conf&amp;quot; }|{ path = &amp;quot;/usr/bin/pipewire&amp;quot; args = &amp;quot;-c pipewire-pulse.conf&amp;quot; }|&#039; /etc/pipewire/pipewire.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== JACK ===&lt;br /&gt;
&lt;br /&gt;
If you will be using PipeWire for [https://jackaudio.org/ JACK] applications install the required package and make system wide links to the PipeWire replacement JACK libraries (I have not had success using &amp;lt;code&amp;gt;pw-jack&amp;lt;/code&amp;gt;). You will not need to start a JACK server.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire-jack&lt;br /&gt;
# ln -sf /usr/lib/pipewire-0.3/jack/libjackserver.so.0 /usr/lib/libjackserver.so.0&lt;br /&gt;
# ln -sf /usr/lib/pipewire-0.3/jack/libjacknet.so.0 /usr/lib/libjacknet.so.0&lt;br /&gt;
# ln -sf /usr/lib/pipewire-0.3/jack/libjack.so.0 /usr/lib/libjack.so.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note|These symlinks might be overwritten during updates.}}&lt;br /&gt;
&lt;br /&gt;
=== Video ===&lt;br /&gt;
&lt;br /&gt;
Video should work out-of-the-box with v4l2 devices (e.g. a lot of webcams) and [https://gstreamer.freedesktop.org/ GStreamer] applications.&lt;br /&gt;
&lt;br /&gt;
=== Bluetooth audio ===&lt;br /&gt;
&lt;br /&gt;
* Enable PulseAudio support as described above&lt;br /&gt;
* Install bluetooth service packages: &amp;lt;code&amp;gt;bluez bluez-openrc pipewire-spa-bluez&amp;lt;/code&amp;gt;&lt;br /&gt;
* Optional: install GUI manager for bluetooth &amp;lt;code&amp;gt;blueman&amp;lt;/code&amp;gt;&lt;br /&gt;
* Enable and start bluetooth service: &amp;lt;code&amp;gt;rc-update add bluetooth; rc-service bluetooth start&amp;lt;/code&amp;gt;&lt;br /&gt;
* Restart PipeWire&lt;br /&gt;
* Use commandline program  &amp;lt;code&amp;gt;bluetoothctl&amp;lt;/code&amp;gt; or GUI program &amp;lt;code&amp;gt;blueman-manager&amp;lt;/code&amp;gt; to scan and pair bluetooth audio devices.&lt;br /&gt;
* Use pavucontrol to adjust volume and manually select high definition bluetooth codecs.&lt;br /&gt;
&lt;br /&gt;
=== Automatic bluetooth profile selection ===&lt;br /&gt;
&lt;br /&gt;
To automatically switch between HSP/HFP and A2DP profiles when an input stream is detected, set the bluez5.autoswitch-profile property to true:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/etc/pipewire/media-session.d/bluez-monitor.conf&lt;br /&gt;
&lt;br /&gt;
...&lt;br /&gt;
rules = [&lt;br /&gt;
    {&lt;br /&gt;
        ...&lt;br /&gt;
        actions = {&lt;br /&gt;
            update-props = {&lt;br /&gt;
                ...&lt;br /&gt;
                bluez5.autoswitch-profile = true&lt;br /&gt;
...&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Screen sharing on Wayland ==&lt;br /&gt;
&lt;br /&gt;
You will need the right [https://github.com/flatpak/xdg-desktop-portal xdg-desktop-portal] backend for your desktop environment. Screen sharing is known to work on:&lt;br /&gt;
* GNOME with &amp;lt;code&amp;gt;xdg-desktop-portal-gtk&amp;lt;/code&amp;gt;&lt;br /&gt;
* KDE Plasma with &amp;lt;code&amp;gt;xdg-desktop-portal-kde&amp;lt;/code&amp;gt; and Firefox&lt;br /&gt;
* Sway with &amp;lt;code&amp;gt;xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; and Firefox, see [[Sway]] for details&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
Start the PipeWire media server. You&#039;ll probably get quite a few errors but just ignore them for now.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pipewire&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note| PipeWire doesn&#039;t auto-start a session manager anymore. &lt;br /&gt;
In 3.14 and earlier, the PipeWire default config was edited in packaging to auto-start pipewire-media-session as the default session manager. Since we now have wireplumber available as an alternative session manager, this has been changed in favor of a launch wrapper for pipewire at /usr/libexec/pipewire-launcher. When executed, this will launch pipewire, pipewire-media-session or wireplumber, and pipewire-pulse, depending on what modules are available. If you were launching /usr/bin/pipewire and the session manager manually before, please use the new launcher wrapper instead. WirePlumber can now also be used as a proper alternative for pipewire-media-session.}}&lt;br /&gt;
&lt;br /&gt;
In a different terminal window check the default output device. I don&#039;t yet know how this default can be changed for all applications, so you&#039;d better hope it&#039;s right!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pipewire-tools&lt;br /&gt;
$ pw-cat -p --list-targets&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{Note| pw-cat doesn&#039;t have --list-targets option anymore.&lt;br /&gt;
The version of pipewire used in Alpine 3.16 and later has the --list-targets option removed. You should now use &#039;&#039;&#039;pw-cli list-objects&#039;&#039;&#039; or &#039;&#039;&#039;wpctl status&#039;&#039;&#039; (if you use wireplumber).}}&lt;br /&gt;
&lt;br /&gt;
Test sound is working using an audio file in a format supported by [http://www.mega-nerd.com/libsndfile/ libsndfile] (e.g. flac, opus, ogg, wav).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pw-cat -p test.flac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you have a microphone test audio recording is working.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ pw-cat -r --list-targets&lt;br /&gt;
$ pw-cat -r recording.flac&lt;br /&gt;
(Speak for a while then stop it with Ctrl+c)&lt;br /&gt;
$ pw-cat -p recording.flac&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Test PulseAudio clients using a media player (most use PulseAudio) and if you use JACK test that too:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add jack-example-clients&lt;br /&gt;
$ jack_simple_client&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should hear a sustained beep.&lt;br /&gt;
&lt;br /&gt;
If you are happy everything is working, make PipeWire start automatically when your X or Wayland session starts. For example, you could add the &amp;lt;code&amp;gt;pipewire&amp;lt;/code&amp;gt; command to &amp;lt;code&amp;gt;~/.xinitrc&amp;lt;/code&amp;gt; or your window manager&#039;s config file.&lt;br /&gt;
&lt;br /&gt;
== Troubleshooting ==&lt;br /&gt;
&lt;br /&gt;
=== `pw-cat -p --list-targets` shows no targets ===&lt;br /&gt;
&lt;br /&gt;
First, check whether ALSA knows about your sound card:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
aplay -l&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If sound devices are found, the issue is with your pipewire configuration.  Consider double-checking the instructions above.&lt;br /&gt;
&lt;br /&gt;
Otherwise, your sound card may not be supported in the version of the Linux Kernel you&#039;re running.  You should search online for fixes relating to your current kernel version and the codec of your sound card.  You can find each of these with:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
uname -r&lt;br /&gt;
cat /proc/asound/card0/codec* | grep Codec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Quick Configuration ==&lt;br /&gt;
&lt;br /&gt;
You might want to use pavucontrol to have a simple GUI app for controlling sound, outputs, etc, in which case:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add pavucontrol&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [https://gitlab.freedesktop.org/pipewire/pipewire PipeWire source repository]&lt;br /&gt;
* [https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/home PipeWire Wiki]&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/PipeWire PipeWire on the ArchWiki]&lt;br /&gt;
* [https://wiki.gentoo.org/wiki/Pipewire PipeWire on the Gentoo Wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;br /&gt;
[[Category:Multimedia]]&lt;br /&gt;
[[Category:Sound]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22106</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22106"/>
		<updated>2022-07-21T15:55:54Z</updated>

		<summary type="html">&lt;p&gt;La9: firefox screensharing support, hidpi&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Graphics drivers:&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
&lt;br /&gt;
Add user to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
seatd daemon:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[elogind]], optional for suspend on lid close support.&lt;br /&gt;
&lt;br /&gt;
Install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    wofi                 \ # wayland menu for application selection and screensharing&lt;br /&gt;
    swaylock swaylockd   \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Configure XDG_RUNTIME_DIR.  Add the following to shell init scripts, for the default ash shell it is ~/.profile:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
if test -z &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
  export XDG_RUNTIME_DIR=/tmp/$(id -u)-runtime-dir&lt;br /&gt;
  if ! test -d &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;; then&lt;br /&gt;
    mkdir &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
    chmod 0700 &amp;quot;${XDG_RUNTIME_DIR}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
fi&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Launch Sway with dbus support:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
dbus-launch --exit-with-session sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Launching program under Wayland ==&lt;br /&gt;
&lt;br /&gt;
For some programs, additional configuration is needed to launch them natively under Wayland and to support special features such as screen sharing.&lt;br /&gt;
&lt;br /&gt;
To launch Firefox natively under Wayland and to enable support for screensharing, you need:&lt;br /&gt;
&lt;br /&gt;
* Install and configure [[PipeWire]]&lt;br /&gt;
* Install xdg-desktop-portal and xdg-desktop-portal-wlr package&lt;br /&gt;
* Install wofi for screen selection&lt;br /&gt;
* Launch support programs on sway startup: Add &amp;lt;code&amp;gt;exec pipewire&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;/usr/libexec/xdg-desktop-portal-wlr&amp;lt;/code&amp;gt; to ~/.config/sway/config&lt;br /&gt;
* Export the following variables:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MOZ_ENABLE_WAYLAND=&amp;quot;1&amp;quot;&lt;br /&gt;
export XDG_CURRENT_DESKTOP=sway&lt;br /&gt;
export XDG_SESSION_TYPE=wayland&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== HiDPI ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# for GTK-based programs such as firefox and emacs:&lt;br /&gt;
export GDK_DPI_SCALE=2&lt;br /&gt;
&lt;br /&gt;
# for QT-based programs&lt;br /&gt;
export QT_WAYLAND_FORCE_DPI=&amp;quot;physical&amp;quot;&lt;br /&gt;
export QT_QPA_PLATFORM=&amp;quot;wayland-egl&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream wiki].&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Intel_Video&amp;diff=22105</id>
		<title>Intel Video</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Intel_Video&amp;diff=22105"/>
		<updated>2022-07-21T15:26:27Z</updated>

		<summary type="html">&lt;p&gt;La9: mesa gallium and libva intel driver&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Install the following packages as needed:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;mesa-dri-gallium&amp;lt;/code&amp;gt;: &#039;&#039;&#039;necessary&#039;&#039;&#039; Mesa drivers for all Intel Graphics&lt;br /&gt;
* &amp;lt;code&amp;gt;libva-intel-driver&amp;lt;/code&amp;gt;: VAAPI drivers, for hardware accelerated video encoding and decoding&lt;br /&gt;
&lt;br /&gt;
== Note ==&lt;br /&gt;
&lt;br /&gt;
For all Intel Graphics up to Haswell, the user must manually select &#039;&#039;&#039;crocus&#039;&#039;&#039; Mesa driver in order to let the graphics work properly:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MESA_LOADER_DRIVER_OVERRIDE=crocus&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For newer Intel Graphics, if automatic driver selection does not work and bugs such as missing mouse cursor under [[Sway]] occur (no hardware graphics acceleration), the user can manually select &#039;&#039;&#039;iris&#039;&#039;&#039; driver:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export MESA_LOADER_DRIVER_OVERRIDE=iris&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Elogind&amp;diff=22104</id>
		<title>Elogind</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Elogind&amp;diff=22104"/>
		<updated>2022-07-21T15:11:03Z</updated>

		<summary type="html">&lt;p&gt;La9: create page with installation instructions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;elogind&#039;&#039;&#039; is a login manager and provides support for &lt;br /&gt;
&lt;br /&gt;
* setting up necessary permissions for the desktop environment or window manager&lt;br /&gt;
* handling poweroff, reboot, suspend and hibernate via &#039;&#039;&#039;loginctl&#039;&#039;&#039; command&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add elogind polkit-elogind&lt;br /&gt;
# rc-update add elogind&lt;br /&gt;
# rc-service elogind start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Configuration ==&lt;br /&gt;
&lt;br /&gt;
=== logind.conf ===&lt;br /&gt;
&lt;br /&gt;
Edit &amp;lt;code&amp;gt;/etc/elogind/logind.conf&amp;lt;/code&amp;gt; to configure handling of power events, such as suspending the computer when power button is pressed:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
sed -i &#039;s|#HandlePowerKey=poweroff|HandlePowerKey=suspend|&#039; /etc/elogind/logind.conf&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== polkit policies ===&lt;br /&gt;
&lt;br /&gt;
elogind package does not ship with any polkit policies by default, meaning that no one is allowed to use &#039;&#039;&#039;loginctl&#039;&#039;&#039; command.&lt;br /&gt;
&lt;br /&gt;
We need to add custom polkit rules to allow specific users to execute &#039;&#039;&#039;loginctl&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Example for allowing all users in the user group &amp;lt;code&amp;gt;wheel&amp;lt;/code&amp;gt; to suspend the computer with &#039;&#039;&#039;loginctl suspend&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tee -a /etc/polkit-1/rules.d/88-suspend.rules &amp;lt;&amp;lt;EOF&lt;br /&gt;
polkit.addRule(function(action, subject) {&lt;br /&gt;
    if (action.id == &amp;quot;org.freedesktop.login1.suspend&amp;quot; &amp;amp;&amp;amp;&lt;br /&gt;
        subject.isInGroup(&amp;quot;wheel&amp;quot;)) {&lt;br /&gt;
        return polkit.Result.YES;&lt;br /&gt;
    }&lt;br /&gt;
});&lt;br /&gt;
EOF&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22103</id>
		<title>Sway</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Sway&amp;diff=22103"/>
		<updated>2022-07-20T00:24:33Z</updated>

		<summary type="html">&lt;p&gt;La9: to work with gallium, crocus is needed for older graphics&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[http://swaywm.org Sway] is a tiling [[Wayland]] compositor. It&#039;s a drop-in replacement for the i3 window manager.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
First, install &amp;amp; configure eudev:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add eudev&lt;br /&gt;
# setup-udev&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then install the mesa graphics drivers:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add mesa-dri-gallium&lt;br /&gt;
## older intel graphics need &lt;br /&gt;
# MESA_LOADER_DRIVER_OVERRIDE=crocus&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following links contain guides for setting up the video stack.&lt;br /&gt;
&lt;br /&gt;
* [[Intel Video]]&lt;br /&gt;
* [[Radeon Video]]&lt;br /&gt;
&lt;br /&gt;
Add yourself to the input and video groups:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# adduser $USER input&lt;br /&gt;
# adduser $USER video&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You have to log out and back in for this to take effect. &lt;br /&gt;
&lt;br /&gt;
Install some TTF fonts:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add ttf-dejavu&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since sway 1.6.1 (more specifically, since wlroots 0.14), you need to set up libseat backend if you wish to run sway directly (without nesting it in another wayland compositor). To do that, [[Repositories#Enabling_the_community_repository|enable the community repository]] and choose one of the following methods:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;Option 1: seatd daemon (recommended)&amp;lt;/dt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd&lt;br /&gt;
# rc-update add seatd&lt;br /&gt;
# rc-service seatd start&lt;br /&gt;
# adduser $USER seat&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you are already logged in as a $USER, you will need to relogin.&lt;br /&gt;
&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;Option 2: seatd-launch&amp;lt;/dt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add seatd-launch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
When starting sway, you will need to prefix invocation with &amp;lt;code&amp;gt;seatd-launch&amp;lt;/code&amp;gt;.  &lt;br /&gt;
Note: &amp;lt;code&amp;gt;seatd-launch&amp;lt;/code&amp;gt; is a suid binary, so it might be wise to use one of the other methods from a security perspective.&lt;br /&gt;
&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;dt&amp;gt;Option 3: elogind daemon&amp;lt;/dt&amp;gt;&lt;br /&gt;
&amp;lt;dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add elogind polkit-elogind&lt;br /&gt;
# rc-update add elogind&lt;br /&gt;
# rc-service elogind start&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using &amp;lt;code&amp;gt;elogind&amp;lt;/code&amp;gt; will automatically set the necessary permissions, so you can skip adding groups like &amp;lt;code&amp;gt;seat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;video&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dd&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/dl&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
We can now install sway:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
# apk add sway sway-doc&lt;br /&gt;
# apk add                \ # Install optional dependencies:&lt;br /&gt;
    xwayland             \ # recommended for compatibility reasons&lt;br /&gt;
    foot                 \ # default terminal emulator&lt;br /&gt;
    dmenu                \ # default application launcher&lt;br /&gt;
    swaylock             \ # lockscreen tool&lt;br /&gt;
    swaybg               \ # wallpaper daemon&lt;br /&gt;
    swayidle               # idle management (DPMS) daemon&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Running Sway ==&lt;br /&gt;
&lt;br /&gt;
To run sway, first set XDG_RUNTIME_DIR to a suitable location (e.g. create a .run folder in your home directory and set it to ~/.run). Then run sway from the Linux console (dbus-launch is used because pipewire needs it, it is included in dbus-x11 and you may omit it):&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ XDG_RUNTIME_DIR=~/.run dbus-launch sway&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(if you run sway with seatd-launch, you will need to use &amp;lt;code&amp;gt;$ XDG_RUNTIME_DIR=~/.run dbus-launch seatd-launch sway&amp;lt;/code&amp;gt;)&lt;br /&gt;
&lt;br /&gt;
You can also create a simple alias in your shell rc file (e.g. .zshrc), like:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
alias swayinit=&amp;quot;XDG_RUNTIME_DIR=~/.run dbus-launch seatd-launch sway&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the [https://wiki.alpinelinux.org/wiki/Wayland Wayland] page for a permanent configuration&lt;br /&gt;
&lt;br /&gt;
{{Note|&lt;br /&gt;
swaylock needs to be able to read your &amp;lt;code&amp;gt;/etc/shadow&amp;lt;/code&amp;gt; file to be able to validate your password&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Configuration and Usage ==&lt;br /&gt;
&lt;br /&gt;
An example config is provided at &amp;lt;code&amp;gt;/etc/sway/config&amp;lt;/code&amp;gt;. Copy it to &amp;lt;code&amp;gt;~/.config/sway/config&amp;lt;/code&amp;gt; and read through it to learn the default keybindings.&lt;br /&gt;
&lt;br /&gt;
You might want to have gaps between windows, in which case add:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
inner_gaps 20&lt;br /&gt;
outer_gaps 20&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
(replace 20 with the amount of pixels you want to be used for gaps) in your sway config.&lt;br /&gt;
&lt;br /&gt;
You might have two monitors, and you might want to set their position, so here&#039;s an example of how to do it:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
output eDP-1 mode 1920x1080@60Hz&lt;br /&gt;
output eDP-1 position 1920,0&lt;br /&gt;
output DP-1 position 0,0&lt;br /&gt;
output DP-1 mode 1920x1080@120Hz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In this case, eDP-1 is the internal laptop monitor running at 60Hz and DP-1 is the external monitor running at 120Hz. The position of the laptop monitor is where the external monitor&#039;s width ends, so if the display is 1920 pixels wide and it is on the left, the laptop&#039;s monitor would be on the right, so it&#039;s width would start at the end of the second monitor&#039;s width, so at 1920. Replace the eDP-1 and DP-1 outputs with your own ones, and to change resolution and refresh rate, change the mode according to your parameters.&lt;br /&gt;
&lt;br /&gt;
For additional information, start at &amp;lt;code&amp;gt;man 5 sway&amp;lt;/code&amp;gt; and read the [https://github.com/swaywm/sway/wiki upstream FAQ].&lt;br /&gt;
&lt;br /&gt;
[[Category:Desktop]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Intel_Video&amp;diff=22102</id>
		<title>Intel Video</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Intel_Video&amp;diff=22102"/>
		<updated>2022-07-19T23:42:03Z</updated>

		<summary type="html">&lt;p&gt;La9: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;When running on 3.12 or before, nomodeset must be removed from the [[Kernel parameters]].&lt;br /&gt;
&lt;br /&gt;
Alpine Linux 3.13+: install mesa-dri-gallium package.  For older Intel Graphics ranging from Gen4 (GMA Graphics from 2006) to Gen 7 (Haswell Intel HD 4000+ graphics), a newer, more performant driver called &amp;quot;crocus&amp;quot; need to be enabled.  Enable &amp;quot;crocus&amp;quot; with &amp;quot;MESA_LOADER_DRIVER_OVERRIDE=crocus&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Kernel Modesetting]]&lt;br /&gt;
* [https://wiki.archlinux.org/index.php/Intel_graphics Intel graphics on Arch Linux wiki]&lt;br /&gt;
&lt;br /&gt;
[[Category:Drivers]]&lt;/div&gt;</summary>
		<author><name>La9</name></author>
	</entry>
</feed>