MMS workaround for users with separate APN (works atleast on Manjaro Phosh)
#1
Hello!

While we are waiting multiplexing APN support I have tried to find out some workaround so that I don't lose MMS messages.
This is not perfect and many solutions might be wrong but hey at least it is working automated Big Grin
I am using this same script to improve battery life so all "gsettings" parts are not necessary but they make the phone suspend much much faster if screen is locked.

If you wan't to find out more about this original issue see here:
https://gitlab.com/kop316/mmsd/-/issues/5
https://gitlab.freedesktop.org/NetworkMa...issues/958

So first we need two bash scripts and lets call this first one start.sh
(Copy the text above and paste it to gedit and save it to your home folder)
Code:
#!/bin/bash
gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 60 & gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 60 && sleep 50 && /home/manjaro/lock.sh

Then we need second one and lets call this lock.sh
(Copy the text above and paste it to gedit and save it to your home folder)
Code:
#!/bin/bash
dbus-monitor --session "type='signal',interface='org.gnome.ScreenSaver'" |
while read x; do
    case "$x" in
    *"boolean true"*) nmcli c up "dna mms" & sleep 2 && gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 5 & gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 5;;
    *"boolean false"*) nmcli c up "dna internet" & gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-battery-timeout 60 & gsettings set org.gnome.settings-daemon.plugins.power sleep-inactive-ac-timeout 60;;
    esac
    done
Notice that you have to use your carriers APN names and the names needs to be the same as in System settings and as in Chatty (nmcli c up "dna mms" and nmcli c up "dna internet". If the APN name is only one word you don't need to use these marks "

And then we need to add one file to /home/manjaro/.config/autostart and that will be start.desktop
(Copy the text above and paste it to gedit and save it to /home/manjaro/.config/autostart)
Code:
[Desktop Entry]
Version=1.0
Name=MMS-Switch
Comment=Switch MMS and Data APN regarding the lock screen status
Exec=/home/manjaro/start.sh
Icon=org.gnome.Terminal
Terminal=falce
Type=Application

Then you have to open terminal and paste
Code:
sudo chmod +x /home/manjaro/lock.sh && sudo chmod +x /home/manjaro/start.sh

Then just reboot and now you should have working MMS switch. It will switch to MMS APN when you lock the screen and when you unlock it will switch back to Data APN. And if you don't remove the gsettings parts it will suspend in 5 second when on lock screen and in 60 seconds when you are logged in and using phone Smile

Then there is one funny thing - to get all of this working you most likely need to switch to MMS APN trough System settings and then reboot (needs to do it only once). After latest updates Manjaro Phosh will switch to APN which was selected from System Settings when it resumes from suspend. I have no idea where it is coming from but this is the case at least in my scenario.

I think this should work also with Mobian and Arch but have not tested.
My skills are limited so this is not really good solution but at least it is working and I can trust that I don't miss important messages.

I suggest also to create these shortcut launchers to /home/.local/share/applications. The first one sets APN to MMS and after that starts Chatty so you can send MMS messages also. The second one just changes APN to Data so you can switch back or just relaunch internet connection if needed.
(Copy the text above and paste it to gedit and save it to /home/manjaro/.local/share/applications)
Code:
[Desktop Entry]
Version=1.0
Name=Chatty MMS
Comment=Change to MMS apn and open Chatty
Exec=bash -c 'nmcli c up "dna mms" && chatty'
Icon=sm.puri.Chatty
Terminal=falce
Type=Application
Code:
[Desktop Entry]
Version=1.0
Name=Data On
Comment=Change to Data apn
Exec=bash -c 'nmcli c up "dna internet"'
Icon=org.gnome.Settings-network-symbolic
Terminal=falce
Type=Application


I tried many other ways but this was the only one I got to work automatically. It was so much easier with PMOS where you need to add only one script to one folder Big Grin
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Fractal/Matrix MMS workaround Noob Of All Trades 11 4,228 10-04-2023, 10:59 PM
Last Post: Noob Of All Trades
  Manjaro: Settings doesnt open nbh 0 875 09-24-2023, 05:25 PM
Last Post: nbh
  Can't get ring on Manjaro Pine Phone thorensjubilee 12 5,611 06-09-2023, 04:40 AM
Last Post: thorensjubilee
  Is Manjaro ARM a Rolling Release? jojuma 4 2,312 05-10-2023, 09:27 PM
Last Post: Kevin Kofler
  Where Does Manjaro Phosh Store Its Custom Keystrokes? jakfish 0 1,086 04-25-2023, 09:49 AM
Last Post: jakfish
Exclamation My short experience with Manjaro Plasma Mobile anonymous 10 6,764 03-02-2023, 07:25 PM
Last Post: Kevin Kofler
  Backup and Home Screen Tinkering on Phosh jakfish 0 1,081 02-24-2023, 12:56 PM
Last Post: jakfish
  Can't install Manjaro thorensjubilee 1 1,364 02-09-2023, 08:17 AM
Last Post: thorensjubilee
  Manjaro plasma-mobile Beta 13 Uturn 13 6,929 01-25-2023, 04:15 PM
Last Post: Kevin Kofler
  Manjaro Plasma busted Chief 2 2,049 11-22-2022, 05:00 PM
Last Post: Chief

Forum Jump:


Users browsing this thread: 1 Guest(s)