From c5d101ab2c9db3b1a001cb56953cb90b24f8fdcf Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Mon, 19 Jun 2023 10:09:47 +0200 Subject: Added notify --- notify | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 notify (limited to 'notify') diff --git a/notify b/notify new file mode 100755 index 0000000..f3d996e --- /dev/null +++ b/notify @@ -0,0 +1,36 @@ +#!/bin/sh + +# Simple notification manager. +# Notifications are sent to a log file together with a time stamp. +# Requires: xroot-update (optional) + +# Usage: notify [push MESSAGE | clean | edit | show] + +update=xroot-update +file="${XDG_DATA_HOME:-.local/share}/notify" +date=$(date +'%H:%M') + +usage() { + echo "Usage: notify [push MESSAGE | clean | edit | show]" +} + +touch "$file" +case "$1" in + push) + echo "(Notified $date) $2" >> "$file" + $update + ;; + clean) + printf "" > "$file" + $update + ;; + edit) + $EDITOR "$file" + ;; + show) + cat "$file" + ;; + *) + usage + ;; +esac -- cgit v1.3