Get one notification icon per app (unique notification icons) - @Tored, discord
Uses functions: ni(), sh(), fl(), tc(split), tc(utf)
Prerequisites: N/A
Globals: N/A
Formula explanation: This formula allows you to get a status bar notification icon from a list of notification icons for unique apps. For example, if you have 5 discord notifications, the list will behave like there is only one. Works for dismissible notifications. Keep in mind that this formula has no way of determining whether the omitted notifications actually have identical icons, it's all done by package name.
Code:
Get unique icon at [index]: ni(tc(split, sh("echo '" + fl(0, ni(count) - 1, "i+1", "ni(i, pkg)", #) + "' | tr '#' '\n' | sort -u", 1, 999), tc(utf, 0a), [index]), icon)
Get unique icon count: sh("echo '" + fl(0, ni(count) - 1, "i+1", "ni(i, pkg)", #) + "' | tr '#' '\n' | sort -u | wc -l")