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

From Dejvino's Knowledge Base
Jump to navigation Jump to search
(Created page with "Implementation of Projects:PinePhone Daily Driver using swayWM. {{Warning|Currently discontinued. Using swayWM (Wayland) proved too hard for now due to proble...")
 
Line 1: Line 1:
 
Implementation of [[Projects:PinePhone Daily Driver]] using [[swayWM]].
 
Implementation of [[Projects:PinePhone Daily Driver]] using [[swayWM]].
 
{{Warning|Currently discontinued. Using [[swayWM]] ([[Wayland]]) proved too hard for now due to problematic on-screen keyboard and gestures detection.}}
 
 
{{Todo|Try this again after some time...}}
 
  
 
=== Components ===
 
=== Components ===
Line 9: Line 5:
 
* [[swayWM]] for UI
 
* [[swayWM]] for UI
 
* System packages:
 
* System packages:
** [[networkmanager]]
+
** ...
** [[termite]], termite-terminfo
+
{{todo|Add components}}
** [[bluez]]
 
** [[squeekboard]], gsettings-desktop-schemas
 
** {{todo|1=alsa-utils (to unmute speaker via {{code|1=alsamixer}} and then save as default via {{code|1=alsactl store}})}}
 
** {{todo|1=gestures}}
 
* App packages:
 
** [[vim]]
 
** [[firefox]]
 
  
 
=== Setup ===
 
=== Setup ===
{{IconWarn}} '''Warning:''' serial console is required to properly setup the device with [[swayWM]] since there is no touch controls by default.
+
{{Todo|Move some of this setup into a repository}}
 +
 
 +
==== lisgd ====
 +
{{codeblock|title=~/build/lisgd/lisgd.h|1=
 +
/* Commands to execute upon recieving a swipe gesture */
 +
Gesture gestures[] = {
 +
        /* fingers      start  end    command */
 +
        { 1,    Left,  Right,    "swaymsg workspace prev" },
 +
        { 1,    Right,  Left,    "swaymsg workspace next" },
 +
 
 +
        { 2,    Left,  Right,    "xdotool key --clearmodifiers Alt+e" },
 +
        { 2,    Right,  Left,    "xdotool key --clearmodifiers Alt+r" },
 +
 
 +
        { 2,    Down,  Up,      "swayphone_keyboard_show" },
 +
        { 2,    Up,    Down,    "swayphone_keyboard_hide" },
  
{{Todo|Move some of this setup into a repository}}
+
        { 3,    Down,  Up,      "sxmo_vol.sh up" },
 +
        { 3,    Up,    Down,    "sxmo_vol.sh down" },
 +
 
 +
        { 4,    Down,  Up,      "sxmo_brightness.sh up" },
 +
        { 4,    Up,    Down,    "sxmo_brightness.sh down" },
 +
};}}
 +
{{todo|Finish updating this}}
 +
 
 +
{{codeblock|1=# TODO: cloning  and building the app
 +
cp ~/build/lisgd/lisgd /usr/local/bin/lisgd}}
  
 
==== [[swayWM]] ====
 
==== [[swayWM]] ====
 
# Copy {{code|1=/etc/sway/config}} to {{code|1=~/.config/sway/config}}
 
# Copy {{code|1=/etc/sway/config}} to {{code|1=~/.config/sway/config}}
 
# Edit:
 
# Edit:
#* {{code|1=$term termite}}
+
{{codeblock|title=~/.config/sway/config|1=
 +
# Logo key. Use Mod1 for Alt.
 +
set $mod Mod1
 +
[...]
 +
# Your preferred terminal emulator
 +
set $term termite
 +
[...]
 +
# Your preferred application launcher
 +
set $menu bemenu-run | xargs swaymsg exec --
 +
[...]
 +
  # Kill focused window
 +
    bindsym $mod+q kill
 +
[...]
 +
# Default scaling for the touchscreen
 +
output DSI-1 scale 2
 +
 
 +
# Initial utility apps
 +
exec squeekboard
 +
exec lisgd}}
  
 
==== [[Bluetooth]] ====
 
==== [[Bluetooth]] ====

Revision as of 22:58, 24 May 2020

Implementation of Projects:PinePhone Daily Driver using swayWM.

Components

TODO: Add components

Setup

TODO: Move some of this setup into a repository

lisgd

~/build/lisgd/lisgd.h/* Commands to execute upon recieving a swipe gesture */ Gesture gestures[] = {

       /* fingers      start   end     command */
       { 1,    Left,   Right,    "swaymsg workspace prev" },
       { 1,    Right,  Left,     "swaymsg workspace next" },
       { 2,    Left,   Right,    "xdotool key --clearmodifiers Alt+e" },
       { 2,    Right,  Left,     "xdotool key --clearmodifiers Alt+r" },
       { 2,    Down,   Up,       "swayphone_keyboard_show" },
       { 2,    Up,     Down,     "swayphone_keyboard_hide" },
       { 3,    Down,   Up,       "sxmo_vol.sh up" },
       { 3,    Up,     Down,     "sxmo_vol.sh down" },
       { 4,    Down,   Up,       "sxmo_brightness.sh up" },
       { 4,    Up,     Down,     "sxmo_brightness.sh down" },

}; TODO: Finish updating this

# TODO: cloning and building the app cp ~/build/lisgd/lisgd /usr/local/bin/lisgd

swayWM

  1. Copy /etc/sway/config to ~/.config/sway/config
  2. Edit:

~/.config/sway/config xargs swaymsg exec -- [...]

  # Kill focused window
   bindsym $mod+q kill

[...]

  1. Default scaling for the touchscreen

output DSI-1 scale 2

  1. Initial utility apps

exec squeekboard exec lisgd

Bluetooth

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

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

TODOs

  • TODO: Touch gestures and controls
    • Custom input device? [1]
  • TODO: Configure Firefox for touch: [2]
  • TODO: Sound, alsa
  • TODO: squeekboard virtual keyboard
  • TODO: acpi for battery monitoring

Rejected solutions

under Wayland