Use USR1 signal instead of update file for updating statusbar
This commit is contained in:
parent
f448f3c444
commit
87c99ec024
7 changed files with 11 additions and 22 deletions
|
@ -17,4 +17,4 @@ elif [ "$ARG" = "Earpiece" ]; then
|
||||||
amixer set "$EARPIECE" unmute
|
amixer set "$EARPIECE" unmute
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 1 > /tmp/sxmo_bar
|
pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
#!/usr/bin/env sh
|
#!/usr/bin/env sh
|
||||||
|
trap "update" USR1
|
||||||
pgrep -f sxmo_statusbar.sh | grep -v $$ | xargs kill -9
|
pgrep -f sxmo_statusbar.sh | grep -v $$ | xargs kill -9
|
||||||
|
|
||||||
UPDATEFILE=/tmp/sxmo_bar
|
|
||||||
touch "$UPDATEFILE"
|
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
# In-call.. show length of call
|
# In-call.. show length of call
|
||||||
CALLINFO=" "
|
CALLINFO=" "
|
||||||
|
@ -54,20 +52,10 @@ update() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# E.g. on first boot justs to make sure the bar comes in quickly
|
# E.g. on first boot justs to make sure the bar comes in quickly
|
||||||
update && sleep 1 && update && sleep 1 && update
|
update && sleep 1 && update && sleep 1
|
||||||
|
|
||||||
periodicupdate() {
|
|
||||||
while :
|
|
||||||
do
|
|
||||||
echo 1 > "$UPDATEFILE"
|
|
||||||
sleep 30
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
periodicupdate &
|
|
||||||
|
|
||||||
while :
|
while :
|
||||||
do
|
do
|
||||||
update
|
update
|
||||||
inotifywait -e MODIFY "$UPDATEFILE"
|
sleep 30 & wait
|
||||||
done
|
done
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
change() {
|
change() {
|
||||||
echo "Changing timezone to $1"
|
echo "Changing timezone to $1"
|
||||||
sudo setup-timezone -z "$1"
|
sudo setup-timezone -z "$1"
|
||||||
echo 1 > /tmp/sxmo_bar
|
pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1
|
||||||
echo Timezone changed ok
|
echo Timezone changed ok
|
||||||
read -r
|
read -r
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ notify() {
|
||||||
xargs printf %.0f
|
xargs printf %.0f
|
||||||
)"
|
)"
|
||||||
dunstify -i 0 -u normal -r 998 "♫ $VOL"
|
dunstify -i 0 -u normal -r 998 "♫ $VOL"
|
||||||
echo 1 > /tmp/sxmo_bar
|
pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1
|
||||||
}
|
}
|
||||||
|
|
||||||
up() {
|
up() {
|
||||||
|
|
|
@ -2,13 +2,14 @@
|
||||||
LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem
|
LOGDIR="$XDG_CONFIG_HOME"/sxmo/modem
|
||||||
trap "gracefulexit" INT TERM
|
trap "gracefulexit" INT TERM
|
||||||
|
|
||||||
|
|
||||||
fatalerr() {
|
fatalerr() {
|
||||||
# E.g. hangup all calls, switch back to default audio, notify user, and die
|
# E.g. hangup all calls, switch back to default audio, notify user, and die
|
||||||
sxmo_vibratepine 1000 &
|
sxmo_vibratepine 1000 &
|
||||||
mmcli -m "$(mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2)" --voice-hangup-all
|
mmcli -m "$(mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2)" --voice-hangup-all
|
||||||
alsactl --file /usr/share/sxmo/default_alsa_sound.conf restore
|
alsactl --file /usr/share/sxmo/default_alsa_sound.conf restore
|
||||||
notify-send "$1"
|
notify-send "$1"
|
||||||
setsid -f sh -c 'sleep 2; echo 1 > /tmp/sxmo_bar'
|
setsid -f sh -c 'sleep 2; pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1'
|
||||||
kill -9 0
|
kill -9 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +121,7 @@ incallsetup() {
|
||||||
incallmonitor() {
|
incallmonitor() {
|
||||||
CALLID="$1"
|
CALLID="$1"
|
||||||
while true; do
|
while true; do
|
||||||
echo 1 > /tmp/sxmo_bar
|
pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1
|
||||||
if mmcli -m "$(modem_n)" -K -o "$CALLID" | grep -E "^call.properties.state.+terminated"; then
|
if mmcli -m "$(modem_n)" -K -o "$CALLID" | grep -E "^call.properties.state.+terminated"; then
|
||||||
fatalerr "Call with $NUMBER terminated"
|
fatalerr "Call with $NUMBER terminated"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -5,7 +5,7 @@ fatalerr() {
|
||||||
# E.g. hangup all calls, switch back to default audio, notify user, and die
|
# E.g. hangup all calls, switch back to default audio, notify user, and die
|
||||||
mmcli -m "$(mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2)" --voice-hangup-all
|
mmcli -m "$(mmcli -L | grep -oE 'Modem\/([0-9]+)' | cut -d'/' -f2)" --voice-hangup-all
|
||||||
notify-send "$1"
|
notify-send "$1"
|
||||||
(sleep 0.5; echo 1 > /tmp/sxmo_bar) &
|
(sleep 0.5; pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1) &
|
||||||
kill -9 0
|
kill -9 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,4 +10,4 @@ rm /tmp/sxmo_incomingcall
|
||||||
# E.g. wait until process killed or started -- maybe there's a better way..
|
# E.g. wait until process killed or started -- maybe there's a better way..
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
echo 1 > /tmp/sxmo_bar
|
pgrep -f "$(command -v sxmo_statusbar.sh)" | xargs kill -USR1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue