Sway on PinePhone POC
#1
Hi,

I got inspired by the cool sxmo project and decided to try something similar with my favorite tiling compositor: Sway. I've put together a proof of concept (POC) solution which consists of several config files and shell scripts. You can find it here: https://github.com/Dejvino/pinephone-sway-poc

There are various menus and shortcuts to help you avoid using the on-screen keyboard all the time. E.g. touching the backlight indicator spawns a custom dialog where you can change the settings. You can also use touch gestures to do some common tasks like move terminals around etc. Pressing the power button puts the phone into "sleep" mode to avoid draining the battery that much (replacing  the default shutdown action).

Be aware that this is just a bunch of configs that you can apply to your existing postmarketOS installation. Not a full image. Plus it likely has some gaps. But I think it could be helpful for someone anyway. It's surprising how much you can achieve with just the sway config file!

But that's not all! Even if you don't care about sway you might want to check out pinephone-toolkit which is a collection of UI-agnostic tools for controlling the LED, backlight, vibrations and putting the secondary CPUs into sleep. These should work with any distribution, so it is a nice building block.
  Reply
#2
Could it be made to work with a debian based distribution?
  Reply
#3
(06-02-2020, 11:06 AM)nas Wrote: Could it be made to work with a debian based distribution?

I expect it could. Likely all you have to do is replace "sudo apk add X Y Z" with "sudo apt install X Y Z" and it will work Smile  There is nothing really postmarketOS-specific there, maybe apart from using "elogind-inhibit" instead of "systemd-inhibit", but that should be it.
  Reply
#4
This is pretty neat and cool to see lisgd pop up somewhere else too Wink

I'll have to play around with this, I'm particularly interested in the program you have in pinephone-toolkit `cpu-sleep` to put certain CPUs offline. (Curious how that'd work out for say continuing to listen to music or something, e.g. does that still work; and is there a big battery life gain - do you have any stats for batterylife in this single-cpu/low-cpu mode?)

Also curious how manageable sway is with gestures - one problem I had with lisgd and gestures is that if your finger generally overruns multiple windows, you wind up switching window focus (atleast in dwm, and that throws off the meaning of the gesture); but curious how this worked out in your setup and how reliable it is. Will have to play around with this when I get some free time or if you wind up making an ISO that would be awesome.
  Reply
#5
(06-02-2020, 06:23 PM)mil Wrote: This is pretty neat and cool to see lisgd pop up somewhere else too Wink

I'll have to play around with this, I'm particularly interested in the program you have in pinephone-toolkit `cpu-sleep` to put certain CPUs offline. (Curious how that'd work out for say continuing to listen to music or something, e.g. does that still work; and is there a big battery life gain - do you have any stats for batterylife in this single-cpu/low-cpu mode?)

Also curious how manageable sway is with gestures - one problem I had with lisgd and gestures is that if your finger generally overruns multiple windows, you wind up switching window focus (atleast in dwm, and that throws off the meaning of the gesture); but curious how this worked out in your setup and how reliable it is. Will have to play around with this when I get some free time or if you wind up making an ISO that would be awesome.

To be fair putting CPUs into sleep doesn't do anything fancy, just `echo 0 > /sys/devices/system/cpu/cpu1/online` for 3 out of 4 CPUs Smile  I don't have any statistics, but looking at the charging current it helped only slightly. I ran just one test: leaving it idling in the "sleep" mode, after 6.5 hours it had 7 % battery left, proving I could use it off the grid Big Grin

When going to sleep while playing music, there is a brief but audible skip if the player's process gets transferred to the primary CPU. Otherwise it works great and one CPU manages to play a song no problem.

Focus in sway is controlled more explicitly, so it stays where you set it. On the other hand the source touch events get propagated to the underlying windows. You may get some unwanted actions this way Smile 

I wanted to avoid diving into the problems of how to build an image with everything included, but if this PoC turns out usable, I'll reconsider it.
  Reply
#6
as an avid sway user on pinebookpro i just wanted to say thanks for this, and if a pinephone happens in my life i'll be back. Wink
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Slarm64 on PinePhone [Unofficial Slackware ARM - 64 bit] acid andy 33 24,427 04-09-2024, 01:17 PM
Last Post: donchurch
Wink PINEPHONE not booting Touchwood 2 409 02-23-2024, 07:27 AM
Last Post: Touchwood
  Slack on PinePhone Adam Seline 5 5,337 12-20-2023, 07:20 AM
Last Post: nickolas
  Struggle to install LibreOffice on the PinePhone Peter Gamma 48 24,044 11-24-2023, 07:02 AM
Last Post: Peter Gamma
  Which word processor to choose for the Pinephone? Peter Gamma 8 1,932 11-23-2023, 01:06 AM
Last Post: Peter Gamma
  openSUSE for Pinephone Alefnode 75 101,226 11-17-2023, 08:37 AM
Last Post: Uturn
  Using Signal on PinePhone in mid-2023? dante404 45 12,865 11-17-2023, 04:23 AM
Last Post: Kevin Kofler
  Genode- Sculpt OS for the PinePhone (non Linux) Surehand53 1 953 11-04-2023, 07:23 PM
Last Post: tllim
  Abiword as a office mobile word processor for the Pinephone? Peter Gamma 11 2,129 10-24-2023, 08:57 AM
Last Post: Peter Gamma
  What File Manager Options Are There For The Pinephone? pinephoneuser22 7 2,346 10-18-2023, 08:37 AM
Last Post: luppivega

Forum Jump:


Users browsing this thread: 1 Guest(s)