Cleanup logic for notification LED setting; increase default call volume
This commit is contained in:
		
							parent
							
								
									8e1c40e832
								
							
						
					
					
						commit
						45c571727c
					
				
					 3 changed files with 10 additions and 6 deletions
				
			
		| 
						 | 
					@ -351,9 +351,9 @@ static struct audio_setup audio_setup = {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        .dai2_en = false,
 | 
					        .dai2_en = false,
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        .hp_vol = 15,
 | 
					        .hp_vol = 25,
 | 
				
			||||||
        .spk_vol = 15,
 | 
					        .spk_vol = 25,
 | 
				
			||||||
        .ear_vol = 15,
 | 
					        .ear_vol = 25,
 | 
				
			||||||
        .mic_gain = 1,
 | 
					        .mic_gain = 1,
 | 
				
			||||||
        .hpmic_gain = 1,
 | 
					        .hpmic_gain = 1,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -152,6 +152,8 @@ incallmenuloop() {
 | 
				
			||||||
		DTMF Tones                                                        ^ dtmfmenu $CALLID
 | 
							DTMF Tones                                                        ^ dtmfmenu $CALLID
 | 
				
			||||||
		Hangup                                                            ^ hangup $CALLID
 | 
							Hangup                                                            ^ hangup $CALLID
 | 
				
			||||||
	"
 | 
						"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						pkill -9 dmenu # E.g. just incase user is playing with btns or hits a menu by mistake
 | 
				
			||||||
	echo "$CHOICES" | 
 | 
						echo "$CHOICES" | 
 | 
				
			||||||
		xargs -0 echo | 
 | 
							xargs -0 echo | 
 | 
				
			||||||
		cut -d'^' -f1 | 
 | 
							cut -d'^' -f1 | 
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,8 +11,10 @@ notificationhook() {
 | 
				
			||||||
	if [ -x "$XDG_CONFIG_HOME"/sxmo/hooks/notification ]; then
 | 
						if [ -x "$XDG_CONFIG_HOME"/sxmo/hooks/notification ]; then
 | 
				
			||||||
		"$XDG_CONFIG_HOME"/sxmo/hooks/notification
 | 
							"$XDG_CONFIG_HOME"/sxmo/hooks/notification
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
 | 
								sxmo_setpineled green 0
 | 
				
			||||||
			sxmo_vibratepine 200;
 | 
								sxmo_vibratepine 200;
 | 
				
			||||||
			sleep 0.1;
 | 
								sleep 0.1;
 | 
				
			||||||
 | 
								sxmo_setpineled green 1
 | 
				
			||||||
			sxmo_vibratepine 200;
 | 
								sxmo_vibratepine 200;
 | 
				
			||||||
			sleep 0.1;
 | 
								sleep 0.1;
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
| 
						 | 
					@ -25,7 +27,6 @@ handlenewnotiffile(){
 | 
				
			||||||
		echo "Invalid notification file $NOTIFFILE found (<3 lines -- see notif spec in sxmo_notifwrite.sh), deleting!" >&2
 | 
							echo "Invalid notification file $NOTIFFILE found (<3 lines -- see notif spec in sxmo_notifwrite.sh), deleting!" >&2
 | 
				
			||||||
		rm -f "$NOTIFFILE"
 | 
							rm -f "$NOTIFFILE"
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		sxmo_setpineled green 1;
 | 
					 | 
				
			||||||
		notificationhook &
 | 
							notificationhook &
 | 
				
			||||||
		NOTIFACTION="$(awk NR==1 "$NOTIFFILE")"
 | 
							NOTIFACTION="$(awk NR==1 "$NOTIFFILE")"
 | 
				
			||||||
		NOTIFWATCHFILE="$(awk NR==2 "$NOTIFFILE")"
 | 
							NOTIFWATCHFILE="$(awk NR==2 "$NOTIFFILE")"
 | 
				
			||||||
| 
						 | 
					@ -33,6 +34,7 @@ handlenewnotiffile(){
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if dunstify --action="2,open" "$NOTIFMSG" | grep 2; then
 | 
							if dunstify --action="2,open" "$NOTIFMSG" | grep 2; then
 | 
				
			||||||
			setsid -f sh -c "$NOTIFACTION" &
 | 
								setsid -f sh -c "$NOTIFACTION" &
 | 
				
			||||||
 | 
								rm -f "$NOTIFFILE"
 | 
				
			||||||
		elif [ -e "$NOTIFWATCHFILE" ]; then
 | 
							elif [ -e "$NOTIFWATCHFILE" ]; then
 | 
				
			||||||
			(inotifywait "$NOTIFWATCHFILE" && rm -f "$NOTIFFILE") &
 | 
								(inotifywait "$NOTIFWATCHFILE" && rm -f "$NOTIFFILE") &
 | 
				
			||||||
		fi
 | 
							fi
 | 
				
			||||||
| 
						 | 
					@ -48,7 +50,8 @@ recreateexistingnotifs() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
monitorforaddordelnotifs() {
 | 
					monitorforaddordelnotifs() {
 | 
				
			||||||
	while true; do
 | 
						while true; do
 | 
				
			||||||
		find "$NOTIFDIR"/ -type f -mindepth 1 | read -r || sxmo_setpineled green 0
 | 
							[ $(find "$NOTIFDIR"/ -type f | wc -l) -lt 1 ] && sxmo_setpineled green 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		inotifywait -e create,attrib,moved_to,delete,delete_self,moved_from "$NOTIFDIR"/ | (
 | 
							inotifywait -e create,attrib,moved_to,delete,delete_self,moved_from "$NOTIFDIR"/ | (
 | 
				
			||||||
			INOTIFYOUTPUT="$(cat)"
 | 
								INOTIFYOUTPUT="$(cat)"
 | 
				
			||||||
			INOTIFYEVENTTYPE="$(echo "$INOTIFYOUTPUT" | cut -d" " -f2)"
 | 
								INOTIFYEVENTTYPE="$(echo "$INOTIFYOUTPUT" | cut -d" " -f2)"
 | 
				
			||||||
| 
						 | 
					@ -61,6 +64,5 @@ monitorforaddordelnotifs() {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pgrep -f "$(command -v sxmo_notificationmonitor.sh)" | grep -Ev "^${$}$" | xargs kill
 | 
					pgrep -f "$(command -v sxmo_notificationmonitor.sh)" | grep -Ev "^${$}$" | xargs kill
 | 
				
			||||||
rm -f $NOTIFDIR/incomingcall
 | 
					rm -f $NOTIFDIR/incomingcall
 | 
				
			||||||
sxmo_setpineled green 0
 | 
					 | 
				
			||||||
recreateexistingnotifs
 | 
					recreateexistingnotifs
 | 
				
			||||||
monitorforaddordelnotifs
 | 
					monitorforaddordelnotifs
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue