-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrtm-reminder-zsh.plugin.zsh
More file actions
37 lines (29 loc) · 1 KB
/
rtm-reminder-zsh.plugin.zsh
File metadata and controls
37 lines (29 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env zsh
# RTM Reminder Zsh Plugin
# Main plugin file that sets up the reminder system
# Plugin directory
RTM_REMINDER_PLUGIN_DIR="${0:A:h}"
# Fallback for bash/other shells
if [[ -z "$RTM_REMINDER_PLUGIN_DIR" ]]; then
RTM_REMINDER_PLUGIN_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
fi
# Source the core library
source "$RTM_REMINDER_PLUGIN_DIR/lib/rtm-reminder.zsh"
# Initialize the plugin
rtm_reminder_init() {
# Create config directory if it doesn't exist
[[ ! -d "$HOME/.config/rtm-reminder-zsh" ]] && mkdir -p "$HOME/.config/rtm-reminder-zsh"
# Create cache directory if it doesn't exist
[[ ! -d "$HOME/.cache/rtm-reminder-zsh" ]] && mkdir -p "$HOME/.cache/rtm-reminder-zsh"
# Load configuration
rtm_reminder_load_config
}
# Set up the precmd hook to run after each command
rtm_reminder_precmd() {
rtm_reminder_check_tasks
}
# Initialize the plugin
rtm_reminder_init
# Add the precmd hook
autoload -Uz add-zsh-hook
add-zsh-hook precmd rtm_reminder_precmd