Add RTTTL/eMelody/iMelody ringtones and separate notification/SMS sound config
This commit is contained in:
1 parent
c766f6c53b
commit
9c28fa1e4c
46 files changed
+2452
-148
No files matched your search
Executable
BIN
Binary file not shown.
@@ -29,6 +29,7 @@ clear_all() {
|
||||
|
||||
_handle_new_notif_file() {
|
||||
file="$1"
|
||||
mode="$2"
|
||||
[ -f "$file" ] || return 0
|
||||
|
||||
if [ "$(wc -l < "$file" 2>/dev/null || echo 0)" -lt 3 ]; then
|
||||
@@ -37,7 +38,9 @@ _handle_new_notif_file() {
|
||||
return 0
|
||||
fi
|
||||
|
||||
sxmo_hook_notification.sh "$file" &
|
||||
if [ "$mode" != "boot" ]; then
|
||||
sxmo_hook_notification.sh "$file" &
|
||||
fi
|
||||
|
||||
group="$(awk NR==1 "$file" 2>/dev/null)"
|
||||
action="$(awk NR==2 "$file" 2>/dev/null)"
|
||||
@@ -70,7 +73,7 @@ monitor() {
|
||||
mkdir -p "$SXMO_NOTIFDIR"
|
||||
|
||||
find "$SXMO_NOTIFDIR" -type f 2>/dev/null | while read -r file; do
|
||||
_handle_new_notif_file "$file"
|
||||
_handle_new_notif_file "$file" "boot"
|
||||
done
|
||||
|
||||
_notifications_hook
|
||||
@@ -112,6 +115,7 @@ menu() {
|
||||
choices="$(cat <<EOF
|
||||
$icon_del Clear Notifications
|
||||
$(_menu_lines)
|
||||
$icon_bel Notification Sound
|
||||
$icon_cls Close Menu
|
||||
EOF
|
||||
)"
|
||||
@@ -130,6 +134,10 @@ EOF
|
||||
clear_all
|
||||
exit
|
||||
;;
|
||||
"$icon_bel Notification Sound")
|
||||
setsid -f xringtones --notif >/dev/null 2>&1
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
file="$(
|
||||
printf "%b" "$choices" |
|
||||
@@ -187,6 +195,10 @@ new() {
|
||||
mkdir -p "$SXMO_NOTIFDIR"
|
||||
printf "%s\n%s\n%b\n" "$group" "$action" "$msg" > "$SXMO_NOTIFDIR/$id"
|
||||
|
||||
if ! pgrep -f "sxmo_notifs.sh monitor" >/dev/null 2>&1; then
|
||||
sxmo_hook_notification.sh "$SXMO_NOTIFDIR/$id" &
|
||||
fi
|
||||
|
||||
sxmo_hook_statusbar.sh notifications
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user