From 663b54a302a0f2525eb232eafc9aa2212c3c556b Mon Sep 17 00:00:00 2001 From: steven-na Date: Sat, 15 Aug 2026 08:37:27 -0700 Subject: Scripint + monitor --- arch/scripts/.local/bin/!remindme | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100755 arch/scripts/.local/bin/!remindme (limited to 'arch/scripts/.local/bin') diff --git a/arch/scripts/.local/bin/!remindme b/arch/scripts/.local/bin/!remindme new file mode 100755 index 0000000..35b817f --- /dev/null +++ b/arch/scripts/.local/bin/!remindme @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +parse_time() { + local input="${1,}" + + if [[ $input =~ ^([0-9]+)(m|min|mins|minute|minutes)$ ]]; then + echo "now + ${BASH_REMATCH[1]} minutes" + elif [[ $input =~ ^([0-9]+)(h|hr|hrs|hour|hours)$ ]]; then + echo "now + ${BASH_REMATCH[1]} hours" + elif [[ $input =~ ^([0-9]+)(d|day|days)$ ]]; then + echo "now + ${BASH_REMATCH[1]} days" + elif [[ $input =~ ^([0-9]+)(w|wk|wks|week|weeks)$ ]]; then + echo "now + ${BASH_REMATCH[1]} weeks" + elif [[ $input =~ ^([0-9]+)(mo|month|months)$ ]]; then + echo "now + ${BASH_REMATCH[1]} months" + elif [[ $input =~ ^([0-9]+)(y|yr|yrs|year|years)$ ]]; then + echo "now + ${BASH_REMATCH[1]} years" + else + echo "$input" + fi +} + +AT_TIME=$(parse_time "$2") +at "$AT_TIME" <