1
0
mirror of https://github.com/Dejvino/pinephone-sway-poc.git synced 2024-11-14 02:47:28 +00:00
Go to file
2020-07-04 22:27:50 +02:00
home/config Add vertical waybar for landscape mode 2020-06-16 23:41:58 +02:00
lisgd@877beea273 Add lisgd and rot8 support 2020-06-06 22:07:20 +02:00
patches Add lisgd patch to support screen rotation. 2020-06-13 22:48:28 +02:00
pinephone-toolkit@51b6fa81ab Fix minimal backlight value 2020-05-31 09:11:20 +02:00
rot8@8f2128c172 Add lisgd and rot8 support 2020-06-06 22:07:20 +02:00
usr Add vertical waybar for landscape mode 2020-06-16 23:41:58 +02:00
.gitmodules Add vertical waybar for landscape mode 2020-06-16 23:41:58 +02:00
LICENSE Initial commit 2020-05-26 18:53:07 +02:00
Makefile Fixed lisgd version with for the patch file 2020-06-19 15:34:08 +02:00
README.md Add missing 'dialog' dependency 2020-07-04 22:27:50 +02:00
screenshots.png Update README with screenshot. 2020-06-01 22:24:55 +02:00

pinephone-sway-poc

Sway UI configured for PINE64 PinePhone (Proof Of Concept)

You can find ready-made config files, scripts and installation instructions on how to set up Sway on postmarketOS and use it with a PinePhone.

Screenshots

Install

Start with a postmarketOS for PinePhone image with postmarketos-ui-sway installed. Either use the pre-built demo image or build a custom one with pmbootstrap.

Flash the system onto the phone (either to an SD card or directly to the eMMC with Jumpdrive).

Open a terminal on the phone (either through SSH, the serial connection or directly on the screen) and run this:

# components
$ sudo apk add waybar bemenu swaylock swayidle squeekboard networkmanager htop pavucontrol bash dialog

# build tools
$ sudo apk add git make meson ninja cargo linux-headers libinput-dev eudev-dev

# installation
$ git clone --recurse-submodules https://github.com/Dejvino/pinephone-sway-poc
$ cd pinephone-sway-poc
$ make install_user
$ sudo make install_system

That's it. You should now have everything in place. Reboot to use the new settings.

Usage

Study the provided config files and shell scripts to get more details. The following is just an introduction.

Power Button

The power button activates or deactivates a "sleep mode", in which the backlight is turned off, all the CPUs except for the primary one are shut down and the red LED is turned on to indicate the phone is turned on.

Top and bottom waybar

The bars show you CPU/MEM usage, backlight brightness, time, etc. Touching them opens a relevant app (e.g. NetworkManager or htop). Touching the date opens a custom "quick execute" menu to launch an app. The [x] icon closes the active window. Touching the backlight indicator brings up a custom brightness setting app.

Touch gestures

Swiping two fingers up / down activates or hides the on-screen keyboard. Swiping two fingers left / right changes the active workspace. Three fingers change the active window in the direction of the swipe. Four fingers move the active window accordingly.

Screen Rotation

The screen is automatically rotated based on the readings from the phone's built-in accelerometer.

TIP!

You can use this as a configs backup mechanism!

$ make fetch

Running this command gathers the relevant config files from your running system and replaces the files in the repository. You can then git add and commit your own changes, straight from the phone! This is actually how the config files here were created.

Components

  • postmarketOS - base Linux distribution (though any other would work as well)
  • sway (pmos package) - tiling Wayland compositor
    • swayidle, swaylock - utils for sway
  • bemenu (pmos package) - app launcher
  • waybar (pmos package) - Wayland status bar
  • squeekboard (pmos package) - on-screen keyboard for Wayland
  • pinephone-toolkit - various utilities for the PinePhone
  • sxmo-lisgd - gesture detection daemon
  • rot8 - screen rotation daemon using data from the accelerometer
  • htop (pmos package) - Processes monitoring
  • pavucontrol (pmos package) - PulseAudio control panel

(pmos package = available as a package directly from the postmarketOS repository)