~mil/sxmo-utils

fa3550c638b27e274e646b3a07885d5288da55ad — Miles Alan 1 year, 6 months ago b4c02ac 1.0.9
Add warnings to modem scripts if the modem is not present
M scripts/core/sxmo_statusbar.sh => scripts/core/sxmo_statusbar.sh +1 -1
@@ 12,7 12,7 @@ touch $UPDATEFILE

while :
do
        # M symbol if modem monitoring is on
        # M symbol if modem monitoring is on & modem present
        MODEMMON=""
        pgrep -f sxmo_modemmonitor.sh && MODEMMON="M "


M scripts/core/sxmo_xinit.sh => scripts/core/sxmo_xinit.sh +0 -1
@@ 7,7 7,6 @@ xmodmap /usr/share/sxmo/xmodmap_caps_esc
xsetroot -mod 3 2 -fg '#000000' -bg '#888888'
xset s off -dpms
alsactl --file /usr/share/sxmo/default_alsa_sound.conf restore
sxmo_modemmonitor.sh &
#xset r off

# E.g. for PBP

M scripts/modem/sxmo_modemcall.sh => scripts/modem/sxmo_modemcall.sh +3 -1
@@ 10,7 10,9 @@ err() {
}

modem_n() {
  mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
  MODEMS="$(mmcli -L)"
  echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' > /dev/null || err "Couldn't find modem - is you're modem enabled?"
  echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
}

contacts() {

M scripts/modem/sxmo_modeminfo.sh => scripts/modem/sxmo_modeminfo.sh +9 -1
@@ 1,6 1,14 @@
#!/usr/bin/env sh

err() {
	echo -e "$1" | dmenu -fn Terminus-20 -c -l 10
	exit
}

modem_n() {
  mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
  MODEMS="$(mmcli -L)"
  echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' > /dev/null || err "Couldn't find modem - is you're modem enabled?"
  echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
}

st -e sh -c "mmcli -m $(modem_n) && read"

M scripts/modem/sxmo_modemmonitor.sh => scripts/modem/sxmo_modemmonitor.sh +9 -1
@@ 2,9 2,17 @@
TIMEOUT=3
LOGDIR=/home/$USER/.sxmo
ACTIVECALL="NONE"
trap "kill 0" SIGINT

err() {
	echo -e "$1" | dmenu -fn Terminus-20 -c -l 10
	kill -9 0
}

modem_n() {
  mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
  MODEMS="$(mmcli -L)"
  echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' > /dev/null || err "Couldn't find modem - is you're modem enabled?\nDisabling modem monitor"
  echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
}

newcall() {

M scripts/modem/sxmo_modemtext.sh => scripts/modem/sxmo_modemtext.sh +3 -1
@@ 8,7 8,9 @@ err() {
}

modem_n() {
	mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
  MODEMS="$(mmcli -L)"
  echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' > /dev/null || err "Couldn't find modem - is you're modem enabled?"
  echo "$MODEMS" | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2
}

textcontacts() {