diff --git a/configs/default_hooks/sxmo_hook_postwake.sh b/configs/default_hooks/sxmo_hook_postwake.sh index 7067f03..c605f6f 100755 --- a/configs/default_hooks/sxmo_hook_postwake.sh +++ b/configs/default_hooks/sxmo_hook_postwake.sh @@ -6,10 +6,12 @@ # shellcheck source=scripts/core/sxmo_common.sh . sxmo_common.sh -MMCLI="$(mmcli -m any -J 2>/dev/null)" -if [ -z "$MMCLI" ]; then - sxmo_notify_user.sh "Modem crashed! 30s recovery." - sxmo_wakelock.sh lock sxmo_modem_crashed 30s +if [ -z "$SXMO_NO_MODEM" ]; then + MMCLI="$(mmcli -m any -J 2>/dev/null)" + if [ -z "$MMCLI" ]; then + sxmo_notify_user.sh "Modem crashed! 30s recovery." + sxmo_wakelock.sh lock sxmo_modem_crashed 30s + fi fi # Add here whatever you want to do diff --git a/configs/default_hooks/sxmo_hook_start.sh b/configs/default_hooks/sxmo_hook_start.sh index 659034e..6615ee6 100755 --- a/configs/default_hooks/sxmo_hook_start.sh +++ b/configs/default_hooks/sxmo_hook_start.sh @@ -82,7 +82,7 @@ if [ ! -e "$XDG_CACHE_HOME"/sxmo/sxmo.nogesture ]; then superctl start sxmo_hook_lisgd fi -if [ "$(command -v ModemManager)" ]; then +if [ -z "$SXMO_NO_MODEM" ] && command -v ModemManager > /dev/null; then # Turn on the dbus-monitors for modem-related tasks superctl start sxmo_modemmonitor @@ -110,12 +110,14 @@ superctl start sxmo_soundmonitor #mpv --quiet --no-video ~/welcome.ogg & # mmsd and vvmd -if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then - superctl start mmsd-tng -fi +if [ -z "$SXMO_NO_MODEM" ]; then + if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then + superctl start mmsd-tng + fi -if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then - superctl start vvmd + if [ -f "${SXMO_VVM_BASE_DIR:-"$HOME"/.vvm/modemmanager}/vvm" ]; then + superctl start vvmd + fi fi # add some warnings if things are not setup correctly diff --git a/configs/default_hooks/sxmo_hook_statusbar.sh b/configs/default_hooks/sxmo_hook_statusbar.sh index 9be9d47..baf9cb1 100755 --- a/configs/default_hooks/sxmo_hook_statusbar.sh +++ b/configs/default_hooks/sxmo_hook_statusbar.sh @@ -433,14 +433,18 @@ case "$1" in ;; periodics|state_change) # 55 s loop and screenlock triggers set_time - set_modem + if [ -z "$SXMO_NO_MODEM" ]; then + set_modem + fi set_state set_network wifi wlan0 ;; all) sxmobar -r set_time - set_modem + if [ -z "$SXMO_NO_MODEM" ]; then + set_modem + fi set_volume set_state set_notifications diff --git a/scripts/deviceprofiles/README.md b/scripts/deviceprofiles/README.md index 67832e6..dead6ff 100644 --- a/scripts/deviceprofiles/README.md +++ b/scripts/deviceprofiles/README.md @@ -41,6 +41,8 @@ Supported variables used by sxmo are: export SXMO_MODEM_GPIO_KEY_RI | If the modem driver handle a gpio, sxmo have to know it to disable the events from this input source. +export SXMO_NO_MODEM | Disable modem related features + ### Screen-related SXMO_ROTATION_POLL_TIME | Polling time for rotate in seconds (decimals allowed e.g. .1) [default: 1] diff --git a/scripts/deviceprofiles/sxmo_deviceprofile_desktop.sh b/scripts/deviceprofiles/sxmo_deviceprofile_desktop.sh index dfafa22..de5d6f1 100644 --- a/scripts/deviceprofiles/sxmo_deviceprofile_desktop.sh +++ b/scripts/deviceprofiles/sxmo_deviceprofile_desktop.sh @@ -3,3 +3,4 @@ export SXMO_STATUS_DATE_FORMAT="%Y-%m-%d %H:%M" export SXMO_DISABLE_KEYBINDS=1 export SXMO_STATES="unlock locker" export SXMO_UNLOCK_IDLE_TIME=300 +export SXMO_NO_MODEM=1 diff --git a/scripts/deviceprofiles/sxmo_deviceprofile_kobo,clarahd.sh b/scripts/deviceprofiles/sxmo_deviceprofile_kobo,clarahd.sh index e6b8288..b197dac 100644 --- a/scripts/deviceprofiles/sxmo_deviceprofile_kobo,clarahd.sh +++ b/scripts/deviceprofiles/sxmo_deviceprofile_kobo,clarahd.sh @@ -11,3 +11,4 @@ export SXMO_SUSPENDABLE_STATES="unlock 120" export SXMO_ROTATE_DIRECTION="left" export SXMO_ROTATE_START=1 export SXMO_MIN_BRIGHTNESS=0 # to disable all backlight +export SXMO_NO_MODEM=1 diff --git a/scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinenote.sh b/scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinenote.sh index 908eef8..8b4d859 100755 --- a/scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinenote.sh +++ b/scripts/deviceprofiles/sxmo_deviceprofile_pine64,pinenote.sh @@ -21,3 +21,4 @@ export SXMO_SPEAKER="Master" export SXMO_SWAY_SCALE="2" export SXMO_STATES="unlock" export SXMO_SUSPENDABLE_STATES="unlock 120" +export SXMO_NO_MODEM=1