Allow to disable modem related features
Usefull on desktop, and e-reader devices. Disable some daemons, status bar icons, and error messages.
This commit is contained in:
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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]
|
||||
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user