#!/bin/bash ####################################### ## notification center for instantOS ## ####################################### # show notification history in rofi # enter to open a submenu for reading and deleting # esc to exit if ! [ -e /tmp/notifications/notif.txt ]; then echo "creating notification dir" mkdir /tmp/notifications cd /tmp/notifications echo "press enter to open submenu" >notif.txt fi cd /tmp/notifications NREAD=$(tac notif.txt | rofi -dmenu -i -p notifications -markup-rows) while [ -n "$NREAD" ]; do CHOICE=$(echo "r: read x: delete" | instantmenu -c -n -w 100 -l 2 -bw 4 -h 50) case "$CHOICE" in r*) echo "$NREAD" | sed 's/^(\([0-9]*:[0-9]*\)) \[\(.*\)\] \(.*\)<\/b> | \(.*\)<\/i>/time: \1\nApp: \2\n \3\n\n \4/g ' | sed 's/&/&/g' >/tmp/instantmessage st -e sh -c "less /tmp/instantmessage" ;; x*) grep -vF "$NREAD" notif.txt >tmp.notif && mv tmp.notif notif.txt ;; esac NREAD=$(tac notif.txt | rofi -dmenu -i -p notifications -markup-rows) done