User:Khimaros

From postmarketOS

configure wireless network

the simplest solution is to use networkmanager.

sudo nmcli connection add ifname wlan0 type wifi conn-name <SSID> ssid <SSID> wifi-sec.key-mgmt wpa-psk wifi-sec.psk <PASSWORD>

sudo nmcli connection up <SSID> ifname wlan0

running wlroots based compositors on x11/fbdev + pixman

these notes are optimized for the huawei angler.

you will need internet connectivity on the device.

references

pixman renderer was added to wlroots in https://github.com/swaywm/wlroots/pull/2661/files

WIP to support wlroots 0.14.0 in phoc: https://source.puri.sm/Librem5/phoc/-/merge_requests/241

bootstrap

pmbootstrap init, install, flash, etc. then connect to your device:

ssh user@172.16.42.1

install build deps

sudo apk add  \
        git \
        alpine-sdk \
        consolekit2 \
        libseat-dev \
        elogind-dev \
        eudev-dev \
        libcap-dev \
        libinput-dev \
        libxcb-dev \
        libxkbcommon-dev \
        xcb-util-renderutil-dev \
        mesa-dev \
        meson \
        ninja \
        pixman-dev \
        wayland-dev \
        wayland-protocols \
        xcb-util-image-dev \
        xcb-util-wm-dev \
        xkeyboard-config \
        xwayland-dev \
        json-c-dev \
        pango-dev \
        gdk-pixbuf-dev \
        libevdev-dev \
        gnome-desktop-dev \
        squeekboard

mkdir ~/work

cd ~/work

wget http://dl-cdn.alpinelinux.org/alpine/v3.12/community/aarch64/xcb-util-errors-1.0-r0.apk

wget http://dl-cdn.alpinelinux.org/alpine/v3.12/community/aarch64/xcb-util-errors-dev-1.0-r0.apk

sudo apk add ./xcb-util-errors-1.0-r0.apk ./xcb-util-errors-dev-1.0-r0.apk

build

wlroots

cd ~/work

git clone https://github.com/swaywm/wlroots.git

wget https://salsa.debian.org/swaywm-team/wlroots/-/raw/debian/experimental/debian/patches/Revert-layer-shell-error-on-0-dimension-without-anchors.patch

patch -p1 -d wlroots < Revert-layer-shell-error-on-0-dimension-without-anchors.patch

cd ~/work/wlroots

JOBS=3

abuild-meson . build
 
meson compile ${JOBS:+-j ${JOBS}} -C build

sudo meson install --no-rebuild -C build

phoc

cd ~/work

git clone https://source.puri.sm/sebastian.krzyszkowiak/phoc.git
git -C phoc fetch origin wlroots-0.13
git -C phoc checkout wlroots-0.13

JOBS=3

cd ~/work/phoc

sed -i 's/wlr_gtk_primary_selection\.h/wlr_primary_selection\.h/g' src/desktop.h

abuild-meson -Dembed-wlroots=disabled . build

meson compile ${JOBS:+-j ${JOBS}} -C build

sudo meson install --no-rebuild -C build

phosh (optional)

sudo apk add libhandy1-dev gcr-dev upower-dev linux-pam-dev pulseaudio-dev networkmanager-dev polkit-elogind-dev libsecret-dev feedbackd-dev elogind-dev

cd ~/work

git clone https://source.puri.sm/Librem5/phosh.git

cd ~/work/phosh

JOBS=3

abuild-meson . build
 
meson compile ${JOBS:+-j ${JOBS}} -C build

sudo meson install --no-rebuild -C build

sway (optional)

cd ~/work

git clone https://github.com/swaywm/sway.git

cd ~/work/sway

JOBS=3

abuild-meson . build
 
meson compile ${JOBS:+-j ${JOBS}} -C build

sudo meson install --no-rebuild -C build

configure

xorg

sudo apk add xorg-server xf86-video-fbdev

cat <<EOF | sudo tee /etc/X11/xorg.conf
Section "Device"
    Identifier "FBDEV"
    Driver "fbdev"
    Option "fbdev" "/dev/fb0"
EndSection

Section "Monitor"
    Identifier "Monitor"
    # Generated using: cvt 1440 2560
    Modeline "1440x2560" 318.00 1440 1568 1720 2000 2560 2563 2573 2651 -hsync +vsync
    DisplaySize 1440 2560
EndSection
EOF

phosh

sed 's|/usr/bin/phosh|/usr/bin/phosh-session|g' /usr/share/wayland-sessions/phosh.desktop | sudo tee /usr/share/xsessions/phosh.desktop

sudo ln -sf /usr/share/xsessions/phosh.desktop /var/lib/tinydm/default-session.desktop

cat <<EOF | sudo tee /usr/bin/phosh-session
#!/bin/sh

export G_MESSAGES_DEBUG=all
export WLR_BACKENDS=x11,libinput
export WLR_RENDERER=pixman
#export WLR_RENDERER_ALLOW_SOFTWARE=1
#export WLR_NO_HARDWARE_CURSORS=1
export DISPLAY=:0

exec dbus-run-session /usr/bin/phosh "\$@"
EOF

sudo chmod +x /usr/bin/phosh-session

cat <<EOF | sudo tee /usr/share/phosh/phoc.ini
[output:X11-1]
mode = 1440x2560
scale = 3
EOF

cat <<EOF | sudo tee /etc/pulse/client.conf
autospawn = no
EOF

sudo service tinydm restart

cat ~user/.local/state/tinydm.log

sway (optional)

sed 's|Exec=sway|Exec=sway-session|g' /usr/share/wayland-sessions/sway.desktop | sudo tee /usr/share/xsessions/sway.desktop

sudo ln -sf /usr/share/xsessions/sway.desktop /var/lib/tinydm/default-session.desktop

cat <<EOF | sudo tee /usr/bin/sway-session
#!/bin/sh

export G_MESSAGES_DEBUG=all
export WLR_BACKENDS=x11,libinput
export WLR_RENDERER=pixman
#export WLR_RENDERER_ALLOW_SOFTWARE=1
#export WLR_NO_HARDWARE_CURSORS=1
export DISPLAY=:0

exec dbus-run-session /usr/bin/sway -V "\$@"
EOF

sudo chmod +x /usr/bin/sway-session

cat <<EOF | sudo tee /etc/sway/config.d/10-x11
output X11-1 scale 2
output X11-1 pos 0 0 res 1440x2560
EOF

cat <<EOF | sudo tee /etc/sway/config.d/20-squeekboard
exec /usr/bin/squeekboard
EOF

sudo service tinydm restart

cat ~user/.local/state/tinydm.log

improving gnome usability on huawei angler

bootstrap

pmbootstrap init and install w/ gnome as interface

scaling tweaks

cat <<EOF | sudo tee /usr/share/glib-2.0/schemas/93_hidpi.gschema.override
[org.gnome.desktop.interface]
scaling-factor=3
EOF

sudo glib-compile-schemas /usr/share/glib-2.0/schemas

install useful packages

sudo apk add \
    dino \
    geary \
    firefox \
    fractal \
    lollypop \
    gnome-feeds \
    gnome-podcasts \
    megapixels \
    nautilus