User:Fdelamotte/dogfooding

I'd like to share on this page my workarounds configurations in using sxmo on the pinephone and oneplus6t

Screen Scaling
My own personal taste : I prefer using native resolution on my devices, setting SXMO_SWAY_SCALE to 1 in my profile.

I then configure my apps individually (or the toolkits) to show correctly on my phone.

It works well with SDL and QT, which provides an environment variable to set things up. As well as terminal applications. It is more painfull with GTK/Gnome apps, as a result, I currently have a preference for QT apps (I still love eog and evince).

As a workaround to be able to click on buttons, I have set min-width and min-height to 64px in gtk.css ...

I am thinking about patching cage to support scaling and launch the apps inside of a cage ;)

Gestures
I have configured lots of gestures (using lisgd) for the programs I use. First I've added some gestures to the vocabulary (mainly swiping out from the corners). I have then heavily modified sxmo_hooks_inputhandler.sh.

One the oneplus6, I also found a need to increase edgesize (by recompiling lisgd). Because of the rounded corners, corner swipes were difficult to trigger.

New gestures
$ diff /usr/share/sxmo/default_hooks/sxmo_hook_lisgdstart.sh sxmo_hook_lisgdstart.sh 31a35,38 > 	-g "1,DRUL,TL,*,setsid -f sxmo_hook_inputhandler.sh topleftout" \ > 	-g "1,DLUR,TR,*,setsid -f sxmo_hook_inputhandler.sh toprightout" \ > 	-g "1,ULDR,BR,*,setsid -f sxmo_hook_inputhandler.sh bottomrightout" \ > 	-g "1,URDL,BL,*,setsid -f sxmo_hook_inputhandler.sh bottomleftout" \ 44a52 > 	-g "2,DU,T,*,setsid -f sxmo_hook_inputhandler.sh twouptopedge" \ 45a54 > 	-g "2,DU,B,*,setsid -f sxmo_hook_inputhandler.sh twoupbottomedge" \

Global actions
Swipe left to adjust volume has been disabled.

"upleftedge")       exit 0        ;;    "downleftedge") exit 0 ;;
 * 1)       sxmo_audio.sh vol up &
 * 1)       sxmo_audio.sh vol down &

Swipes in from top show up menus :
 * top-left brings system menu
 * top-right brings apps menu
 * top-center brings application menu (menu for the current application)
 * two-fingers top-center brings the notification menu if there are pending notifications

"topleftcorner")       sxmo_appmenu.sh sys &        exit 0                                                                                                                                                                                         ;;    "toprightcorner") sxmo_appmenu.sh applications & exit 0 ;;   "twodowntopedge")        NNOTIFICATIONS="$(find "$SXMO_NOTIFDIR" -type f | wc -l)"        if [ "$NNOTIFICATIONS" -gt 0 ]; then            sxmo_notificationsmenu.sh &        else            sxmo_dmenu.sh isopen || sxmo_appmenu.sh sys &        fi         exit 0        ;;    "downtopedge") sxmo_dmenu.sh isopen || sxmo_appmenu.sh & exit 0 ;;

Swipe in from bottom left toggles fullscreen, swipe in from bottom right changes screen orientation :

"bottomleftcorner")       swaymsg fullscreen        exit 0        ;;    "bottomrightcorner") sxmo_rotate.sh & exit 0 ;;

Power button triggers terminal with a smaller font (80 char width) and the keyboard (launching the terminal from the appmenu triggers it with default font size, which on my setup is set to 26).

"powerbutton_three")       sxmo_keyboard.sh open        sxmo_terminal.sh -f 'dejavu sans mono:size=16'        exit 0        ;;

Closing via VolumeDown also closes the keyboard

"voldown_three")       sxmo_killwindow.sh        sxmo_keyboard.sh close        exit        ;;

Generic actions for terminal
Generic actions have been modified, mainly for zooming and scrolling.

Zoom is performed with a swipe (up/down) on the left border, and scroll on the right border.

When scrolling is possible in a text program (gomuks, aerc, less) the action will be overriden.

Up and Down keys have been remapped to up and down swipes.

I also swipe out to top and corner to send CTRL+D and CTRL+C.

