Add modem/networks DWM plugins, Dual-SIM & PIN/PUK support, built-in dmenu views, and game UX fixes
This commit is contained in:
Regular → Executable
+9
@@ -9,6 +9,15 @@
|
||||
export PATH="${HOME:-/home/user}/.local/bin:${HOME:-/home/user}/.config/sxmo/hooks:/usr/share/sxmo/default_hooks:$PATH"
|
||||
. sxmo_hook_icons.sh
|
||||
|
||||
GAMES_CACHE="${XDG_RUNTIME_DIR:-/tmp}/sxmo_games.cache"
|
||||
if [ -f "$GAMES_CACHE" ] && [ ! "$0" -nt "$GAMES_CACHE" ] && [ ! /usr/bin -nt "$GAMES_CACHE" ] && [ ! /usr/local/bin -nt "$GAMES_CACHE" ] && [ ! "${HOME:-/home/user}/.local/bin" -nt "$GAMES_CACHE" ]; then
|
||||
cat "$GAMES_CACHE"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
exec 3>&1 > "$GAMES_CACHE.tmp"
|
||||
trap 'mv -f "$GAMES_CACHE.tmp" "$GAMES_CACHE" 2>/dev/null; cat "$GAMES_CACHE" >&3 2>/dev/null' EXIT
|
||||
|
||||
write_line() {
|
||||
printf "%s ^ 0 ^ %s\n" "$1" "$2"
|
||||
}
|
||||
|
||||
@@ -16,38 +16,31 @@ newstate="$2"
|
||||
sxmo_debug "$2 (old: $1 [reason: $3])"
|
||||
|
||||
case "$newstate" in
|
||||
"locked")
|
||||
sxmo_log "State is locked. Attempting to unlock."
|
||||
if ! pgrep -f "sxmo_unlocksim.sh" >/dev/null; then
|
||||
sxmo_unlocksim.sh
|
||||
fi
|
||||
;;
|
||||
"enabling")
|
||||
sxmo_log "State is enabling. Clearing stale call files."
|
||||
rm "$XDG_RUNTIME_DIR"/sxmo_calls/* 2>/dev/null
|
||||
rm -f "$SXMO_NOTIFDIR"/incomingcall* 2>/dev/null
|
||||
;;
|
||||
"registered")
|
||||
sxmo_log "State is registered. Checking for calls and messages."
|
||||
"locked")
|
||||
sxmo_log "State is locked. Opening SIM PIN/PUK unlock dialog."
|
||||
if command -v xmodem >/dev/null 2>&1; then
|
||||
xmodem unlock >/dev/null 2>&1 &
|
||||
elif ! pgrep -f "sxmo_unlocksim.sh" >/dev/null; then
|
||||
sxmo_unlocksim.sh &
|
||||
fi
|
||||
;;
|
||||
"enabling")
|
||||
sxmo_log "State is enabling. Clearing stale call files."
|
||||
rm "$XDG_RUNTIME_DIR"/sxmo_calls/* 2>/dev/null || true
|
||||
rm -f "$SXMO_NOTIFDIR"/incomingcall* 2>/dev/null || true
|
||||
;;
|
||||
"registered")
|
||||
sxmo_log "State is registered. Checking for calls and messages."
|
||||
|
||||
# kill the pin-entry dmenu if still open
|
||||
pkill -f sxmo_unlocksim.sh
|
||||
# kill the pin-entry dmenu if still open
|
||||
pkill -f sxmo_unlocksim.sh 2>/dev/null || true
|
||||
|
||||
sxmo_modem.sh checkforfinishedcalls
|
||||
sxmo_modem.sh checkforincomingcalls
|
||||
sxmo_modem.sh checkfornewtexts
|
||||
sxmo_modem.sh checkforstucksms
|
||||
if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
|
||||
sxmo_mms.sh checkforlostmms
|
||||
fi
|
||||
|
||||
# An example of something else to do here!
|
||||
#if ! ping -Iwwan0 -q -c 1 -W 10 www.google.com >/dev/null; then
|
||||
# sxmo_log "ping failed."
|
||||
# nmcli c down "MINTY"
|
||||
# nmcli c up "MINTY"
|
||||
#else
|
||||
# sxmo_log "ping ok."
|
||||
#fi
|
||||
;;
|
||||
sxmo_modem.sh checkforfinishedcalls
|
||||
sxmo_modem.sh checkforincomingcalls
|
||||
sxmo_modem.sh checkfornewtexts
|
||||
sxmo_modem.sh checkforstucksms
|
||||
if [ -f "${SXMO_MMS_BASE_DIR:-"$HOME"/.mms/modemmanager}/mms" ]; then
|
||||
sxmo_mms.sh checkforlostmms
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
|
||||
Reference in New Issue
Block a user