#!/bin/sh # time module for status/stellar # values TIME_SECOND="$(date +%S)" TIME_MINUTE="$(date +%M)" TIME_HOUR="$(date +%H)" TIME_FULL="$(date +%T)" TIME_ZONE="$(date +%Z)" ICON="$1" # no spacing if there's no icon if [ "$ICON" != "" ]; then ICONSPACING=" " # one character spacing fi # send the notification SEND_NOTIF() { FULL_TIME="${ICON}${ICONSPACING}The time is $TIME_FULL $TIME_ZONE." notify-send "$FULL_TIME" echo "Notification sent successfully!" echo "INFO: $FULL_TIME" exit 0 } command -v notify-send > /dev/null && SEND_NOTIF echo "FATAL: libnotify not installed, can't send notification." exit 1