# Now we try generic actions for terminal case "$ACTION" in           *"onedown")                sxmo_type.sh -k Down                exit 0                ;;               *"oneup") sxmo_type.sh -k Up               exit 0 ;;              "uprightedge")                sxmo_type.sh -M Shift -k Page_Up                exit 0                ;;               "downrightedge") sxmo_type.sh -M Shift -k Page_Down exit 0 ;;              "uptopedge")                sxmo_type.sh -M ctrl d -m ctrl                exit 0                ;;               "bottomrightout") sxmo_type.sh -k Return exit 0 ;;              "bottomleftout")                sxmo_type.sh -k Backspace                exit 0                ;;               "topleftout") sxmo_type.sh -M Ctrl c -m Ctrl exit 0 ;;              "downleftedge")                sxmo_type.sh -M Ctrl -k Minus                exit 0                ;;               "upleftedge") sxmo_type.sh -M Ctrl -k Plus exit 0 ;;              esac

Configuration for TUI apps
TUI applications have their own gestures. But to be correctly identified, they must be launched with $WMNAME correctly set, I do that using an alias for the applications that calls a script called tname. echo -en "\033]0;$1\a"
 * 1) !/bin/sh

Applications
I'll try to cover applications I use and how I've configured and use them.

First let's introduce my appmenu, since it shows the apps I call frequently, here is a dump of sxmo_hook_apps.sh.

write_line_app bemenu-run "$icon_cfg Run" "sxmo_keyboard.sh open & bemenu-run -p run" write_line_app foot "$icon_trm Terminal" "sxmo_keyboard.sh open;foot $SHELL" write_line_app index "$icon_dir Files" "index" write_line_app aerc "$icon_eml Mail" "sxmo_keyboard.sh open;sxmo_terminal.sh -T aerc -f 'DejaVuSansMono:size=14' aerc" write_line_app nheko "$icon_msg Matrix" "nheko" write_line_app qutebrowser "$icon_glb Web browser" "qutebrowser" write_line_app mepo "$icon_map Maps" "mepo" write_line_app buho "$icon_edt Notes" "buho" write_line_app speedcrunch "$icon_clc	Calculator" "speedcrunch" write_line_app sxmo_wttr.sh "$icon_wtr Forecast" "sxmo_wttr.sh" write_line_app sxmo_khal.sh "$icon_cal Calendar" "sxmo_khal.sh" write_line_app vvave "$icon_mus Music Player" "vvave" write_line_app pavucontrol "$icon_spk Mixer" "pavucontrol" write_line_app gnome-sound-recorder "$icon_mic Recorder" "gnome-sound-recorder" write_line_app vlc "$icon_mvi Media Player" "vlc" write_line_app kasts "$icon_rss Podcasts" "kasts" write_line_app waydroid "$icon_and Waydroid" "sxmo_keyboard.sh close; waydroid show-full-ui"

While some TUI apps are called from the menu (aerc for mails), I sometimes prefer launching some programs directly from the terminal.

Web browsing
I have both firefox and qutebrowser installed. But my main browser is qutebrowser, I find it efficient and to get it better I use custom gestures with it.


 * a swipe out from the top (uptopedge) closes current tab with d
 * a swipe out from the top left corner (topleftout) sends q to close the window
 * a swipe out from the top right corner asks for an url to open in a new window (and opens keyboard)
 * a swipe out from the bottom right corner asks for an url to open in current window (and opens keyboard)
 * swipe out left goes back in history
 * swipe out bottom-left goes forth (because I've remaped swipe right and didn't use it too much)
 * swipe out right is used to send enter and close keyboard at the same time (saves some moves ...)
 * swipes up/down on the left edge zooms in and out

Key bindings have been set-up accordingly in qutebrowser (which configuration is shared with my laptop) so < > and q are defined keys.

