From postmarketOS

Creator of the opensource multimedia server

Opensource nomad cycling the world since September 2022.

The idea to travel the world with an opensource phone died after hacking a year on pinephone and librem5 and a month before leaving, the pinephonepro started to melt on the backside...

I really do like to write documentation/howto/wiki and therefore I'd love to be a part of PostmarketOS community. Believe it or not, all the stuff is written on my pmos or my android phone, even the scripts, which took a lot of time and nerves. If you read this, drop me a line, it motivates me to know that you read the page here...

Love and hate my OP6 running sxmo (daily driving since 3. Feb. 24).

Spent some time with droidian/phosh to have a camera, but phosh is really not my thing, i want to be able to create and fix stuff.



masto: pixelfed:

Videos about our travels:

  _______   ____  __  ____  
 / ____\ \ / /  \/  |/ __ \ 
| (___  \ V /| \  / | |  | |
 \___ \  > < | |\/| | |  | |
 ____) |/ . \| |  | | |__| |
|_____//_/ \_\_|  |_|\____/ 

           _ __   _ 
 _      __(_) /__(_)
| | /| / / / //_/ / 
| |/ |/ / / ,< / /  

Owns devices

Device Notes
OnePlus 6 (oneplus-enchilada) sxmo, daily, many hacks


I wrote some useful scripts.

Use the installer 🤓

Work Around the Notch

Just add some random stuff to the bar.


cp /usr/share/sxmo/default_hooks/ ~/.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.

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):


thanks to user: x-m7

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 

Manage App Menu

Some stuff exist only as a flatpak, but it will not show in application menu... simply change in nano ~/.config/sxmo/hooks/ :

