Jump to content

Sxmo/Tips and Tricks: Difference between revisions

From postmarketOS Wiki
Tags: mobile edit mobile web edit
Magdesign (talk | contribs)
 
(110 intermediate revisions by 13 users not shown)
Line 1: Line 1:
 
{{Subpages|Sxmo}}
Here is a growing list of tips, tricks and configuration snippets for using [[Sxmo]].  
Here is a growing list of tips, tricks and configuration snippets for using [[Sxmo]].  


This pages is intended to focus mostly on "non-core" issues, such as running apps and everyday usability. The core configuration issues should end up in [https://sxmo.org/docs/USERGUIDE.html sxmo doc], as discussed on https://todo.sr.ht/~mil/sxmo-tickets/275
This pages is intended to focus mostly on "non-core" issues, such as running apps and everyday usability. The core configuration issues should end up in [https://sxmo.org/docs/ sxmo doc], as discussed on https://todo.sr.ht/~mil/sxmo-tickets/275




== Calls, SMS, Modem ==
== Calls, SMS, Modem ==
See [https://wiki.postmarketos.org/wiki/Sxmo/How_incoming_calls_work this writeup] to understand how calling works.


=== Sometimes Modem gets stuck ===
=== Sometimes Modem gets stuck ===
Line 15: Line 17:
Reliable solution: reboot.
Reliable solution: reboot.


=== Sometimes SMS dont get sent/received ===
=== Sometimes SMS messages aren't sent/received ===


The latest biktorgj firmware (0.5.3) should address this situation.  Alternatively, check for stuck sms and delete them:
The latest biktorgj firmware (0.5.3) should address this situation.  Alternatively, check for stuck sms and delete them:
Line 29: Line 31:
<code>
<code>
cat mysupersmsfile | sxmo_modemsendsms.sh +33123123123 -
cat mysupersmsfile | sxmo_modemsendsms.sh +33123123123 -
</code>
=== Where to Delete SMS ===
<code>
.local/share/sxmo/modem/<sender>/sms.txt
</code>
</code>


Line 46: Line 53:


<code>mmcli -i any --pin=1010 --disable-pin</code>
<code>mmcli -i any --pin=1010 --disable-pin</code>
=== How to activate data ===
In menu under ''Networks'' select ''Add a GSM''. Enter the APN settings for your carrier.
find a list
[https://wiki.pine64.org/wiki/PinePhone_APN_Settings here].
=== How to find Operator Name and other Infos ===
<code>mmcli -m any</code>
=== How to enable Roaming ===
This is not clear yet.
Test if roaming is enabled with:  <code>mmcli --modem=0 --bearer=0</code>
Edit the .connection file and add: <code>allow-roaming=true</code>
since v1.20 its called
'''MMBearerRoamingAllowance'''
see more info [https://www.freedesktop.org/software/ModemManager/doc/latest/ModemManager/ModemManager-Flags-and-Enumerations.html#MMBearerRoamingAllowance here]. We should really solve this puzzle.


=== How to send USSD ===
=== How to send USSD ===
Line 52: Line 82:


<code>mmcli -m any --3gpp-ussd-initiate="*100#"</code>
<code>mmcli -m any --3gpp-ussd-initiate="*100#"</code>


=== How to send AT command ===
=== How to send AT command ===
Line 75: Line 104:
=== Retrieving signal strength information ===
=== Retrieving signal strength information ===


See https://wiki.postmarketos.org/wiki/Modem#ModemManager
See [https://wiki.postmarketos.org/wiki/Modem#ModemManager, here.]
 
=== Block Numbers ===
 
create:
 
<pre>
~/.config/sxmo/block.tsv
</pre>
 
and add the numbers to block:  blockedcontactnumber TAB blockedcontactname
 
there will be no notifications


=== Create contacts.tsv for Sxmo from Android data ===
=== Create contacts.tsv from Android data ===


This assumes you have developer mode enabled on your phone and usb debugging using adb.
This assumes you have developer mode enabled on your phone and usb debugging using adb.
Line 108: Line 149:
</code>
</code>


=== Create contacts.tsv for Sxmo from a vcard export ( vcf export from nextcloud for example ) ===
=== Create contacts.tsv from vcard export (e.g. vcf export from nextcloud) ===


We can convert an export in vcard format of a contact list to a file sxmo can work with with the following commands:
We can convert an export in vcard format of a contact list to a file, work with with the following commands:


<code>
<code>
Line 116: Line 157:
</code>
</code>


Put the vcard export you downloaded in the same directory as the convert.py script, name it contacts.vcf
Put the downloaded vcard export into the same directory as the <code>convert.py</code> script and name it <code>contacts.vcf</code>
Look at README.md if you want to change the default behaviour of the convert script.
 
See README.md to change the default behaviour of the convert script.


<code>
<code>
Line 124: Line 166:


== General configuration ==
== General configuration ==
=== Set Darkmode ===
'''For Gnome apps:'''
<code>
gsettings set org.gnome.desktop.interface color-scheme prefer-dark
</code>
'''For Kde plasma-mobile apps:'''
<code>
sudo apk add plasma-integration
sudo apk add qqc2-breeze-style
</code>
Get the style file [https://web.archive.org/web/20240717015119/https://gist.github.com/magdesign/3e19899aa85dfb416802a0c6bcf3e08c here].
Move it to where it belongs:
<code>
mv kdeglobals ~/.config
</code>
Now we need to set the environment variables (not sure if we need this, pasted once into terminal):
<code>
QT_QUICK_CONTROLS_STYLE=org.kde.breeze
QT_QPA_PLATFORMTHEME=kde
</code>
'''For Flatpaks'''
some flatpaks just refuse to run in dark mode, edit the launcher of each flatpak to contain the dark theme like this:
<pre>flatpak run --env=GTK_THEME=Adwaita-dark org.gnome.Fractal</pre>
'''GTK Apps'''
can be forced with a prefix:
<pre>
GTK_THEME=Adwaita:dark application
</pre>
=== How change idle/suspend time ===
Add with your time in seconds:
<pre>
export SXMO_UNLOCK_IDLE_TIME="30"
</pre>
in
<code>~/.config/sxmo/profile </code>
=== How to display the percentage of battery ===
along with the icon in the '''status bar''',
add:
<pre>
export SXMO_BAR_SHOW_BAT_PER=1
</pre>
in <code>~/.config/sxmo/profile </code>
on the '''homescreen''',
add:
<pre>
${alignc}${font goto:size=22:style=Bold}${exec echo "Power: "}${exec upower -d | grep -m1 'percentage:' | awk '{print $2}'}
</pre>
in <code>~/.config/sxmo/conky.conf </code>


=== How to easily change the size of the text, system-wide? ===
=== How to easily change the size of the text, system-wide? ===
Line 152: Line 266:




=== How to activate data ===
To see a list of possible options for KEYBOARD_ARGS, enter:
 
<code>
wvkbd-mobintl --help
</code>
 
 
Possible keyboard layouts for option <code>-l</code> are: Full, Special, Emoji, Simple, SimpleGrid, Nav, Dialer, Cyrillic, Arabic, Persian, Greek, and Georgian.
 
=== How to type Umlauts & Special Keys ===
 
'''Umlauts:''' <code>Cmp</code> followed by the according letter.
 
e.g.
'''ä''' => <code>AGr</code> + <code>a</code>
 
 
'''F keys''' with <code>AGr-N</code>
 
e.g.
<code>F10</code> => <code>AGr</code> + <code>0</code>
(F11 + F12 don't exist)
 
 
'''€''' => <code>AGr</code> + <code>-</code>
 
'''£''' => <code>AGr</code> + <code>=</code>
 
=== How to change the size of the virtual keyboard? ===


In menu under Networks select 'Add a GSM'.
edit KEYBOARD_ARGS in your ~/.config/sxmo/profile and add "-H <height>" to change the portrait height, "-L <height>" to change the landscape height.


=== How to launch programms on startup? ===
=== How to launch programms on startup? ===


If you run dwm, then edit ~/.config/sxmo/xinitIf you run sway, then edit ~/.config/sxmo/sway.  In either case, you can also copy over /usr/share/sxmo/default_hooks/start to ~/.config/sxmo/hooks/start and edit that file. NOTE: Make sure you chmod +x ~/.config/smxo/hooks/start.
If you run dwm, edit:
 
<pre>~/.config/sxmo/xinit </pre>
 
If you run sway, edit:
 
<code>~/.config/sxmo/sway </code>
 
Instead, you can also copy  
 
<code>cp /usr/share/sxmo/default_hooks/start ~/.config/sxmo/hooks/start</code> and edit that file.  
 
NOTE:
 
Make sure to make it executable
<code> chmod +x ~/.config/smxo/hooks/start </code>
 
=== How to set screen brightness on start ===
 
add:
 
<code>/usr/bin/sxmo_brightness.sh setvalue 50
</code>
 
to the bottom of:
 
<code>/usr/share/sxmo/default_hooks/s
xmo_hook_start.sh</code>


=== mount /tmp/ in RAM, to save write cycles on storage device===
=== mount /tmp/ in RAM, to save write cycles on storage device===
Line 207: Line 376:




=== A simple way to share sxmo's connection through USB (aka "USB tethering") ===
=== A simple way to share Internet through USB (aka "USB tethering") ===


Select 'Networks' in the menu and add a USB hotspot.
Select 'Networks' in the menu and add a USB hotspot.
On your connecting device, you may need to configure IPv4 configuration Manually, as your pmOS device is not going to act as a DHCP server by default.
Set "Addresses" to 10.42.0.2/24, and set Gateway to 10.42.0.1 (which is your pmOS device's address). If you're running DNSmasq, you may also use that for DNS server, otherwise set DNS server to your favorite server.


=== Where can i read logs for sxmo? ===
=== Where can i read logs for sxmo? ===
Line 220: Line 392:
or
or
<code>logread -f</code> for the generic pmOS log, that also displays some of sxmo deamons (modemmanager, etc.) information
<code>logread -f</code> for the generic pmOS log, that also displays some of sxmo deamons (modemmanager, etc.) information
=== Move sxmo's bar below your phone's notch ===
Find the bar entry in <code>~/.config/sxmo/sway</code> and add a gaps configuration to it.
<code> bar { gaps 42 0 } </code>
See https://todo.sr.ht/~mil/sxmo-tickets/494 and https://man.archlinux.org/man/sway-bar.5.en
=== Working around the Notch ===
'''By filling in some useless items in the notch area'''.
If not already done,
<pre>cp /usr/share/sxmo/default_hooks/sxmo_hook_statusbar.sh ~/.config/sxmo/hooks/</pre>
then add a few ooooo between the battery and the wifi symbol just above the line containing
<pre>sxmobar -a -f "$fgcolor" -b "$bgcolor" -t "$style" \</pre>
with adding this line to the hook:
<pre>sxmobar -a notch 22 oooooooooo</pre>
Then disable tray icons in swaybar:
<code>
nano ~/.config/sxmo/sway
</code>
Scroll down to the
<code>Status Bar:</code>
section and just below <code>position top</code>
add
<code>
tray_output none
</code>
Then reboot and enjoy.
=== LED blinking not working with feedbackd ===
When <code>postmarketos-default-camera</code> is installed, it adds a udev rule that changes ownership of the LED devices to the <code>feedbackd</code> group. This means the default user won't have permissions to use the LEDs on a clean install. This only occurs on devices with a working camera (i.e. PinePhone).
The simplest workaround is to add your user to the <code>feedbackd</code> group:
<pre>
sudo adduser $(whoami) feedbackd
</pre>
An alternative option is to add a udev rule to override this behavior.
Create the file <code>/etc/udev/rules.d/99-sxmo-led.rules</code> with the following contents:
<pre>
ACTION=="add|change", SUBSYSTEM=="leds", DEVPATH=="*/*:status", RUN+="/bin/chgrp input /sys$devpath/brightness  /sys$devpath/pattern /sys$devpath/repeat"
ACTION=="add|change", SUBSYSTEM=="leds", DEVPATH=="*/*:indicator", RUN+="/bin/chgrp input /sys$devpath/brightness  /sys$devpath/pattern /sys$devpath/repeat"
</pre>
This was discussed in this mr https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/4758 and there were not any ideal solutions discovered.


== Applications specific ==
== Applications specific ==


=== What to use for cartography/navigation? ===
=== Set default applications ===
e.g. Define which app opens images:
 
<code>sudo nano mimeapps.list </code>
 
edit:
 
<code>
image/png=loupe.desktop
 
image/jpg=loupe.desktop
</code>
 
make sure you create a desktopfile for loupe in:
 
<code>
nano ~/.local/share/applications/loupe.desktop
</code>
 
containing:
 
<pre>
Desktop Entry]
Type=Application
Terminal=false
Exec=/usr/bin/loupe
Name=loupe
MimeType=image/png;image/jpg
</pre>
 
=== Osmin, Pure-Maps, Mepo ===
To use navigation properly, first enable GPS:
 
<pre>
mmcli -m any --location-enable-gps-nmea
mmcli -m any --location-enable-gps-raw
mmcli -m any --location-get
 
/usr/libexec/geoclue-2.0/demos/agent  > /dev/null 2>&1 &
</pre>


osmin works well. gps can be used with the package geoclue and running
[https://codeberg.org/magdesign/sxmop6/src/branch/main/userscripts/gps_enable.sh get userscript here].
<code> /usr/libexec/geoclue-2.0/demos/agent </code>.


Pure-maps sort of works (using OpenTopo or Sputnik tiles), as well as Marble (QT/KDE, heavy...). Unsure yet how to make the GPS work for both of these, but it has reported being feasible...
In the time of writing, you need to have a sim card inserted, but you can manually compile a [https://wiki.postmarketos.org/wiki/User:Magdesign#ModemManager newer modemmanager] and [https://wiki.postmarketos.org/wiki/User:Magdesign#Location_without_Sim enable gnss] to have gps without sim.


Apparently a good start to enable GPS should be:
[https://codeberg.org/magdesign/sxmop6/src/branch/main/launchers get launchscripts for osmin and pure-maps here]


<code>sudo /etc/gpsd/device-hook "" ACTIVATE</code>


Also, [https://git.sr.ht/~mil/mepo Mepo, under heavy development], seems promising, and seems already packaged for alpine/postmarketOs in its alpha versions.
'''Pure-Maps''' comes with <code>osmscout-server</code>,  after install, execute <code>osmscout-server-gui</code> and download some maps.
In Pure-Maps you need to get API-keys by registering on all the map provider services and enter them in settings, it takes a moment, but is easy. For '''Offline Navigation''', first launch osmscout-server, wait a few seconds, then launch Pure-Maps.
Also see the [https://magdesign.github.io/pure-maps/ Documentation].


See https://wiki.postmarketos.org/wiki/Applications_by_category#Geography for geography applications.
See https://wiki.postmarketos.org/wiki/Applications_by_category#Geography for geography applications.


=== QT app (vlc-qt, etc.) doesnt fit the screen! ===
'''Mepo''' also needs <code>mepo-scripts</code> to be installed, otherwhise menu will not work. To make the menu bigger, rotate 3 fingers on the screen.


try adding the following in your .config/sxmo/xinit  
=== Krita ===
Works very well for image editing.
 
Load [https://codeberg.org/magdesign/sxmo-userscripts/raw/branch/main/configs/krita_phone.kws this custom workspace] to <code>~/.local/share/krita/workspaces/</code> and select in krita in landscape view: Windows => Workspaces => krita_phone.kws
 
Launch krita without splash <code>krita --nosplash</code>
 
if you customized an even nicer workspace, please contribute.
 
=== Kdenlive ===
When it is not availiable via repo, install it via flathub!
 
For video editing in portrait mode, you need to do following modifications:
 
Go to <code>View => Manage Layouts</code> and import the [https://codeberg.org/magdesign/sxmo-userscripts/src/branch/main/configs/phn.kdenlivelayout phn layout].
 
Make sure to delete all other layouts to get space for the menu.
 
Turn your phone layout to landscape (you might prior switch scaling to 2) and go to:
 
<code>Settings => Configure Toolbars => TimelineToolbar</code>
 
In the right window, remove:
*Track Menu
*Timeline Edit Menu
*Separator
 
Remove everything after the Timecode 00:00:00:00
 
After the Spacer Tool, add:
 
*Favorite Effects
*Delete Selected Item
*Insert Track...
 
Under the <code>View</code> menu, enable only:
 
*Media Browser
*Clip Monitor
*Project Monitor
*Project Bin
*Timeline
 
Now give it a try. The <code>File => New</code> dialog is still challenging and might need [https://codeberg.org/magdesign/sxmo-userscripts/src/branch/main/scale_display.sh scaling]:
 
=== QT app doesn't fit the screen (scaling) ===
 
with sway, scaling can be achieved via cmd line:
 
<pre> swaymsg output \"DSI-1\" scale 2 </pre>
 
or try adding the following in your .config/sxmo/xinit  


<code>
<code>
Line 263: Line 586:


NB: it seems that as of latest (1.8.2 at time of writing), pipewire now comes as default in sxmo
NB: it seems that as of latest (1.8.2 at time of writing), pipewire now comes as default in sxmo
==== Flatpak File Permissions ====
Fractal and others can not save any content to the device until you give it permission:
<pre>
flatpak override org.gnome.Fractal --filesystem=/home/me/
</pre>
=== Foliate ===
Tab top edge to make the menubar visible,


=== Telegram Desktop ===
=== Telegram Desktop ===


The onscreen keyboard may overlap the text input field on Wayland. See https://github.com/telegramdesktop/tdesktop/issues/3274
The onscreen keyboard may overlap the text input field on Wayland. See https://github.com/telegramdesktop/tdesktop/issues/3274 . As a workaround set the scaling to 1.75 or less via <code>SXMO_SWAY_SCALE</code> in <code>$HOME/.config/sxmo/profile</code>.


As a workaround set the scaling to 1.75 or less. Use <code>swaymsg "output DSI-1 scale 1.75"</code> or the <code>scale_display.sh</code> user script from the [https://git.sr.ht/~anjan/sxmo-userscripts sxmo-userscripts repository].
Additionally the window decorations can be removed via Telegram Settings > Advanced > System Integration > Use System Window Frame > Enable (restart required).
Additionally the window decorations can be removed via Telegram Settings > Advanced > System Integration > Use System Window Frame > Enable (restart required).


== Extra features, advanced tweaking ==
== Extra features, advanced tweaking ==
=== Lockscreen / Screenlock ===
By default there is no lockscreen, you can manually add
[https://git.sr.ht/~anjan/peanutbutter Peanutbutter].
To set your custom passcode for example to "1234" (TOP_LEFT`, `TOP_RIGHT`, `BOTTOM_LEFT`, `BOTTOM_RIGHT`:
<pre>export PEANUTBUTTER_PASSCODE="1234"
</pre>
It is highly recommended to disable inputhandler until we are unlocked.
Add following line just below the variables to <code> /usr/share/sxmo/default_hooks/sxmo_hook_inputhandler.sh</code>
<pre>
# Check for 'peanutbutter'
if pgrep -x "peanutbutter" > /dev/null; then
    exit 0
</pre>
If you use the x11 version you can use https://codeberg.org/jackc/smlock instead.
It should be started in sxmo_hook_unlock.sh hook because it will take input and therefore you cannot exit screenoff state (no touchscreen).
Make sure to have https://pkgs.alpinelinux.org/package/edge/main/x86_64/mkfontscale installed.
Notifications can be displayed above and you can use the gesture to open the OSK.
=== Notification for all apps ===
You can have notification in menu with the green led as for texts/calls.
For example using a simple script you can have matrix notifications:
<pre>
#!/bin/sh
# before sxmo version 1.17.0/1 you can use this
#sxmo_notificationwrite.sh random nheko none "New matrix message"
sxmo_notifs.sh new nheko "New matrix message"
</pre>
Replace nheko with your client.
You need to trigger it with something, I used dunst.
This is the section that I added to ~/.config/dunst/dunstrc:
<pre>
[mtx_message]
  appname = nheko
  summary = "*"
  format = ""
  script = matrix_message.sh
</pre>


=== A Wayland version of Sxmo, really?? ===
=== A Wayland version of Sxmo, really?? ===
Line 279: Line 662:
=== How to Add Apps to the List? ===
=== How to Add Apps to the List? ===


Copy /usr/share/sxmo/default_hooks/sxmo_hook_apps.sh ~/.config/sxmo/hooks/sxmo_hook_apps.sh and edit that file. NOTE: make sure you chmod +x ~/.config/sxmo/hooks/sxmo_hook_apps.sh
Copy
<code>/usr/share/sxmo/default_hooks/sxmo_hook_apps.sh </code>
to
<code>~/.config/sxmo/hooks/sxmo_hook_apps.sh </code>
and edit that file.
 
=== List all available icons for the hook entry ===
 
<code>cat /usr/share/sxmo/default_hooks/sxmo_hook_icons.sh</code>
 
 
=== change filechooser / filepicker ===
change the default, not mobile friendly filechooser to one which fits the sxmo style and is mobile friendly:
'''xdg-desktop-portal-termfilechooser'''
 
<pre>
sudo apk add yazi #filebrowser
sudo apk add fd #the search module
 
git clone https://github.com/hunkyburrito/xdg-desktop-portal-termfilechooser.git
 
cd xdg-desktop-portal-termfilechooser/
 
meson build
ninja -C build
sudo ninja -C build install
</pre>
 
after this, we copy the configs to the right place:
 
<pre>
# create the config dir
mkdir -p ~/.config/xdg-desktop-portal-termfilechooser/
 
#copy the configs
sudo cp ~/xdg-desktop-portal-termfilechooser/contrib/config ~/.config/xdg-desktop-portal-termfilechooser/
 
sudo cp ~/xdg-desktop-portal-termfilechooser/contrib/yazi-wrapper.sh ~/.config/xdg-desktop-portal-termfilechooser/
 
sudo cp ~/xdg-desktop-portal-termfilechooser/termfilechooser.portal
/usr/share/xdg-desktop-portal/portals/
</pre>
 
<pre>
mkdir -p ~/.config/xdg-desktop-portal
</pre>
 
create
<code>~/.config/xdg-desktop-portal/portals.conf</code> with content:
 
<pre>
[FileChooser]
org.freedesktop.impl.portal.FileChooser=termfilechooser
</pre>
 
now reboot and then execute:
 
<pre>
GTK_USE_PORTAL=1 firefox-esr
</pre>
and visit any page to upload something, you should have a beautiful filepicker now.
 
'''By default the system is using GTK_USE_PORTAL=2''' so we need to do one final step:
 
<pre>
~/.config/sxmo/profile
</pre>
 
add on the end:
 
<pre>
# export GTK_USE_PORTAL=1
export GTK_USE_PORTAL=1
export GTK_THEME=Adwaita:dark
</pre>
 
== Customize Gestures ==
 
Mdify gestures/swipes and button presses in:
 
<pre>
~/.config/sxmo/hooks/sxmo_hook_lisgdstart.sh
</pre>
 
more details about this topic [https://wiki.postmarketos.org/wiki/User:Magdesign here].
 
== Errors ==
 
=== after an upgrade ===
 
if something is not working anymore after you updated the system, for example errors like:
<code>Error: Connection activation
failed: No suitable device found
for this connection (device usb0
not available because profile is n..</code>
 
 
try:
 
<code> sudo apk fix </code>
 
and then reboot.

Latest revision as of 19:41, 4 February 2025

< Sxmo

Here is a growing list of tips, tricks and configuration snippets for using Sxmo.

This pages is intended to focus mostly on "non-core" issues, such as running apps and everyday usability. The core configuration issues should end up in sxmo doc, as discussed on https://todo.sr.ht/~mil/sxmo-tickets/275


Calls, SMS, Modem

See this writeup to understand how calling works.

Sometimes Modem gets stuck

Sometimes the modem does not respond, stops receiving/sending calls, etc.

Preferred solution: toggle 'Modem Daemons' in the menu under 'Config'.

Reliable solution: reboot.

Sometimes SMS messages aren't sent/received

The latest biktorgj firmware (0.5.3) should address this situation. Alternatively, check for stuck sms and delete them:

  1. mmcli --modem any --messaging-list-sms
    mmcli --modem 0 --sms 0
    mmcli --modem 0 --messaging-delete-sms=##
    mmcli --modem 0 -r
    The identifying number of the modem may vary, being incremented upon toggles and sometimes reboots. you probably also can use: --modem any

How to send an SMS via command line (or ssh)

cat mysupersmsfile | sxmo_modemsendsms.sh +33123123123 -

Where to Delete SMS

.local/share/sxmo/modem/<sender>/sms.txt

How to call from the command line

Example:

sxmo_modemdial.sh 08003301000

How to change SIM pin

From 1234 to 1010:

mmcli -i any --pin=1234 --change-pin=1010

Disabling:

mmcli -i any --pin=1010 --disable-pin

How to activate data

In menu under Networks select Add a GSM. Enter the APN settings for your carrier.

find a list here.

How to find Operator Name and other Infos

mmcli -m any

How to enable Roaming

This is not clear yet.

Test if roaming is enabled with: mmcli --modem=0 --bearer=0

Edit the .connection file and add: allow-roaming=true

since v1.20 its called MMBearerRoamingAllowance see more info here. We should really solve this puzzle.

How to send USSD

Try something like:

mmcli -m any --3gpp-ussd-initiate="*100#"

How to send AT command

Directly

  1. If desired monitor output as root:
    cat /dev/ttyUSB2
  2. In another terminal, send the command, in this example to check the ADSP firmware version:
    echo -ne "AT+QGMR\r" >/dev/ttyUSB2

Through modem manager

  1. Restart modem manager in debug mode:
    sudo /sbin/rc-service modemmanager stop
    sudo /usr/sbin/ModemManager --debug
  2. In another terminal, send the command, in this example to check the ADSP firmware version:
    mmcli -m any --command="AT+QGMR"
  3. Stop modem manager in debug mode, then run:
    sudo /sbin/rc-service modemmanager start

Retrieving signal strength information

See here.

Block Numbers

create:

 ~/.config/sxmo/block.tsv 

and add the numbers to block: blockedcontactnumber TAB blockedcontactname

there will be no notifications

Create contacts.tsv from Android data

This assumes you have developer mode enabled on your phone and usb debugging using adb.

I messed around with different API calls, I store the contacts locally on the device, what worked for me to get the full set of phone numbers was:

adb shell content query --uri content://com.android.contacts/data --projection display_name:data1:data3:data4 | grep '[0-9]\{10\}' | grep -v gprofile > raw_contacts

`create_contact_tsv.py` depends on python package `phonenumbers`, please install it.

then run on the terminal

python3 create_contacts_tsv.py raw_contacts | sort | uniq > contacts.tsv

For completeness, entire content of the python file `create_contact_tsv.py`

import csv, sys, phonenumbers as p; with open(sys.argv[1], 'r') as file:

 reader = csv.reader(file)
 for row in reader:
   name = row[0][str(row[0]).find("=") + 1:]
   for match in p.PhoneNumberMatcher(str(row), None):
     number = p.format_number(match.number, p.PhoneNumberFormat.E164)
     print(number + "\t" + name)

Create contacts.tsv from vcard export (e.g. vcf export from nextcloud)

We can convert an export in vcard format of a contact list to a file, work with with the following commands:

git clone https://github.com/gled-rs/cvf2csv.git && cd cvf2csv && pip install phonenumbers

Put the downloaded vcard export into the same directory as the convert.py script and name it contacts.vcf

See README.md to change the default behaviour of the convert script.

python convert.py && cp contacts.csv ~/.config/sxmo/contacts.tsv

General configuration

Set Darkmode

For Gnome apps:

gsettings set org.gnome.desktop.interface color-scheme prefer-dark


For Kde plasma-mobile apps:

sudo apk add plasma-integration

sudo apk add qqc2-breeze-style

Get the style file here.

Move it to where it belongs:

mv kdeglobals ~/.config

Now we need to set the environment variables (not sure if we need this, pasted once into terminal):

QT_QUICK_CONTROLS_STYLE=org.kde.breeze QT_QPA_PLATFORMTHEME=kde

For Flatpaks

some flatpaks just refuse to run in dark mode, edit the launcher of each flatpak to contain the dark theme like this:

flatpak run --env=GTK_THEME=Adwaita-dark org.gnome.Fractal

GTK Apps can be forced with a prefix:

GTK_THEME=Adwaita:dark application 

How change idle/suspend time

Add with your time in seconds:

export SXMO_UNLOCK_IDLE_TIME="30"

in ~/.config/sxmo/profile

How to display the percentage of battery

along with the icon in the status bar, add:

export SXMO_BAR_SHOW_BAT_PER=1 

in ~/.config/sxmo/profile

on the homescreen, add:

${alignc}${font goto:size=22:style=Bold}${exec echo "Power: "}${exec upower -d | grep -m1 'percentage:' | awk '{print $2}'}

in ~/.config/sxmo/conky.conf

How to easily change the size of the text, system-wide?

Change the value in: /usr/share/sxmo/appcfg/xresources_xft.xr (try 160!)

Xft.dpi: 192

(chaning it in ~/.Xresources works as well)


if you remove the dpi line there you can set dpi on the fly via

xrandr --dpi x

How to change the keyboard layouts? (wvkbd/wayland)?

edit your .config/sxmo/profile and add default command lines options for wvkbd like this:

export KEYBOARD_ARGS="-l full,special -H 200 -fn 'Hack 11'"


To see a list of possible options for KEYBOARD_ARGS, enter:

wvkbd-mobintl --help


Possible keyboard layouts for option -l are: Full, Special, Emoji, Simple, SimpleGrid, Nav, Dialer, Cyrillic, Arabic, Persian, Greek, and Georgian.

How to type Umlauts & Special Keys

Umlauts: Cmp followed by the according letter.

e.g. ä => AGr + a


F keys with AGr-N

e.g. F10 => AGr + 0 (F11 + F12 don't exist)


=> AGr + -

£ => AGr + =

How to change the size of the virtual keyboard?

edit KEYBOARD_ARGS in your ~/.config/sxmo/profile and add "-H <height>" to change the portrait height, "-L <height>" to change the landscape height.

How to launch programms on startup?

If you run dwm, edit:

~/.config/sxmo/xinit 

If you run sway, edit:

~/.config/sxmo/sway

Instead, you can also copy

cp /usr/share/sxmo/default_hooks/start ~/.config/sxmo/hooks/start and edit that file.

NOTE:

Make sure to make it executable chmod +x ~/.config/smxo/hooks/start

How to set screen brightness on start

add:

/usr/bin/sxmo_brightness.sh setvalue 50

to the bottom of:

/usr/share/sxmo/default_hooks/s xmo_hook_start.sh

mount /tmp/ in RAM, to save write cycles on storage device

add the following in /etc/fstab

tmpfs /tmp tmpfs rw,nodev 0 0

Help with adding cronjobs

You can edit your crontab via

crontab -e

This website https://crontab.guru/ has proven useful in making cronjobs.

If using mnc, make sure that commands run via sxmo_rtcwake.sh.

Example:

55-59/2 7 * * 1-5 sxmo_rtcwake.sh /home/user/script

How to customize the colours/fonts of the interface?

xorg/dwm

Get example in the alpine blooms theme by Tetrakist, as entries to add in /home/user/.Xresources

wayland/sway

  • .config/sxmo/sway
  • bemenu parameters through BEMENU_OPTS env variable. for instance in .profile:

export BEMENU_OPTS="--fn 'FiraMono Nerd Font 13' --tf '$MYCOLOR' --tb '#00000090' --nb '#00000090' --nf '$MYCOLOR' --hb '$MYCOLOR' --hf '#000000' --sb '$MYCOLOR' --sf '$MYCOLOR' --scb '#000000' --scf '$MYCOLOR' "

  • mako config in .config/mako/config

Some notifications stay stuck on the screen!

If in dwm:

pkill dunst

If in sway:

pkill mako


A simple way to share Internet through USB (aka "USB tethering")

Select 'Networks' in the menu and add a USB hotspot.

On your connecting device, you may need to configure IPv4 configuration Manually, as your pmOS device is not going to act as a DHCP server by default. Set "Addresses" to 10.42.0.2/24, and set Gateway to 10.42.0.1 (which is your pmOS device's address). If you're running DNSmasq, you may also use that for DNS server, otherwise set DNS server to your favorite server.

Where can i read logs for sxmo?

try less /home/user/.local/state/tinydm.log or tail -f /home/user/.local/state/tinydm.log

or logread -f for the generic pmOS log, that also displays some of sxmo deamons (modemmanager, etc.) information


Move sxmo's bar below your phone's notch

Find the bar entry in ~/.config/sxmo/sway and add a gaps configuration to it.

bar { gaps 42 0 }

See https://todo.sr.ht/~mil/sxmo-tickets/494 and https://man.archlinux.org/man/sway-bar.5.en

Working around the Notch

By filling in some useless items in the notch area. If not already done,

cp /usr/share/sxmo/default_hooks/sxmo_hook_statusbar.sh ~/.config/sxmo/hooks/

then add a few ooooo between the battery and the wifi symbol just above the line containing

sxmobar -a -f "$fgcolor" -b "$bgcolor" -t "$style" \

with adding this line to the hook:

sxmobar -a notch 22 oooooooooo

Then disable tray icons in swaybar:

nano ~/.config/sxmo/sway

Scroll down to the Status Bar: section and just below position top add tray_output none


Then reboot and enjoy.

LED blinking not working with feedbackd

When postmarketos-default-camera is installed, it adds a udev rule that changes ownership of the LED devices to the feedbackd group. This means the default user won't have permissions to use the LEDs on a clean install. This only occurs on devices with a working camera (i.e. PinePhone).

The simplest workaround is to add your user to the feedbackd group:

sudo adduser $(whoami) feedbackd

An alternative option is to add a udev rule to override this behavior.

Create the file /etc/udev/rules.d/99-sxmo-led.rules with the following contents:

ACTION=="add|change", SUBSYSTEM=="leds", DEVPATH=="*/*:status", RUN+="/bin/chgrp input /sys$devpath/brightness  /sys$devpath/pattern /sys$devpath/repeat"
ACTION=="add|change", SUBSYSTEM=="leds", DEVPATH=="*/*:indicator", RUN+="/bin/chgrp input /sys$devpath/brightness  /sys$devpath/pattern /sys$devpath/repeat"

This was discussed in this mr https://gitlab.postmarketos.org/postmarketOS/pmaports/-/merge_requests/4758 and there were not any ideal solutions discovered.

Applications specific

Set default applications

e.g. Define which app opens images:

sudo nano mimeapps.list

edit:

image/png=loupe.desktop

image/jpg=loupe.desktop

make sure you create a desktopfile for loupe in:

nano ~/.local/share/applications/loupe.desktop

containing:

Desktop Entry]
Type=Application
Terminal=false
Exec=/usr/bin/loupe
Name=loupe
MimeType=image/png;image/jpg

Osmin, Pure-Maps, Mepo

To use navigation properly, first enable GPS:

mmcli -m any --location-enable-gps-nmea
mmcli -m any --location-enable-gps-raw 
mmcli -m any --location-get 

/usr/libexec/geoclue-2.0/demos/agent  > /dev/null 2>&1 &

get userscript here.

In the time of writing, you need to have a sim card inserted, but you can manually compile a newer modemmanager and enable gnss to have gps without sim.

get launchscripts for osmin and pure-maps here


Pure-Maps comes with osmscout-server, after install, execute osmscout-server-gui and download some maps. In Pure-Maps you need to get API-keys by registering on all the map provider services and enter them in settings, it takes a moment, but is easy. For Offline Navigation, first launch osmscout-server, wait a few seconds, then launch Pure-Maps. Also see the Documentation.

See https://wiki.postmarketos.org/wiki/Applications_by_category#Geography for geography applications.

Mepo also needs mepo-scripts to be installed, otherwhise menu will not work. To make the menu bigger, rotate 3 fingers on the screen.

Krita

Works very well for image editing.

Load this custom workspace to ~/.local/share/krita/workspaces/ and select in krita in landscape view: Windows => Workspaces => krita_phone.kws

Launch krita without splash krita --nosplash

if you customized an even nicer workspace, please contribute.

Kdenlive

When it is not availiable via repo, install it via flathub!

For video editing in portrait mode, you need to do following modifications:

Go to View => Manage Layouts and import the phn layout.

Make sure to delete all other layouts to get space for the menu.

Turn your phone layout to landscape (you might prior switch scaling to 2) and go to:

Settings => Configure Toolbars => TimelineToolbar

In the right window, remove:

  • Track Menu
  • Timeline Edit Menu
  • Separator

Remove everything after the Timecode 00:00:00:00

After the Spacer Tool, add:

  • Favorite Effects
  • Delete Selected Item
  • Insert Track...

Under the View menu, enable only:

  • Media Browser
  • Clip Monitor
  • Project Monitor
  • Project Bin
  • Timeline

Now give it a try. The File => New dialog is still challenging and might need scaling:

QT app doesn't fit the screen (scaling)

with sway, scaling can be achieved via cmd line:

 swaymsg output \"DSI-1\" scale 2 

or try adding the following in your .config/sxmo/xinit

export QT_AUTO_SCREEN_SCALE_FACTOR=1 export QT_SCALE_FACTOR=0.7

(change the factor until it suits your need)

You can also copy https://git.sr.ht/~anjan/sxmo-userscripts/tree/master/item/scripts/scale_display.sh to ~/.config/sxmo/userscripts/scale_display.sh

Cmus: the application related bemenu is not loaded as soon as a song is played.

change the title of the terminal in the cmus config file $XDG_CONFIG_HOME/cmus/rc to contain the string "cmus":

echo "set format_title= %a %t %c cmus" >> .config/cmus/rc

Flatpak

If you use Flatpak apps, you probably will have problems with sound. That is because Flatpak requires a PulseAudio-compatible sound server, but SXMO uses by default only ALSA. To install and setup PipeWire as well as its PulseAudio implementation, please refer to SXMO's documentation.

NB: it seems that as of latest (1.8.2 at time of writing), pipewire now comes as default in sxmo

Flatpak File Permissions

Fractal and others can not save any content to the device until you give it permission:

flatpak override org.gnome.Fractal --filesystem=/home/me/

Foliate

Tab top edge to make the menubar visible,

Telegram Desktop

The onscreen keyboard may overlap the text input field on Wayland. See https://github.com/telegramdesktop/tdesktop/issues/3274 . As a workaround set the scaling to 1.75 or less via SXMO_SWAY_SCALE in $HOME/.config/sxmo/profile.

Additionally the window decorations can be removed via Telegram Settings > Advanced > System Integration > Use System Window Frame > Enable (restart required).

Extra features, advanced tweaking

Lockscreen / Screenlock

By default there is no lockscreen, you can manually add Peanutbutter.

To set your custom passcode for example to "1234" (TOP_LEFT`, `TOP_RIGHT`, `BOTTOM_LEFT`, `BOTTOM_RIGHT`:

export PEANUTBUTTER_PASSCODE="1234"

It is highly recommended to disable inputhandler until we are unlocked. Add following line just below the variables to /usr/share/sxmo/default_hooks/sxmo_hook_inputhandler.sh

# Check for 'peanutbutter'
if pgrep -x "peanutbutter" > /dev/null; then
    exit 0


If you use the x11 version you can use https://codeberg.org/jackc/smlock instead. It should be started in sxmo_hook_unlock.sh hook because it will take input and therefore you cannot exit screenoff state (no touchscreen).

Make sure to have https://pkgs.alpinelinux.org/package/edge/main/x86_64/mkfontscale installed.

Notifications can be displayed above and you can use the gesture to open the OSK.

Notification for all apps

You can have notification in menu with the green led as for texts/calls. For example using a simple script you can have matrix notifications:

#!/bin/sh

# before sxmo version 1.17.0/1 you can use this
#sxmo_notificationwrite.sh random nheko none "New matrix message"

sxmo_notifs.sh new nheko "New matrix message"

Replace nheko with your client.

You need to trigger it with something, I used dunst. This is the section that I added to ~/.config/dunst/dunstrc:

[mtx_message]
   appname = nheko
   summary = "*"
   format = ""
   script = matrix_message.sh

A Wayland version of Sxmo, really??

Yes. Really! It's the default now. Use WM Toggle in the menu under 'Power' to toggle between dwm and sway.

How to Add Apps to the List?

Copy /usr/share/sxmo/default_hooks/sxmo_hook_apps.sh to ~/.config/sxmo/hooks/sxmo_hook_apps.sh and edit that file.

List all available icons for the hook entry

cat /usr/share/sxmo/default_hooks/sxmo_hook_icons.sh


change filechooser / filepicker

change the default, not mobile friendly filechooser to one which fits the sxmo style and is mobile friendly: xdg-desktop-portal-termfilechooser

sudo apk add yazi #filebrowser
sudo apk add fd #the search module

git clone https://github.com/hunkyburrito/xdg-desktop-portal-termfilechooser.git

cd xdg-desktop-portal-termfilechooser/

meson build
ninja -C build
sudo ninja -C build install

after this, we copy the configs to the right place:

# create the config dir
mkdir -p ~/.config/xdg-desktop-portal-termfilechooser/

#copy the configs
sudo cp ~/xdg-desktop-portal-termfilechooser/contrib/config ~/.config/xdg-desktop-portal-termfilechooser/

sudo cp ~/xdg-desktop-portal-termfilechooser/contrib/yazi-wrapper.sh ~/.config/xdg-desktop-portal-termfilechooser/

sudo cp ~/xdg-desktop-portal-termfilechooser/termfilechooser.portal 
/usr/share/xdg-desktop-portal/portals/
mkdir -p ~/.config/xdg-desktop-portal

create ~/.config/xdg-desktop-portal/portals.conf with content:

[FileChooser]
org.freedesktop.impl.portal.FileChooser=termfilechooser

now reboot and then execute:

GTK_USE_PORTAL=1 firefox-esr

and visit any page to upload something, you should have a beautiful filepicker now.

By default the system is using GTK_USE_PORTAL=2 so we need to do one final step:

~/.config/sxmo/profile

add on the end:

# export GTK_USE_PORTAL=1
export GTK_USE_PORTAL=1
export GTK_THEME=Adwaita:dark

Customize Gestures

Mdify gestures/swipes and button presses in:

~/.config/sxmo/hooks/sxmo_hook_lisgdstart.sh

more details about this topic here.

Errors

after an upgrade

if something is not working anymore after you updated the system, for example errors like: Error: Connection activation failed: No suitable device found for this connection (device usb0 not available because profile is n..


try:

sudo apk fix

and then reboot.