You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 4.4 KiB

4 vuotta sitten
3 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
4 vuotta sitten
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. # pinephone-sway-poc
  2. Sway UI configured for PINE64 PinePhone (Proof Of Concept)
  3. You can find ready-made config files, scripts and installation instructions on how to set up Sway on Arch Linux ARM or postmarketOS and use it with a PinePhone.
  4. ![Screenshots](./screenshots.png)
  5. ## Install
  6. ### postmarketOS
  7. Start with a [postmarketOS](https://wiki.postmarketos.org/wiki/PINE64_PinePhone_(pine64-pinephone)) for PinePhone image with `postmarketos-ui-sway` installed. Either use the pre-built demo image or build a custom one with `pmbootstrap`.
  8. Flash the system onto the phone (either to an SD card or directly to the eMMC with Jumpdrive).
  9. Open a terminal on the phone (either through SSH, the serial connection or directly on the screen) and run this:
  10. ```bash
  11. # system components
  12. $ sudo apk add waybar bemenu swaylock swayidle squeekboard bash dialog tzdata
  13. # user components
  14. $ sudo apk add networkmanager htop pavucontrol
  15. # build tools
  16. $ sudo apk add git make meson ninja cargo linux-headers libinput-dev eudev-dev
  17. ```
  18. ### Arch Linux ARM
  19. Start with a [Pine64-Arch](https://github.com/dreemurrs-embedded/Pine64-Arch/) image flashed to the phone. You'll need the `sway` package and most of what is mentioned in the `postmarketOS` section. Disable (or remove) the default `phosh` package so that it doesn't get loaded on boot.
  20. ### Common
  21. ```bash
  22. # installation
  23. $ git clone --recurse-submodules https://github.com/Dejvino/pinephone-sway-poc
  24. $ cd pinephone-sway-poc
  25. $ make install_user
  26. $ sudo make install_system
  27. # power button
  28. sudo vim /etc/systemd/logind.conf # or /etc/elogind/logind.conf for non-systemd distros (pmOS)
  29. # replace:
  30. # #HandlePowerKey=poweroff
  31. # with:
  32. # HandlePowerKey=suspend
  33. ```
  34. That's it. You should now have everything in place. Reboot to use the new settings.
  35. ## Usage
  36. Study the provided config files and shell scripts to get more details. The following is just an introduction.
  37. ### Power Button
  38. The power button activates or deactivates a "sleep mode" (suspend). This mode is automatically entered after a period of inactivity (via swayidle). Before that, the backlight is first turned low, then the backlight is turned off and all the CPUs except for the primary one are shut down. The indicator LED is used to indicate the power mode: 1) green = running, low power usage, 2) blue = suspend.
  39. ### Top and bottom waybar
  40. 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.
  41. ### Touch gestures
  42. 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.
  43. ### Screen Rotation
  44. The screen is automatically rotated based on the readings from the phone's built-in accelerometer.
  45. ## TIP!
  46. You can use this as a configs backup mechanism!
  47. ```
  48. $ make fetch
  49. ```
  50. 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.
  51. ## Components
  52. * postmarketOS / Arch Linux ARM - base Linux distribution (though any other would work as well)
  53. * sway (packaged) - tiling Wayland compositor
  54. * * swayidle, swaylock - utils for sway
  55. * bemenu (packaged) - app launcher
  56. * waybar (packaged) - Wayland status bar
  57. * * [carlosdss22/dotfiles](https://github.com/carlosdss22/dotfiles/tree/master/waybar) - styles used
  58. * squeekboard (packaged) - on-screen keyboard for Wayland
  59. * * [terminal.yaml](https://source.puri.sm/btantau/squeekboard/blob/btantau-master-patch-76686/data/keyboards/terminal.yaml) - keyboard layout based on this improved version
  60. * [pinephone-toolkit](https://github.com/Dejvino/pinephone-toolkit) - various utilities for the PinePhone
  61. * [sxmo-lisgd](https://git.sr.ht/~mil/lisgd) - gesture detection daemon
  62. * [rot8](https://github.com/efernau/rot8) - screen rotation daemon using data from the accelerometer
  63. * htop (packaged) - Processes monitoring
  64. * pavucontrol (packaged) - PulseAudio control panel
  65. * mako (packaged) - Notify daemon
  66. (*packaged* = available as a package directly from the repository)