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
  Manjaro plasma-mobile Beta 13 Uturn 13 966 01-25-2023, 04:15 PM
Last Post: Kevin Kofler
Exclamation My short experience with Manjaro Plasma Mobile anonymous 8 563 01-06-2023, 07:28 AM
Last Post: _radv_
  Manjaro Plasma busted Chief 2 457 11-22-2022, 05:00 PM
Last Post: Chief
Question Running AnBox on Manjaro ARM w/ Phosh? danimations 2 1,260 09-05-2022, 03:42 PM
Last Post: nroth
  manjaro-pinephone / plasma-mobile-dev: Update broken Uturn 32 20,294 07-28-2022, 12:40 PM
Last Post: johaennessen
  Kalendar in Manjaro Plamo Uturn 1 634 07-20-2022, 08:30 AM
Last Post: Uturn
  Manjaro (Plasma OS) bugs/ issues FOSSagent0 35 28,678 07-15-2022, 09:35 PM
Last Post: Tim_D
Sad Latest Manjaro breaks Keyboard Case (Again)? hollerpots 4 1,367 06-17-2022, 07:48 AM
Last Post: hollerpots
  ttyescape on manjaro lolgzs 0 511 05-27-2022, 02:14 PM
Last Post: lolgzs
Lightbulb Using the fingerprint scanner w/ Manjaro danimations 0 532 04-10-2022, 07:34 PM
Last Post: danimations

Forum Jump:


Users browsing this thread: 1 Guest(s)