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

From Dejvino's Knowledge Base
Jump to navigation Jump to search
Line 24: Line 24:
 
{{todo|Convert the following to command line parameters + make it a script:}}
 
{{todo|Convert the following to command line parameters + make it a script:}}
  
{{codeblock|title=~/build/lisgd/lisgd.h|1=
+
{{codeblock|title=swayphone-lisgd|1=#!/bin/bash
/* 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" },
+
lisgd \
        { 2,   Right, Left,     "xdotool key --clearmodifiers Alt+r" },
+
-g "1,l,r, false" \
 
+
-g "1,r,l, false" \
        { 2,   Down,   Up,       "swayphone_keyboard_show" },
+
-g "1,u,d, false" \
        { 2,   Up,     Down,     "swayphone_keyboard_hide" },
+
-g "1,d,u, false" \
 
+
-g "2,l,r, swaymsg workspace prev" \
        { 3,   Down,   Up,       "sxmo_vol.sh up" },
+
-g "2,r,l, swaymsg workspace next" \
        { 3,   Up,     Down,     "sxmo_vol.sh down" },
+
-g "2,u,d, swaymsg exec swayphone_keyboard_hide" \
 
+
-g "2,d,u, swaymsg exec swayphone_keyboard_show" \
        { 4,   Down,   Up,       "sxmo_brightness.sh up" },
+
-g "3,l,r, swaymsg focus right" \
        { 4,   Up,     Down,     "sxmo_brightness.sh down" },
+
-g "3,r,l, swaymsg focus left" \
};}}
+
-g "3,u,d, swaymsg focus down" \
 +
-g "3,d,u, swaymsg focus up" \
 +
-g "4,l,r, swaymsg move right" \
 +
-g "4,r,l, swaymsg move left" \
 +
-g "4,u,d, swaymsg move down" \
 +
-g "4,d,u, swaymsg move up" \
 +
-v
 +
}}
  
 
=== [[swayWM]] ===
 
=== [[swayWM]] ===
Line 92: Line 94:
 
#* [[sxmo#lisgd]] {{todo|command line setup, compilation and install from the POC repo}}
 
#* [[sxmo#lisgd]] {{todo|command line setup, compilation and install from the POC repo}}
 
#* Custom input device? [https://python-evdev.readthedocs.io/en/latest/tutorial.html]
 
#* Custom input device? [https://python-evdev.readthedocs.io/en/latest/tutorial.html]
 +
#* Wayland touch [https://wayland-book.com/seat/touch.html]
 
#* keyboard - layout to default to Terminal
 
#* keyboard - layout to default to Terminal
 
# Sound
 
# Sound

Revision as of 19:41, 27 May 2020

Implementation of Projects:PinePhone Daily Driver using swayWM.

Components

Setup

Configs are stored in a repository.

TODO: Create a postmarketOS package? [1]

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)

lisgd

TODO: Convert the following to command line parameters + make it a script:

swayphone-lisgd#!/bin/bash

lisgd \

-g "1,l,r, false" \
-g "1,r,l, false" \
-g "1,u,d, false" \
-g "1,d,u, false" \
-g "2,l,r, swaymsg workspace prev" \
-g "2,r,l, swaymsg workspace next" \
-g "2,u,d, swaymsg exec swayphone_keyboard_hide" \
-g "2,d,u, swaymsg exec swayphone_keyboard_show" \
-g "3,l,r, swaymsg focus right" \
-g "3,r,l, swaymsg focus left" \
-g "3,u,d, swaymsg focus down" \
-g "3,d,u, swaymsg focus up" \
-g "4,l,r, swaymsg move right" \
-g "4,r,l, swaymsg move left" \
-g "4,u,d, swaymsg move down" \
-g "4,d,u, swaymsg move up" \
-v

swayWM

(config included in the POC repository)

waybar

(config included in the POC repository)

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

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)
    • hibernation / suspend command
    • shortcut to enter suspend
    • [i] rtcwake -m mem -s 10
  2. Install and test essential apps & workflows
    1. Terminal: termite
    2. Web browser: Firefox
    3. Passwords manager: KeepassXC)
    4. Personal Information Manager with WebDAV sync support for calendar, contacts
    5. Email client: thunderbird
    6. Calculator: galculator
    7. Alarm: ?
    8. IM clients
      • XMPP: ?
      • Matrix: ?
      • Slack: ?
    9. Music player: audacious
    10. Camera & Video recorder: ?
    11. VPN client: NetworkManager?
  3. Support for non-essential apps & workflows
    • RSS client: ?
    • OTP generator: ?
    • Ebook reader: ?
    • Weather forecast: ?
    • Maps, navigation: ?
    • Calls & Texts: ?
  4. Touch gestures and controls
    • sxmo#lisgd TODO: command line setup, compilation and install from the POC repo
    • Custom input device? [3]
    • Wayland touch [4]
    • keyboard - layout to default to Terminal
  5. Sound
  6. tweaking
    • Configure Firefox for touch: [6]?
    • acpi for battery monitoring?
    • ...
  7. non-essential userspace apps
    • ...
  8. cool stuff
    • presentation mode [7]

Rejected solutions

under Wayland