*qutebrowser*)       case "$ACTION" in            "uptopedge") sxmo_type.sh -k Escape -s 300 'd'               exit 0 ;;           "uprightedge")                exit 0                ;;            "downrightedge") exit 0 ;;           "toprightout")                sxmo_type.sh -k Escape -s 300 'wo'                sxmo_keyboard.sh open                exit 0                ;;            "topleftout") sxmo_type.sh -k Escape -s 300 'q'               exit 0 ;;           "bottomleftout")                sxmo_type.sh -k Escape -s 300 '>'                exit 0                ;;            "bottomrightout") sxmo_type.sh -k Escape -s 300 'o'               sxmo_keyboard.sh open exit 0 ;;           "leftrightedge_short")                sxmo_type.sh -k Escape -s 300 '<'                exit 0                ;;            "rightrightedge_short") sxmo_type.sh -k Return sxmo_keyboard.sh close exit 0 ;;           "leftbottomedge")                sxmo_type.sh -k Minus                exit 0                ;;            "rightbottomedge") sxmo_type.sh -k Plus exit 0 ;;           "upleftedge")                sxmo_type.sh -k Plus                exit 0                ;;            "downleftedge") sxmo_type.sh -k Minus exit 0 ;;           "bottomleftcorner")                sxmo_type.sh -k F11                exit 0                ;;        esac             ;;

Mail
For reading and writing mails I use aerc, with a small font.

Some gestures have been configured in lisgd :

*aerc*)                     case "$ACTION" in                    "toprightout") sxmo_type.sh t                       exit 0 ;;                   "uptopedge")                        sxmo_type.sh q                        exit 0                        ;;                    "uprightedge") sxmo_type.sh -k Page_Up exit 0 ;;                   "downrightedge")                        sxmo_type.sh -k Page_Down                        exit 0                        ;;                esac                     ;;

Matrix client
I use Nheko and gomuks.

Nheko already has settings for touch use and I enable them.

I have only assigned a swipe out from top edge to quit the program throug CTRL+Q

*nheko*)             case "$ACTION" in            "uptopedge") sxmo_type.sh -M Ctrl -k q -m Ctrl exit 0 ;;       esac ;;

I launch gomuks from the terminal using the gmk alias : alias gmk='tname gomuks;gomuks', then I have the following gestures configured in lisgd :

*gomuks*)               case "$ACTION" in                    "uptopedge") sxmo_type.sh '/quit' -k Return exit 0 ;;                   *"oneleft")                        sxmo_type.sh -M Ctrl -k Up                        exit 0                        ;;                    *"oneright") sxmo_type.sh -M Ctrl -k Down exit 0 ;;                   "leftrightedge_short")                        sxmo_type.sh '/toggle rooms' -k Return                        exit 0                        ;;                    "rightrightedge_short") sxmo_type.sh '/toggle users' -k Return exit 0 ;;                   "bottomleftout")                        sxmo_type.sh -M Ctrl k                        exit 0                        ;;                    "uprightedge") sxmo_type.sh -k Page_Up exit 0 ;;                   "downrightedge")                        sxmo_type.sh -k Page_Down                        exit 0                        ;;                esac                                                                                                                           ;;

Main gestures are :


 * swipe out from top left corner quits gomuks
 * swipe left and right change room
 * swipe out from left and write toggles the rooms and users lists

Calculator
I do use bc a lot, but also speedcrunch. I had to disable completion because it doesn't work well with the onscreen keyboard and defined a gesture to bring in/out the application own keyboard (with two finger swipes).

*speedcrunch*)          case "$ACTION" in            "twodownbottomedge") sxmo_type.sh -M Ctrl -k k -m Ctrl exit 0 ;;              "twoupbottomedge")                sxmo_type.sh -M Ctrl -k k -m Ctrl                exit 0                  ;;               "uptopedge") sxmo_type.sh -M Ctrl -k q -m Ctrl exit 0 ;;       esac ;;

Waydroid
I currently don't have it installed (as I didn't really find applications I miss from Android). But I tested it and kept some configurations.

Waydroid was set to add some vertical padding using this command : waydroid prop set persist.waydroid.height_padding 80 (think it was 80) Pixel density was set to 320 in waydroid_base.prop : ro.sf.lcd_density=320

I also had some convenient gestures to close the window or terminate the session :

*waydroid*)               case "$ACTION" in             "bottomrightout") sxmo_killwindow.sh               exit 0 ;;                "bottomleftout")                sxmo_killwindow.sh                exit 0                  ;;                 "uptopedge") waydroid session stop exit 0 ;;            esac ;;