rem.sh: added script

simple reminder utility
This commit is contained in:
dogeystamp 2023-04-02 18:40:47 -04:00
parent 88a34f388d
commit 45e44797b5
Signed by: dogeystamp
GPG Key ID: 7225FE3592EFFA38
3 changed files with 76 additions and 8 deletions

View File

@ -16,14 +16,18 @@ set -gx MANPATH "$MANPATH:/home/dogeystamp/.cache/cppman/"
# Disable fish greeting
set fish_greeting ""
source ~/.config/fish/functions/prompts.fish
source ~/.config/fish/functions/extra_prompt.fish
if status --is-interactive
source ~/.config/fish/functions/prompts.fish
source ~/.config/fish/functions/extra_prompt.fish
# Enable Vi bindings
fish_hybrid_key_bindings
# Enable Vi bindings
fish_hybrid_key_bindings
set __fish_git_prompt_showdirtystate 1
set __fish_git_prompt_showupstream auto
set __fish_git_prompt_showdirtystate 1
set __fish_git_prompt_showupstream auto
set fish_color_param normal
set fish_color_cwd grey
set fish_color_param normal
set fish_color_cwd grey
rem.sh show
end

60
src/.local/bin/rem.sh Executable file
View File

@ -0,0 +1,60 @@
#!/bin/sh
# simple todo utility
# nags me every time i start a shell
set -e
scriptname=$0
subcmd=$1
if [ -z "$REM_FILE" ]; then
REM_FILE="$HOME/.reminder-file"
touch "$REM_FILE"
fi
sub_help() {
echo "usage:"
echo " $scriptname <command> [options]"
echo
echo "commands:"
echo " show show all entries"
echo " add append new entry"
echo ' edit open reminder file in $EDITOR'
echo
echo "Set $REM_FILE"
}
sub_show() {
REMS="$(cat "$REM_FILE" | sed -z 's/^\n$//g')"
if [ ! -z "$REMS" ]; then
printf "reminders:\n\n%s\n\n" "$REMS"
fi
}
sub_add() {
TMP="$(mktemp)"
$EDITOR "$TMP"
cat "$TMP" >> "$REM_FILE"
}
sub_edit() {
$EDITOR "$REM_FILE"
}
sub_congrats() {
notify-send -a "🎉" "congrats"
}
case $subcmd in
"" | "--help" | "-h")
sub_help
;;
*)
shift
sub_${subcmd} "$@"
if [ $? = 127 ]; then
echo "error: unknown command '$subcmd'"
exit 1
fi
;;
esac

View File

@ -32,9 +32,13 @@ export GOPATH="$HOME"/.local/go
export npm_config_userconfig=$XDG_CONFIG_HOME/npm/config
export npm_config_cache=$XDG_CACHE_HOME/npm
export npm_config_prefix=$XDG_DATA_HOME/npm
# minrss scripts
export MRSS_DIR="$HOME/dox/rss"
# reminder script
export REM_FILE="$HOME/dox/not/rem"
# Set default programs
export EDITOR="nvim"
export BROWSER="qutebrowser"