diff --git a/status-notification.nu b/status-notification.nu index 3116052..8d86075 100755 --- a/status-notification.nu +++ b/status-notification.nu @@ -38,8 +38,11 @@ def get_batteries [] { } # Documentation for notify -def notify [message: string] { - notify-send "Status" $message +def notify [message: string, urgent: bool] { + match $urgent { + true => (notify-send "Status" $message -u critical) + false => (notify-send "Status" $message) + } } def calendar [hours: int] { @@ -52,15 +55,14 @@ def calendar [hours: int] { } # Documentation for construct_string -def construct_string [] { - [ $dateString - $discordianDate - (calendar 2) - (get_batteries) - ] | str join "\n\n" -} - -# Documentation for main def main [] { - notify (construct_string) + let calendar_status = calendar 2 + let urgent = not ($calendar_status | str starts-with "No events") + notify ( + [ $dateString + $discordianDate + $calendar_status + (get_batteries) + ] | str join "\n\n" + ) $urgent }