gitea_get_notifications.sh: added cleanup path
This commit is contained in:
		
							parent
							
								
									2301757eb9
								
							
						
					
					
						commit
						f39462a835
					
				|  | @ -8,6 +8,11 @@ merge_count=0 | |||
| open_notis_count=0 | ||||
| fcount=0 | ||||
| 
 | ||||
| if [ "${gettype}" == "cleanup" ]; then | ||||
|     gettype="merged" | ||||
|     markmineread=true | ||||
| fi | ||||
| 
 | ||||
| if [ "${gettype}" == "merged" ]; then | ||||
|     open_noti=$(tea notification ls --mine | grep -E "^\| +[0-9]+.* Pull .* open " | sed -E 's/[ \|]/@@/g;s/@@+/@@/g;s/^@@//g;s/@@$//g') | ||||
| 
 | ||||
|  | @ -37,16 +42,12 @@ if [ "${gettype}" == "merged" ]; then | |||
|         fi | ||||
| 
 | ||||
|     done | ||||
| fi | ||||
| 
 | ||||
| if [ "${gettype}" == "open_all" ]; then | ||||
| elif [ "${gettype}" == "open_all" ]; then | ||||
|     open_notis=$(tea notification ls --mine | grep -E "^\| +[0-9]+.* Pull .* open " | sed -E 's/[ \|]/@@/g;s/@@+/@@/g;s/^@@//g;s/@@$//g') | ||||
|     if [ -n "${open_notis}" ]; then | ||||
|         open_notis_count=$(wc -l <<<"${open_notis}") | ||||
|     fi | ||||
| fi | ||||
| 
 | ||||
| if [ "${gettype}" == "open" ]; then | ||||
| elif [ "${gettype}" == "open" ]; then | ||||
|     open_notis=$(tea notification ls --mine | grep -E "^\| +[0-9]+.* Pull .* open " | sed -E 's/[ \|]/@@/g;s/@@+/@@/g;s/^@@//g;s/@@$//g') | ||||
|     for open_noti in ${open_notis}; do | ||||
|         noti_id="$(grep -oE "^[0-9]+" <<<"${open_noti}")" | ||||
|  | @ -73,4 +74,8 @@ elif [ $open_notis_count -gt 0 ]; then | |||
|     fcount=${open_notis_count} | ||||
| fi | ||||
| 
 | ||||
| echo "{\"state\":\"${i3status_state}\", \"text\":\"${fcount}\"}" | ||||
| if $markmineread ; then | ||||
|     echo "GT" | ||||
| else | ||||
|     echo "{\"state\":\"${i3status_state}\", \"text\":\"${fcount}\"}" | ||||
| fi | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue