Difference between revisions of "Projects:PinePhone Daily Driver with Sway"

From Dejvino's Knowledge Base
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
Implementation of [[Projects:PinePhone Daily Driver]] using [[SwayWM]].
 
Implementation of [[Projects:PinePhone Daily Driver]] using [[SwayWM]].
 +
 +
{{warning|1='''HARDCORE'''
 +
 +
It is too much work to put all of the parts of the system together and maintain them on your own!
 +
 +
Next stop: [[Projects:PinePhone Daily Driver with Arch Linux]]}}
  
 
== Components ==
 
== Components ==
* [[postmarketOS]] with [[SwayWM|postmarketos-ui-sway]]
+
* [[Arch Linux ARM]] with [[SwayWM]]
 
* [[PinePhone-Toolkit|pinephone-toolkit]]
 
* [[PinePhone-Toolkit|pinephone-toolkit]]
* System packages: [[bemenu]] [[networkmanager]] [[termite]] termite-terminfo [[bluez]] [[squeekboard]]
+
* System packages: [[sddm]] [[bemenu]] [[networkmanager]] [[alacritty]] [[bluez]] [[squeekboard]]
* App packages: [[vim]] [[firefox]] [[galculator]] [[thunderbird]] [[gajim]] [[audacious]] audacious-plugins [[htop]]
+
* App packages: [[vim]] [[firefox]] [[galculator]] [[thunderbird]] [[vlc]] [[birdie]] [[htop]]
  
 
== Setup ==
 
== Setup ==
 
