feat: theme

This commit is contained in:
2025-07-03 12:25:15 +02:00
parent e954569d5d
commit c8642343e7
8 changed files with 80 additions and 32 deletions

View File

@@ -36,43 +36,43 @@ while [ -n "${1:-}" ]; do
case "${1:-}" in
"--completed")
shift
cliquery="${cliquery:-} "
cliquery="${cliquery:-} $FLAG_COMPLETED"
;;
"--no-completed")
shift
cliquery="${cliquery:-} !"
cliquery="${cliquery:-} !$FLAG_COMPLETED"
;;
"--open")
shift
cliquery="${cliquery:-} 🔲"
cliquery="${cliquery:-} $FLAG_OPEN"
;;
"--no-open")
shift
cliquery="${cliquery:-} !🔲"
cliquery="${cliquery:-} !$FLAG_OPEN"
;;
"--tasks")
shift
cliquery="${cliquery:-} ✅ | 🔲"
cliquery="${cliquery:-} $FLAG_OPEN | $FLAG_COMPLETED"
;;
"--no-tasks")
shift
cliquery="${cliquery:-} !✅ !🔲"
cliquery="${cliquery:-} !$FLAG_COMPLETED !$FLAG_OPEN"
;;
"--notes")
shift
cliquery="${cliquery:-} 🗒️"
cliquery="${cliquery:-} $FLAG_NOTE"
;;
"--no-notes")
shift
cliquery="${cliquery:-} !🗒️"
cliquery="${cliquery:-} !$FLAG_NOTE"
;;
"--journal")
shift
cliquery="${cliquery:-} 📘"
cliquery="${cliquery:-} $FLAG_JOURNAL"
;;
"--no-journal")
shift
cliquery="${cliquery:-} !📘"
cliquery="${cliquery:-} !$FLAG_JOURNAL"
;;
"--filter")
shift
@@ -90,5 +90,5 @@ while [ -n "${1:-}" ]; do
;;
esac
done
query=${cliquery:-!}
query=${cliquery:-!$FLAG_COMPLETED}
export query

View File

@@ -27,7 +27,7 @@ if [ "${1:-}" = "--reload" ]; then
shift
fname="$1"
shift
__change_priority "$delta" "$fname" >>/tmp/foo
__change_priority "$delta" "$fname" >/dev/null
;;
esac
__lines

View File

@@ -1,4 +1,4 @@
CONFIGFILE="$HOME/.config/fzf-vjour/config"
CONFIGFILE="${CONFIGFILE:-$HOME/.config/fzf-vjour/config}"
if [ ! -f "$CONFIGFILE" ]; then
err "Configuration '$CONFIGFILE' not found."
exit 1
@@ -41,5 +41,5 @@ export CAT
if command -v "git" >/dev/null && [ -d "$ROOT/.git" ]; then
GIT="git -C $ROOT"
export GIT
fi
export GIT

View File

@@ -25,12 +25,9 @@ __change_priority() {
shift
fname="$1"
shift
echo "call to __change_priority with delta=$delta and fname=$fname" >>/tmp/foo
file="$ROOT/$fname"
tmpfile=$(mktemp)
echo " tmpfile=$tmpfile" >>/tmp/foo
awk -v delta="$delta" "$AWK_ALTERTODO" "$file" >"$tmpfile"
echo " lines=$(wc -l tmpfile)" >>/tmp/foo
mv "$tmpfile" "$file"
if [ -n "${GIT:-}" ]; then
$GIT add "$file"

20
src/sh/theme.sh Normal file
View File

@@ -0,0 +1,20 @@
# Colors
GREEN="\033[1;32m"
RED="\033[1;31m"
WHITE="\033[1;97m"
CYAN="\033[1;36m"
FAINT="\033[2m"
# Flags
export FLAG_OPEN="${FLAG_OPEN:-🔲}"
export FLAG_COMPLETED="${FLAG_COMPLETED:-}"
export FLAG_JOURNAL="${FLAG_JOURNAL:-📘}"
export FLAG_NOTE="${FLAG_NOTE:-🗒️}"
export FLAG_PRIORITY="${FLAG_PRIORITY:-}"
# Style
export STYLE_COLLECTION="${STYLE_COLLECTION:-$FAINT$WHITE}"
export STYLE_DATE="${STYLE_DATE:-$CYAN}"
export STYLE_SUMMARY="${STYLE_SUMMARY:-$GREEN}"
export STYLE_EXPIRED="${STYLE_EXPIRED:-$RED}"
export STYLE_CATEGORY="${STYLE_CATEGORY:-$WHITE}"