Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion bin/omarchy-reminder
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ if [[ -n $custom_message ]]; then
fi

systemd-run --user --quiet --collect --on-active="${minutes}m" --unit="$unit" \
bash -c 'omarchy-notification-send -g 󰢌 "Reminder" "$1"; rm -f "$2"; omarchy-shell -q omarchy.indicators refresh >/dev/null 2>&1 || true' bash "$message" "$message_file"
bash -c 'omarchy-notification-send -g 󰢌 "Reminder" "$1" -u critical; rm -f "$2"; omarchy-shell -q omarchy.indicators refresh >/dev/null 2>&1 || true' bash "$message" "$message_file"

refresh_indicator
omarchy-notification-send -g 󰢌 "$confirmation_title" "$confirmation"
2 changes: 1 addition & 1 deletion manual/09-reminders.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Reminders

Omarchy has a built-in way to set simple reminders based on a countdown timer and with a message. You can do this via `Super + Ctrl + R`, seeing all the ones set via `Super + Ctrl + Alt + R`, and clearing all via `Super + Ctrl + Shift + R`. Everything also accessible via _Trigger > Reminder_. You can also use the cli with `omarchy reminder 7 'Tea ready'`.
Omarchy has a built-in way to set simple reminders based on a countdown timer and with a message. When a reminder fires, its notification remains visible until you dismiss it. You can do this via `Super + Ctrl + R`, seeing all the ones set via `Super + Ctrl + Alt + R`, and clearing all via `Super + Ctrl + Shift + R`. Everything also accessible via _Trigger > Reminder_. You can also use the cli with `omarchy reminder 7 'Tea ready'`.

![reminders](images/reminders.webp)
33 changes: 33 additions & 0 deletions test/shell.d/reminders-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,36 @@ assertDeepEqual(
'reminders command args are empty for invalid minutes'
)
JS

tmpdir=$(mktemp -d)
trap 'rm -rf "$tmpdir"' EXIT

printf '%s\n' \
'#!/bin/bash' \
'printf "%s\n" "$@" >"$OMARCHY_TEST_SYSTEMD_RUN_ARGS"' \
>"$tmpdir/systemd-run"
chmod +x "$tmpdir/systemd-run"

printf '%s\n' '#!/bin/bash' 'exit 0' >"$tmpdir/omarchy-notification-send"
chmod +x "$tmpdir/omarchy-notification-send"

printf '%s\n' '#!/bin/bash' 'exit 0' >"$tmpdir/omarchy-shell"
chmod +x "$tmpdir/omarchy-shell"

args_file="$tmpdir/systemd-run-args"
OMARCHY_TEST_SYSTEMD_RUN_ARGS="$args_file" \
PATH="$tmpdir:$ROOT/bin:$PATH" \
XDG_RUNTIME_DIR="$tmpdir/runtime" \
omarchy-reminder 5 "Check the oven"

mapfile -t run_args <"$args_file"
timer_payload=""
for ((i = 0; i < ${#run_args[@]}; i++)); do
if [[ ${run_args[i]} == "-c" ]]; then
timer_payload=${run_args[i + 1]}
break
fi
done

[[ $timer_payload == *'omarchy-notification-send -g 󰢌 "Reminder" "$1" -u critical'* ]] || fail "reminders use a persistent critical notification" "$timer_payload"
pass "reminders use a persistent critical notification"