Configs are stored in a [https://github.com/Dejvino/pinephone-sway-poc repository].
 
Configs are stored in a [https://github.com/Dejvino/pinephone-sway-poc repository].
  
{{Todo|Create a [[postmarketOS]] package? [https://wiki.postmarketos.org/wiki/Create_a_package]}}
+
{{Todo|Create a package for people to use and install easily}}
  
 
=== Power Management ===
 
=== Power Management ===
 
* backlight off and CPU sleep when screen is locked via power button
 
* backlight off and CPU sleep when screen is locked via power button
 
* handled via [[PinePhone-Toolkit]]
 
* handled via [[PinePhone-Toolkit]]
 +
 +
=== [[sudo]] ===
 +
Add NOPASSWD for shutdown and reboot to wheel group:
 +
 +
{{codeblock|title=visudo|1=%wheel ALL=(ALL) ALL
 +
%wheel ALL=(ALL) NOPASSWD: /sbin/poweroff,/sbin/reboot}}
  
 
=== [[elogind]] ===
 
=== [[elogind]] ===
Line 54: Line 66:
 
{{todo|Complete these TODOs!}}
 
{{todo|Complete these TODOs!}}
 
# power saving (so that I can leave the battery in the device when I'm not using it)
 
# power saving (so that I can leave the battery in the device when I'm not using it)
#* hibernation / suspend command
+
## hibernation / suspend command - needs crust support in pmos: [https://gitlab.com/postmarketOS/pmaports/-/issues/550 issue 550]
#* shortcut to enter suspend
+
## shortcut to enter suspend
#* {{IconInfo}} {{code|1=rtcwake -m mem -s 10}} ... {{IconFail}} does not resume operation after issuing ''s2idle''
+
##* {{IconInfo}} {{code|1=rtcwake -m mem -s 10}} ... {{IconFail}} does not resume operation after issuing ''s2idle''
 +
# Core UI
 +
#* Display rotation
 +
#** Vertical waybar - hide/show based on output transformation/waybar-window size [https://github.com/Alexays/Waybar/search?q=hidden&unscoped_q=hidden]
 
# Install and test essential apps & workflows
 
# Install and test essential apps & workflows
 
## {{IconDone}} Terminal: [[termite]]
 
## {{IconDone}} Terminal: [[termite]]
 
## {{IconWip}} Web browser: [[Firefox]]
 
## {{IconWip}} Web browser: [[Firefox]]
## {{IconTodo}} Passwords manager: [[KeepassXC]])
+
##* Mostly works. Portrait mode doesn't fit perfectly. Clunky UI, some menus overflow.
 +
## {{IconWip}} Passwords manager: [[KeepassXC]])
 +
##* Doesn't support such a small screen. Modify and submit a PR?
 
## {{IconTodo}} Personal Information Manager with [[WebDAV]] sync support for calendar, contacts
 
## {{IconTodo}} Personal Information Manager with [[WebDAV]] sync support for calendar, contacts
 
## {{IconTodo}} Email client: [[thunderbird]]
 
## {{IconTodo}} Email client: [[thunderbird]]
 +
##* Doesn't support such a small screen. Modify and submit a PR?
 
## {{IconDone}} Calculator: [[galculator]]
 
## {{IconDone}} Calculator: [[galculator]]
 
## {{IconTodo}} Alarm: ?
 
## {{IconTodo}} Alarm: ?
Line 70: Line 88:
 
##* Slack: ?
 
##* Slack: ?
 
## {{IconWip}} Music player: [[audacious]]
 
## {{IconWip}} Music player: [[audacious]]
 +
##* A few problems with the small screen. Otherwise seems to work.
 
## {{IconTodo}} Camera & Video recorder: ?
 
## {{IconTodo}} Camera & Video recorder: ?
 
## {{IconTodo}} VPN client: [[NetworkManager]]?
 
## {{IconTodo}} VPN client: [[NetworkManager]]?
Line 79: Line 98:
 
#* {{IconTodo}} Maps, navigation: ?
 
#* {{IconTodo}} Maps, navigation: ?
 
#* {{IconTodo}} Calls & Texts: ?
 
#* {{IconTodo}} Calls & Texts: ?
# Touch gestures and controls
+
#* {{IconTodo}} Samba share mounted from NAS
#* [[sxmo#lisgd]] {{todo|command line setup, compilation and install from the POC repo}}
+
#** CIFS is not supported by the kernel right now
#* Custom input device? [https://python-evdev.readthedocs.io/en/latest/tutorial.html]
+
# Tweaking
#* Wayland touch [https://wayland-book.com/seat/touch.html]
 
# tweaking
 
 
#* Configure [[Firefox]] for touch: [https://wiki.postmarketos.org/wiki/Firefox]?
 
#* Configure [[Firefox]] for touch: [https://wiki.postmarketos.org/wiki/Firefox]?
#* ''acpi'' for battery monitoring?
 
 
#* ...
 
#* ...
 
# non-essential userspace apps
 
# non-essential userspace apps
Line 91: Line 107:
 
# cool stuff
 
# cool stuff
 
#* presentation mode [https://github.com/Alexays/Waybar/wiki/Module:-Idle-Inhibitor]
 
#* presentation mode [https://github.com/Alexays/Waybar/wiki/Module:-Idle-Inhibitor]
 +
#* night mode: flux / nightlight / redshift / ...
 +
#* automated brightness based on screen content [https://github.com/maximbaz/wluma]
  
 
== Rejected solutions ==
 
== Rejected solutions ==

Latest revision as of 04:17, 23 October 2021

Implementation of Projects:PinePhone Daily Driver using SwayWM.

(!) HARDCORE

It is too much work to put all of the parts of the system together and maintain them on your own!

Next stop: Projects:PinePhone Daily Driver with Arch Linux

Components

Setup

Configs are stored in a repository.

TODO: Create a package for people to use and install easily

Power Management

  • backlight off and CPU sleep when screen is locked via power button
  • handled via PinePhone-Toolkit

sudo

Add NOPASSWD for shutdown and reboot to wheel group:

visudo%wheel ALL=(ALL) ALL %wheel ALL=(ALL) NOPASSWD: /sbin/poweroff,/sbin/reboot

elogind

Power key needs to be locked from elogind, otherwise it would shutdown the system. This way as long as the UI session is running, power button is ignored by elogind. Once the session ends and we're back in the login screen, the power button is again able to shutdown the system.

/usr/share/wayland-sessions/sway.desktop... Exec=elogind-inhibit --what=handle-power-key --mode=block dbus-run-session /usr/bin/sway ... (included in the POC repository)

SwayWM

(config included in the POC repository)

waybar

(config included in the POC repository)

  • Pick a theme! Mine is: [1]
  • [i] For clock module, don't forget to set the locale and timezone parameters, otherwise nothing will show up.

lisgd

sxmo#lisgd reconfigured through command line parameters in SwayWM config.

(config included in the POC repository)

PinePhone-Toolkit

Used mainly in SwayWM config.

Bluetooth

  • Enable the service on boot: rc-update add bluetooth
  • Enable the controller by default:

/etc/bluetooth/main.conf[Policy] AutoEnable=true

TODOs

TODO: Complete these TODOs!

  1. power saving (so that I can leave the battery in the device when I'm not using it)
    1. hibernation / suspend command - needs crust support in pmos: issue 550
    2. shortcut to enter suspend
      • [i] rtcwake -m mem -s 10 ... does not resume operation after issuing s2idle
  2. Core UI
    • Display rotation
      • Vertical waybar - hide/show based on output transformation/waybar-window size [2]
  3. Install and test essential apps & workflows
    1. Terminal: termite
    2. Web browser: Firefox
      • Mostly works. Portrait mode doesn't fit perfectly. Clunky UI, some menus overflow.
    3. Passwords manager: KeepassXC)
      • Doesn't support such a small screen. Modify and submit a PR?
    4. Personal Information Manager with WebDAV sync support for calendar, contacts
    5. Email client: thunderbird
      • Doesn't support such a small screen. Modify and submit a PR?
    6. Calculator: galculator
    7. Alarm: ?
    8. IM clients
      • XMPP: ?
      • Matrix: ?
      • Slack: ?
    9. Music player: audacious
      • A few problems with the small screen. Otherwise seems to work.
    10. Camera & Video recorder: ?
    11. VPN client: NetworkManager?
  4. Support for non-essential apps & workflows
    • RSS client: ?
    • OTP generator: ?
    • Ebook reader: ?
    • Weather forecast: ?
    • Maps, navigation: ?
    • Calls & Texts: ?
    • Samba share mounted from NAS
      • CIFS is not supported by the kernel right now
  5. Tweaking
  6. non-essential userspace apps
    • ...
  7. cool stuff
    • presentation mode [4]
    • night mode: flux / nightlight / redshift / ...
    • automated brightness based on screen content [5]

Rejected solutions

under Wayland