From 60052659b98832c78c902e4f27ecee2663d8e913 Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Wed, 6 May 2026 08:30:49 +0200 Subject: Added scripts --- scripts/notify | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 scripts/notify (limited to 'scripts/notify') diff --git a/scripts/notify b/scripts/notify new file mode 100755 index 0000000..38e1793 --- /dev/null +++ b/scripts/notify @@ -0,0 +1,37 @@ +#!/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 "[$date $2]" >> "$file" + $update + ;; + clean) + printf "" > "$file" + $update + ;; + edit) + $EDITOR "$file" + ;; + show) + cat "$file" + ;; + *) + usage + exit 1 + ;; +esac -- cgit v1.3