write_line_app() {
        if command -v "$executable" >/dev/null; then
                write_line "$label" "$command"


write_line_app() {
        if command -v "$executable" >/dev/null; then
                write_line "$label" "$command"
        elif ls /var/lib/flatpak/app/"$executable" >/dev/null; then
                write_line "$label" "$command"

and add e.g. Flare like this:

write_line_app de.schmidhuberj.Flare "$icon_msg Flare" "flatpak run de.schmidhuberj.Flare"

Manage Menu's (Volup_one)

Copy the contextmenu hook to your user:

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

Then edit this copy.

For example to remove the Binaries from the System Menu, go down to: # Default system menu (no matches)

and remove the whole line containing $icon_grd Binaries.

Application specific Context Menu's

Can be really handy to set the most used shortcuts of a specific app.

In this example we add a menu for Krita with the most used commands.

we scroll to the block containing Firefox, and add a new one:

		# Krita
			$icon_fnd Open                   ^ 0 ^ sxmo_type -M Ctrl o
			$icon_sav Save                   ^ 0 ^ sxmo_type -M Ctrl s
			$icon_pst Paste                  ^ 0 ^ sxmo_type -M Ctrl v
			$icon_del Delete                 ^ 0 ^ sxmo_type -k Delete
			$icon_win Select                 ^ 0 ^ sxmo_type -M Ctrl r
			$icon_modem_disabled Deselect    ^ 0 ^ sxmo_type -M Ctrl -M Shift a
			$icon_wn2 Crop                   ^ 0 ^ sxmo_type c
			$icon_flt Fill                   ^ 0 ^ sxmo_type f
			$icon_modem_connected Gradient   ^ 0 ^ sxmo_type g
			$icon_dof HSV Adjust             ^ 0 ^ sxmo_type -M Ctrl u
			$icon_cls Close Image        	 ^ 0 ^ sxmo_type -M Ctrl w

Note: somehow i was not able to make Scale Image to New Size Ctrl + Alt + I; Resize Canvas and Enter working.

Copy content of SMS

(e.g. to copy into translator)

Search to block containing:

grep -qi -w "sms\|missed

and just above

$icon_aru Scroll up '

you add:

 $icon_cpy Copy        ^ 0 ^ sxmo_type -M Shift -M Ctrl c  

vim vs. nano vs. micro

change the standard to write sms..

export EDITOR="micro"



Fix Screenshot (Fullscreen)

Since fullscreen screenshot is still borked :(

sudo cp /usr/share/sxmo/appscripts/ /usr/share/sxmo/appscripts/ 

sudo micro /usr/share/sxmo/appscripts/

Make sure to rename the title in the header to # title="$icon_cam Screenshot"

then remove

area="$(slurp -o)"

and rewrite the line below to:

grim "$1"

done, full screenshot works as expected

Block callers


block annoying numbers in:


around line 130 is something called $SXMO_BLOCKFILE

so you can create a


file containing the numbers to be blocked and it should work, right?

and here you find a basic call writeup.


Since there is no Tor-Browser in PostmarketOS

sudo apk add tor

sudo cp /etc/tor/torrc.sample /etc/tor/torrc

sudo service tor start

check if it is running with: sudo netstat -tunlp | grep tor

in Firefox Network Settings Select:

 Manual proxy configuration
 SOCKS Host  Port 9050

Tick the Proxy DNS when using SOCKS v5

For autostart Tor on boot:

sudo rc-update add tor default

This however, will not work in a country which Censors Tor connections, e.g. Iran, China...

You need to get obfs4proxy, its package name is lyrebird and you have to build it yourself.

Since you might not be able to access the official repo take my pre-built package, make lyrebird executable and copy it to /usr/local/bin/lyrebird try quickly if you can run it, if yes, it will throw an error like: lyrebird - must be run as a managed transport

Next make sure /etc/tor/torrc contains:

Log notice file /var/log/tor/notices.log
DataDirectory /var/lib/tor
ClientTransportPlugin obfs4 exec /usr/local/bin/lyrebird

then start or restart tor:

sudo rc-service tor start 

watch the log file while it tries to circumvent censorship:

sudo tail -f /var/log/tor/notices.log 

try in your configured browser. GOOD LUCK!


There is an issue in ModemManger which will not route your GSM traffic through VPN, so VPN is only working over Wifi!

When trying to fix this, you need to manually disable the default route through qmapmux0.0, but modemmanger automatically creates this route again.

No fixes for this right now...

Install OpenVPN support:

sudo apk add networkmanager-openvpn

Add OpenVPN setting:

sudo nmcli connection import type openvpn file /path/to/vpnfile.ovpn

Add username:

sudo nmcli connection modify $vpnname username=$myname

Add password:

sudo nano /etc/NetworkManager/system-connections/yourvpnname

if not there, add:



If password changes, use:

sudo nmcli connection modify $vpnname +vpn.secrets password=$password

Make sure that password-flags=0

Enable the connection (--ask if password is not stored):

nmcli connection up $vpnname


Enable the connection with grafical interface:


Select it and enter password.


There is a bug or sourcehutthat you can not connect to hotspot of your pmos device with a modern device. The workaround is to create the hotspot from commandline and disable pmf or fix the /usr/bin/ script with adding this on around line 219:

notify_sucess "Adding hotspot wifi" \
                nmcli device wifi hotspot ifname wlan0 con-name "Hotspot $SSID" \
                ssid "$SSID" channel "$channel" band bg password "$key"
                nmcli con down "Hotspot $SSID"
                nmcli c modify "Hotspot $SSID" 802-11-wireless-security.pmf 1
                nmcli c modify "Hotspot $SSID" wifi-sec.pmf disable
                nmcli con up "Hotspot $SSID"

Captive Login Page

When connecting to an internet with a captive login page, but its not shown, type in Firefox addressbar:


If there is a SIM card inserted: Enable Modem GPS

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

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

mmcli -m any --location-get 

Get userscript here:

make GPS available to apps:


sxmo userscript to launch pure-maps with gps & geoclue you find inside my userscripts set (see codeberg link above).

Pure-Maps You need pure-maps and osmscout-server

after install execute osmscout-server-gui and download some maps. You need to get API-keys with registering on all the map provider service,it takes a moment, but is easy. When all done you can run pure-maps with the launcher-script. For offline navigation, first launch osmscout-server, wait a few seconds, then launch pure-maps. To find drinking water, dont use the search window, use Nearby venues from the menu.

If there is no SIM card inserted the modem does not get activated and mmcli will not work.In this case:


sudo apk add gnss-share gnss-share-geoclue
sudo rc-service gnss-share start

In /etc/geoclue/geoclue.conf set:

# Enable Modem-GPS source

and in /etc/gnss-share.conf set:


now install and run the 'Satellite' app via flathub:

sudo flatpak install flathub page.codeberg.tpikonen.satellite

flatpak run --env=GTK_THEME=Adwaita:dark page.codeberg.tpikonen.satellite

and ....? no NMEA source... thats because we need we need a modemmanger than v1.23.4, which is not out yet..

add the service to boot..rewrite geoclue.conf to /var/run/gnss-share.sock instead of gps-share.sock

Thanks to tpikonen for all the help!

Pure-Maps Style Tuning


Pure-maps does not show city names in the default offline mode. To change this, edit


change under "id": "place-city"

"minzoom": 1,
"maxzoom": 18,

this will show the city names in zoomlevel 14.49 to 18

we still dont see it at lower levels, which i might find out one day hopefully...

note: select offline, type= default

the issue seems to be caused while importing the tiles we also need to import other zoom levels (after talking with rinigus on matrix).

check here whats going on:

when solved, document in puremaps forum and github!

Osmin Style Tuning


we edit the cycle stylesheet to always show drinking waterspots

lets edit:



  [TYPE amenity_drinking_water] {
     NODE.ICON { name: drinking_water; }
     AREA.ICON { name: drinking_water; }

we also need to make the symbol bigger and visible on all scaling layers...

Podman / Docker Installation

sudo apk add podman

sudo rc-update add cgroups

#remove folder so it will be created with the right permission on first run:
sudo rm -rf $HOME/.local/share/containers/storage

sudo touch /etc/subuid
sudo touch /etc/subgid

sudo usermod --add-subuids 100000-165535 --add-subgids 100000-165535 $(whoami)

-- reboot or logout/login  --

Offline Translation

Offline Translator LibreTranslate, was not able to make them run because of fucking censorshit (guys, please fix the vpn-gsm issue), however it works:

git clone

cd LibreTranslate

# replace docker commands with podman:
sed -i 's/docker/podman/g'

sudo chmod +x

./ --update --load-only en,de,fr,tr

# limit languages:
# the --update is a flag to update the language packs
#for other languauges see here:

Be aware that this will suck quite a bunch of data (i just emptied my data plan with this...)

After starting, visit with a browser:

or use this script, change the url to http://localhost:5000/translate to easy query from terminal.

create a handle to start from apps menu hook:

write_line_app podman "$icon_edt LibreTranslate" " ~/LibreTranslate/"

the podman entry is a bit of a hack, otherwise we have to add a variable to check which containers are installed, which is just too slow.

Offline Speech-to-Text

In 2024 they destroied the free internet and it turned out that the new online is offline, similar as it was with computers back in the 90ies, they ran without internet...

Install with:

sudo apk add sox
sudo apk add py3-srt --repository=
sudo apk add py3-vosk-api
git clone
cd nerd-dictation
mv vosk-model-small-en-us-0.15 model
mkdir -p ~/.config/nerd-dictation
mv ./model ~/.config/nerd-dictation

We need dotool to type stuff:

sudo apk add dotool
sudo udevadm control --reload && sudo udevadm trigger

Set the buttom microphone as default input (this may vary depending of your hardware and os version on stable it was hw:0,3 check with arecord -l

export AUDIODRIVER=alsa

To run:

./nerd-dictation begin --simulate-input-tool=DOTOOL --input=SOX

# Start speaking..

./nerd-dictation end

Get the launcher script here

copy [1] configuration file to enable punctuation to:


to type 'enter' instead of writing it, add something to the config file.

To do:

  • add 'Enter' word as keystroke (~/.config/nerd-dictation/ or see examples on github)

Modify the keyboard to have a button (see below)

Offline Text-to-Speech

sudo apk add piper-tts

Download voices in the needed language here and locate them in structured folders:

mkdir -p ~/piper/models/en

Now test a realtime example:

echo 'This is running on postmarktOS.' | \
/usr/bin/piper --model $HOME/piper/models/en/en_US-lessac-medium.onnx --config $HOME/piper/models/en/en_en_US_lessac_medium_en_US-lessac-medium.onnx.json --output-raw | aplay -r 22050 -f S16_LE -t raw -


I made a launcher to read out loud what ocr_roi sees.

Next is to pipe other outputs to read out load, but dont know how yet.

Keyboard Modifications

git clone
sudo apk add wayland-dev pango-dev libxkbcommon-dev

cd wvkbd
micro layout.mobintl.h

go to // Emojis and make your modifications

 🚴 0x1F6B4
 🤓 0x1F913
 🤷‍ 0x1F937
 🚀 0x1F680
 🍷 0x1F377  
 🍺 0x1F37A  
 🔥 0x1F525
 🚲 0x1F6B2
 🌡️ 0x1F321
 🏕️ 0x1F3D5
 🫶 0x1FAF6

or just pull my custom file.

sudo make install

voila, all done.

To add new buttons to trigger stuff, we have to work with key combos and then define them in ~/.config/sxmo/sway

For the moment its not possible to trigger scripts directly or make longer than two-key combos, which might hopefully change once.

Lets do it like this:

In layout.mobintl.h search for:

{"Special", "Special", 1.5, Layout, 0, &layouts[Special]

replace or add a new line:

 {"󰍽", "󰍽", 1.0, Code, KEY_7, 0, Super},
  {"󰍬", "󰍬", 1.0, Code, KEY_8, 0, Super},

Note: the first two 󰍬 symbol ate the mouse, the others the mic cat /usr/share/sxmo/default_hooks/ | grep mic

make and install as written above.

Now we need to change the entry in ~/.config/sxmo/sway to trigger the nerd dictation toggle script, scroll down to:

# Workspaces:

   bindsym $mod+7 workspace number 7
   bindsym $mod+8 workspace number 8

and rewrite them to:

bindsym $mod+7 exec ~/sxmo-userscripts/launchers/ 

bindsym $mod+8 exec ~/sxmo-userscripts/launchers/

restart sway.

get the dictation launcher script [2].

get the touchpad launcher here.


should we create a whole line of tools, including screenshot, ocr_roi, qr reader? i think this would be nice!

Make sure you build and install TouchpadEmulator as written below:

Touchpad Simulator

Sometimes its nice to have a mousepointer to handle desktop apps or for precision work.

As written above, we can then trigger this via keyboard! This section is about installing the patched TouchpadEmulator (thx2 fdelamotte) in pmos/sxmo. edit: there seems to be a click and drag issue in the patch

git clone
cd TouchpadEmulator
rm TouchpadEmulator.c
sudo apk add dbus-dev dbus-glib-dev
sudo make install
sudo modprobe uinput
sudo chmod 777 /dev/uinput

You are good to go. I know its not very nice to give full rights to uinput, maybe you have a better way to do it.

Set default applications

e.g. Define which app displays images sudo nano ~/.config/mimeapps.list




make sure you create a desktopfile for loupe in:

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


[Desktop Entry]

maybe there can also be some settings made in:


Allow Flatpak / e.g. Fractal to access folder

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

Modify Homescreen

Change the position of the clock on Homescreen:


see the various configs here.

to put it to the right buttom edge, we modify alignment = 'middle_middle',


alignment = 'bottom_right',

Just for fun, you can also add the info of the free available diskspace and the powerlevel:

${alignc}${font Sxmo:size=12}${exec df -h | awk '/root/ { print "Free: " $4 }'}
${alignc}${font Sxmo:size=12}${exec echo "Power:"}${exec upower -d | grep -m1 'percentage:' | awk '{print $2}'}

Get my custom conky.conf which shows status of modem, battery, data usage, networkspeed...

Networks Menu

to add a Disable GSM function, edit: /usr/bin/ add:

togglegsm() {
                        if nmcli radio wwan | grep -q "enabled"; then
                       "Disabling GSM"
                                nmcli radio wwan off 
                       "Enabling GSM"
                                nmcli radio wwan on

below $icon_cfg Nmtui add following code to toggle the menu entry:

        if nmcli radio wwan | grep -q "enabled"; then
                printf "%s GSM Disable\n" $icon_modem_disabled
                printf "%s GSM Enable\n" $icon_modem_registered


                        *"Nmtui" )
                       nmtui || continue # Killeable
                        *"GSM Disable"|*"GSM Enable" )

and to share our wifi credentials we make another entry just before Ifconfig EOF:

$([ -z "$WIFI_ENABLED" ] || printf "%s Show Credentials\n" "$icon_wif")

and below, after the *"Scan Wifi Networks" ) block, we add: -- bash -c "nmcli dev wifi show-password; read -p 'Press enter to close';" 

Screen Color Adjustment

This are just notes of an unfinished journey. I tried so far without luck:

wl-gammrelay, wl-gammarelay-rs, wlsunset, gammastep, wlr-randr

for example:

gammastep -O 5000K

Warning: Zero outputs support gamma adjustment.

Warning: 1/1 output(s) do not support gamma adjustment.

So lets dive deeper:

ls /sys/class/backlight/ae94000.dsi.0



nothing about color.

To turn the screen very dark we can do this an it works:

echo 8 > /sys/class/backlight/ae94000.dsi.0/brightness

but not color, rgb? rgba?

ah, maybe fbset:


mode "1080x2280-0"
#D: 0.000 MHZ, H: 0.000 kHZ. V:
0.000 Hz
geometry 1080 2280 1080 2280 32
timings 0 O 0 0 0 0 0
accel false
rgba 8/16,8/8,8/0,0/0

ok, first time i read something about color, but what now, maybe create custom profiles in /etc/fb.modes and try to load them..

or go deeper into i2c, really?

sudo ddcutil environment

sudo ddcutil detect

Kde Plasma mobile has working nightlight on the same device, but i dont know yet how they do it.

After all this, why not just hack a .png screen overlay to get a nightmode?

 swayimg -g $myresolution --config="general.transparency=none" $overlay2 

It works, but we need to put it on top without blocking touch input, then you can have this really stupid workaround 😂

swayimg does not support event forwarding

How to achieve this? Maybe swaymsg -t anything fullscreen input surface 0

see pics.

It seems that we have to use wlroots,create an input surface of 0 so it jumps to the next layer, sadly i have zero knowledge of C code and the bash commands are very limited...

Customize Gestures

Copy the standard lisgd configuration file to make custom edits:

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

Now you can start modifying gestures on your custom copy (adding short swipes somehow helps predicting medium swipes better)

add the short swipe gestures with editing:

nano ~/.config/sxmo/hooks/

and add:

-g "1,RL,*,S,setsid -f shortoneleft" \ 
-g "1,LR,*,S,setsid -f shortoneright" \

keep in mind that the order where you write it, matters!

To define a gesture only when a specific program is running, search for your hardware specific


and when found, copy it to your user config:

cp /usr/share/sxmo/default_hooks/oneplus,enchilada/ ~/.config/sxmo/hooks/

In this example we add a custom firefox prev/next swipe gesture handler:

nano ~/.config/sxmo/hooks/

just below this lines:

#special context-sensitive handling
case "$WMCLASS" in

Add this:

case "$WMCLASS" in
                case "$ACTION" in
                       -M Alt -P Right -p Right -m Alt
                                exit 0
                       -M Alt -P Left -p Left -m Alt
                                exit 0

The swipes actually works best when in the address bar, but you should for sure tweak your Firefox to get rid of tabs, see below in this wiki.


If afterwards something does not work, like menu opening or whatever, you made a typo somewhere, when you are an idiot like me, who has no computer and is doing the changes directly on phone, there might be typos....

Corner Swipes

Now we know the the concept.

Lets change the button left corner to show the power status and remaining time of our battery:

For this, again in we look for the line:


lets comment: set lock

and write instead: ~/.config/sxmo/userscripts/

before and after the else

and we also want to access the powerlevel without unlocking the phone, so just above:

        #we're locked, don't process the rest of the script
        exit 0

we add:



Customize Hardware Buttons for your App

When not already there, copy inputhandler to user.

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

Now you can start modifying what the volume and power buttons shall do when a specific programm is running.

Note that it can also handle headless running scripts and is not bound to names of sway windows.

In this example we look for which, when running, should be killed with the volume up key:

nano ~/.config/sxmo/hooks/

I have no exact idea whats going on here, so i search for


and go to the result which looks ok'ish to me below #standard handling , after ~line 338 something and add the kill command to:

		kill $(pgrep my_script) #kill my tool, comments are important!

This should be it.

How to add more button functions

There is this nice script which gives me information about the powerlevel. It would be nice to have fast access to it. So we would like to push the Power Button four times (since all other pushes are useful used).

we already know

nano ~/.config/sxmo/hooks/

and we know the section #standard handling

		exit 0

where we easy could change to whatever we'd like.

Since we want to trigger on 4 pushes, we create a new entry containing:

		exit 0

But we also need to get the information that the knob is pushed 4 times.

So we have to edit:

nano .config/sxmo/bonsai_tree.json

wow, what a file, looks like an art drawing, however, since I am editing all the satuff you see and read here on one of my phones, this is a really difficult one... lets add below we:

                "type": "event",
                "event_name": "power_released",
                "transitions": [
                    "type": "exec",
                    "command": [

                "type": "event",
                "event_name": "power_released",
                "transitions": [
                    "type": "exec",
                    "command": [
                "type": "event",
                "event_name": "power_released",
                "transitions": [
                    "type": "exec",
                    "command": [

Then restart bonsaid with

superctl restart bonsaid

If it throws no error, you did good in counting brackets...

Here we realize it way too hard to hit it 4 times, but i leave the write up as reference

How you can do it the bad way

Go to /dev/input/by-path/ check each entry with cat and pushing on some buttons:

cat /dev/input/by-path/platform-gpio-keys-event

you will get weird output, but you get some output. yea! Since there are several events in /dev/input/by-path/ you can just count them from top to buttom to know eachs number for the next step. Mine was the 3rd.

So this time we check

 cat /dev/input/event3 

or whichever will react to your button presses.

As soon as you found it, you can listen to it in as simple as:

while true; do
if inotifywait -e modify /dev/input/event3: then
echo "its pressed, lets execute something"

insted of just an echo, you could kill your script with:

kill $(pgrep

Firefox Tweaks

Mobile friendlier layout

first we need to get bash support:

sudo apk add bash

then we remove the standard solution:

sudo apk del mobile-config-firefox 

then we grab user0`s script from codeberg, make it executable and run it (make sure to select "Add Recommended Preferences"):

git clone
sudo chmod +x Mobile-Friendly-Firefox/
bash Mobile-Friendly-Firefox/

Disable warning when closing tabs:

micro ~/.mozilla/firefox/*.default-release/user.js

set it to false.

Remove Items from URL Bar

Long click onto the item and select remove.

Force Website Mobile

Some websites do not show in mobile version and are then hard to read. Press:

 ctrl + shift + m 

and select iphoneSE layout on top left.

Block Search Results

Get rid of reddit, pinterest etc.


generate the filterlist and copy it to your ublock MyFilters.

Search Engine

By default, mobile-config-firefox adds a policies entry to get rid of invasive stuff.

While this is a great idea it my cause some trouble for users living in non-free countries.

To enable google search engine, you can edit:


Be aware that, in a free country, it makes sense to avoid as search engine and at least use startpage, 4get, SearxNG, or any other search which does not expose your privacy.

"I need privacy, not because my actions are questionable, because the judgement and intentions of big institutions are questionable"

Delete SMS

This is WIP The whole magic must go into /usr/bin/

To find out a list who texted so far: $( --texted)

They lay in .local/share/sxmo/modem/<sender>/sms.txt


Create a list of all text messages with $( --texted), display this list in a bmenu, when selected => promt: sure? | cancel => rm .local/share/sxmo/modem/

First try to understand the existing code, then write a a delete only script, finally implement into

Battery Empty Warning


Send a warning and shutdown at the right time. see issue.

My solution is a custom hook, which works, but misses a function to tell 'yes i know, dont send me more warning prompts'.

Audio Equalizer & Effects

Make sure you installed

sudo apk add easyeffects lsp-plugins lsp-plugins-lv2 calf

Start your audioplayer and launch easyeffects to make quality adjustments.

The layout has its challanges. Maybe we can send a gtk scaling command when opening.

Output and Recording volume can be adjusted with alsamixer

To test your microphone, visit and record something.


since i do not understand pipewire audio, i start to dig and document here. a good base to start is its documentation:


as in the time of writing, there is no option to select audio output through the earpiece. you have to run pavucontrol go to Configuration and select the Make a phone call profile. Then we are able to play music for maybe a minute before it crashes/freezes. By analyzing all configurations the only difference between all sinks and the earpiece: in unused state all sinks are SUSPENDED, but the earpiece is IDLE.

You can check with:

pactl list short sinks

there is also a very nice tool for a node based view of audio in-/outputs:


what i try to do is to play music over the speaker and switch this while playing to the earpiece. its the first step into debugging why calls dont really work. I think the error lies in loading this profiles in runtime. so far i could not figure out why we switch profiles instead of having all in/outputs in one profile and switch the stuff with a mixer. with this approach we could also switch music from loudspeaker to earpiece when wanted and i guess evwrything would stay more stable.. so lets dig where to write such a basic configuration file... wip

For a nice understanding of the audio routing:

 wpctl status

in sxmo the stuff gets switched with /usr/share/sxmo/default_hooks/ enable and /usr/bin/ over dbus.

Install Stock Android 9.0.8

Using edl mode

Especially when you have errors, wrong partitions, broken gps or broken wifi, it makes sense to bring the OnePlus 6 back to a factory state with this method, be aware that it might take some time and nerves. Sometimes you need to repeat steps, but this method works. There is still a lot of stuff going on behind the scenes we dont know and cant understand.

Install following tools first:

- If you are not a Linux user, run bkerler`s liveCD image instead.

- Don`t use any fancy usb cable with blinking led`s and super highspeed charging capabilities.

For OnePlus6, download (its on your search engine).

Unpack and decrypt payload:

 payload-dumper-go payload.bin

Now is time to start the first edl command written further down. It will wait for a device, filling the terminal with dots ..... then bring your phone into edl mode:

  1. Turn off phone
  2. Hold volume up + volume down
  3. Plugin usb cable (you should feel a vibration)
  4. The edl command which wrote some dots in terminal, now starts to execute 

(on your computer, while the phone screen stays black and only a white led next to the earpiece is shown)

  5. Write all necessary files with the edl tool:

./edl w boot_a boot.img
./edl w boot_b boot.img

./edl w dtbo_a dtbo.img
./edl w dtbo_b dtbo.img

./edl w abl_a abl.img
./edl w abl_b abl.img

./edl w aop_a aop.img
./edl w aop_b aop.img

./edl w bluetooth_a bluetooth.img
./edl w bluetooth_b bluetooth.img

./edl w cmnlib_a cmnlib.img
./edl w cmnlib_b cmnlib.img

./edl w cmnlib64_a cmnlib64.img
./edl w cmnlib64_b cmnlib64.img

./edl w devcfg_a devcfg.img
./edl w devcfg_b devcfg.img

./edl w dsp_a dsp.img
./edl w dsp_b dsp.img

./edl w fw_4j1ed_a fw_4j1ed.img
./edl w fw_4j1ed_b fw_4j1ed.img

./edl w fw_4u1ea_a fw_4u1ea.img
./edl w fw_4u1ea_b fw_4u1ea.img

./edl w hyp_a hyp.img
./edl w hyp_b hyp.img

./edl w keymaster_a keymaster.img
./edl w keymaster_b keymaster.img

./edl w LOGO_a LOGO.img
./edl w LOGO_b LOGO.img

./edl w modem_a modem.img
./edl w modem_b modem.img

./edl w oem_stanvbk oem_stanvbk.img

./edl w qupfw_a qupfw.img
./edl w qupfw_b qupfw.img

./edl w storsec_a storsec.img
./edl w storsec_b storsec.img

./edl w system_a system.img
./edl w system_b system.img

./edl w tz_a tz.img
./edl w tz_b tz.img

./edl w vbmeta_a vbmeta.img
./edl w vbmeta_b vbmeta.img

./edl w vendor_a vendor.img
./edl w vendor_b vendor.img

./edl w xbl_a xbl.img
./edl w xbl_b xbl.img

./edl w xbl_config_a xbl_config.img
./edl w xbl_config_a xbl_config.img

./edl reset

  6. After rebooting the phone into Android, enable wifi, bluetooth, location.
     Sometimes it just hangs in a google animation. You can ignore this and start flashing pmos with pmbootstrap.
  7. Flash PostmarketOS with pmbootstrap
  8. fastboot erase dtbo


- If you have a bootloop, just run first edl command, try pressing all buttons on phone and plugin usb cable repetitively until edl catches the phone, then proceed.

- Trying to downgrade android with edl can also result in a kind of dead phone (no response, just black, very hard to get edl mode again). I had this on a 256GB version the trick here is time consuming but it works:

first edl OnePlus6Oxygen_22.J.62_OTA_0620_all_2111252336_287bcb1636d743d3, then boot into fastboot and install twrp:

fastboot flash recovery

then boot into twrp and push the zip:

adb push /sdcard

then in twrp select install and install the zip

boot, this will take a while but you are in android 9.0.2, next get copy it to the phone and install it from the software installer menu. Then switch to fastboot set_active b and do the same. Finally you did it, you have Android 9.0.8 on your OP6 to be ready to flash PostmarketOS. Please drop me a line if this helped you :-)

- If you think your phone is bricked, there is a 99,9% chance that it is not bricked! Push the power button very long to turn it off, then push all buttons and plugin the usb cable, try this a hundred times, sometimes restart edl, switch to different usb slots on your computer, it will bring it once into edl mode.... just keep on plugin/out and remember to take a tee break before you loose your nerves... if i can do it, you can do it!

- I installed LineageOS, Android, Ubports, Droidian, Mobian, PostmarketOS, bricked the partitions, had a dead phone, had boot loops, somehow i always brought it back to life (its just annoying and time consuming).

Icon WARNING: If you see a 'crash dump' screen, plug the phone again to your computer and run edl without any commands. Provide the logs here.

external screen

copied from matrix channel:

This can be achieved with the 6T/6: see this issue/discussion: You need to manually switch to Host mode (see the OP6 wiki) (instead of the automatic switching for OTG that others mentioned earlier) You also need to enable certain kernel options: forspecifically DRM_UDL: Use the links above to see if you can get the HP adapter mentioned off eBay. Any DL-1x5 or DL-1x0 firmware models (wavlink, pluggable, diamond, HP, sabrent, siig all have models that are compatible)

To do List

Some nice mods:

  • check of there is a click and drag issue in the touchpad emulator patch and fix it.
  • merge and into one script..
  • gestures: 3 finger down makes screenshot; change workspace to buttom swipe; 3 finger up open scaling. sadly this interacts with the running applications...
  • modify the youtube script or write a newone to audio download: yt-dlp -f 251 -x $URL
  • fix the various headphone, speaker icons on sxmobar to be less clutered and more locical (hooks/

  • get modified Networks Menu /usr/bin/ here which contains nice menu entries: ssh toggle, gsm toggle, wifi credentials.

create a .desktop entry in ~/.local/share/applications/superfile.desktop:

[Desktop Entry]

add it to ~/.configs/mimeapps.list:


  • fix the prevent from sleep while listening audio: investigate for a better solution since people reported false positives woth this:
cp /usr/share/sxmo/default_hooks/ ~/.config/sxmo/hooks/

insert to check if an audio device is active:

audio_active() {
   pactl list sinks | grep -q 'State: RUNNING'

and in the loop below:

wait_item audio_active
  • fix flashlight, remove the full line: export SXMO_DISABLE_LED line from deviceprofile.


and make the changes in for the status leds.

  • enable mac randomization, just rm /etc/NetworkManager/conf.d/00-sxmo.conf
  • fix sxmo contextmenu for micro (line 269/270 remove -m ctrl): copy, paste, search, search back, search forward

Stuff i want to do next:

maybe also this seems to be faster:

  • how to use hydra to get around annoying hotel captive portals wich only last for a certain amount of time
  • sms deleter

Essential sxmo wiki sites

Essential Packages

default sxmo apps which are defined in mimetypes but not installed by default in pmos and should be added:




Following is just a note to myself:

gnome-calculator loupe gnome-keyring rsync nano bash-completion networkmanager-openvpn bash vnstat zxing tesseract-ocr tesseract-ocr-data-eng wl-clipboard imagemagick wf-recorder calcurse git git-email macchanger numberstation pure-maps gnome-passwordsafe flatpak syncthing amberol dino podman tor lyrebird foliate nheko baobab gcc alpine-sdk krita kdenlive

Terminal Apps


I hate flatpaks, they eat all my data and diskspace. Its like a truck delivering an envelope...

flatpak remote-add --if-not-exists flathub

sudo flatpak install flathub
sudo flatpak install flathub de.schmidhuberj.Flare

Briar Secure Messenger does not run due to missing