Compare commits
	
		
			6 Commits
		
	
	
		
			7df51a6980
			...
			dev
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2a3c188f02 | |||
| 6f268c05cd | |||
| 5144465792 | |||
| 83061bd54b | |||
| b613c25f98 | |||
| 374d7e08c8 | 
@@ -1,4 +1,7 @@
 | 
				
			|||||||
A [fzf](https://github.com/junegunn/fzf)-based **journaling, notes, and tasks** application with CalDav support.
 | 
					A [fzf](https://github.com/junegunn/fzf)-based **journaling, notes, and tasks** application with CalDav support.
 | 
				
			||||||
 | 
					If you are interested in this, then you may also be interested in the
 | 
				
			||||||
 | 
					corresponding calendar application
 | 
				
			||||||
 | 
					[fzf-vcal](https://github.com/baumea/fzf-vcal).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Description and Use Case
 | 
					Description and Use Case
 | 
				
			||||||
------------------------
 | 
					------------------------
 | 
				
			||||||
@@ -15,7 +18,8 @@ copy `fzf-vjour` to your preferred location, e.g., `~/.local/bin`, and make it e
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
### Requirements
 | 
					### Requirements
 | 
				
			||||||
This is a POSIX script with inline `awk` elements.
 | 
					This is a POSIX script with inline `awk` elements.
 | 
				
			||||||
Make sure you have [fzf](https://github.com/junegunn/fzf) and [batcat](https://github.com/sharkdp/bat).
 | 
					Make sure you have [fzf](https://github.com/junegunn/fzf) installed.
 | 
				
			||||||
 | 
					I also suggest to install [batcat](https://github.com/sharkdp/bat) for colorful previews.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Configuration
 | 
					Configuration
 | 
				
			||||||
--------------
 | 
					--------------
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -130,6 +130,21 @@ ENDFILE {
 | 
				
			|||||||
  if (!type) {
 | 
					  if (!type) {
 | 
				
			||||||
    exit
 | 
					    exit
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					  # Construct path, and check for validity
 | 
				
			||||||
 | 
					  depth = split(FILENAME, path, "/");
 | 
				
			||||||
 | 
					  fpath = path[depth-1] "/" path[depth]
 | 
				
			||||||
 | 
					  if (index(fpath, " "))
 | 
				
			||||||
 | 
					  {
 | 
				
			||||||
 | 
					    print 10,
 | 
				
			||||||
 | 
					          "-",
 | 
				
			||||||
 | 
					          "-",
 | 
				
			||||||
 | 
					          RED "ERROR: file '" fpath "' contains whitespaces!" OFF
 | 
				
			||||||
 | 
					    exit
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					  # Collection name
 | 
				
			||||||
 | 
					  collection = path[depth-1]
 | 
				
			||||||
 | 
					  collection = collection in collection2label ? collection2label[collection] : collection;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Process content lines
 | 
					  # Process content lines
 | 
				
			||||||
  storetext_line(content_line, c, "CATEGORIES"   );
 | 
					  storetext_line(content_line, c, "CATEGORIES"   );
 | 
				
			||||||
  storetext_line(content_line, c, "DESCRIPTION"  );
 | 
					  storetext_line(content_line, c, "DESCRIPTION"  );
 | 
				
			||||||
@@ -160,11 +175,6 @@ ENDFILE {
 | 
				
			|||||||
  #                format
 | 
					  #                format
 | 
				
			||||||
  mod = c["LAST-MODIFIED"] ? c["LAST-MODIFIED"] : c["DTSTAMP"];
 | 
					  mod = c["LAST-MODIFIED"] ? c["LAST-MODIFIED"] : c["DTSTAMP"];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  # Collection name
 | 
					 | 
				
			||||||
  depth = split(FILENAME, path, "/");
 | 
					 | 
				
			||||||
  collection = depth > 1 ? path[depth-1] : "";
 | 
					 | 
				
			||||||
  collection = collection in collection2label ? collection2label[collection] : collection;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  # Date field. For VTODO entries, we show the due date, for journal entries,
 | 
					  # Date field. For VTODO entries, we show the due date, for journal entries,
 | 
				
			||||||
  # the associated date.
 | 
					  # the associated date.
 | 
				
			||||||
  datecolor = CYAN;
 | 
					  datecolor = CYAN;
 | 
				
			||||||
@@ -206,10 +216,10 @@ ENDFILE {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  print prio,
 | 
					  print prio,
 | 
				
			||||||
        mod,
 | 
					        mod,
 | 
				
			||||||
 | 
					        fpath,
 | 
				
			||||||
        collection,
 | 
					        collection,
 | 
				
			||||||
        datecolor d OFF,
 | 
					        datecolor d OFF,
 | 
				
			||||||
        flag,
 | 
					        flag,
 | 
				
			||||||
        priotext summarycolor summary OFF,
 | 
					        priotext summarycolor summary OFF,
 | 
				
			||||||
        WHITE categories OFF,
 | 
					        WHITE categories OFF;
 | 
				
			||||||
        "                                                                                                                                                                    " FAINT FILENAME OFF;
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										139
									
								
								src/main.sh
									
									
									
									
									
								
							
							
						
						
									
										139
									
								
								src/main.sh
									
									
									
									
									
								
							@@ -5,71 +5,96 @@ set -eu
 | 
				
			|||||||
err() {
 | 
					err() {
 | 
				
			||||||
  echo "❌ $1" >/dev/tty
 | 
					  echo "❌ $1" >/dev/tty
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
# Read configuration
 | 
					
 | 
				
			||||||
# shellcheck source=/dev/null
 | 
					if [ -z "${FZF_VJOUR_USE_EXPORTED:-}" ]; then
 | 
				
			||||||
CONFIGFILE="$HOME/.config/fzf-vjour/config"
 | 
					  # Read configuration
 | 
				
			||||||
if [ ! -f "$CONFIGFILE" ]; then
 | 
					  CONFIGFILE="$HOME/.config/fzf-vjour/config"
 | 
				
			||||||
 | 
					  if [ ! -f "$CONFIGFILE" ]; then
 | 
				
			||||||
    err "Configuration '$CONFIGFILE' not found."
 | 
					    err "Configuration '$CONFIGFILE' not found."
 | 
				
			||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
fi
 | 
					  fi
 | 
				
			||||||
. "$CONFIGFILE"
 | 
					  # shellcheck source=/dev/null
 | 
				
			||||||
if [ -z "${ROOT:-}" ] || [ -z "${SYNC_CMD:-}" ] || [ -z "${COLLECTION_LABELS:-}" ]; then
 | 
					  . "$CONFIGFILE"
 | 
				
			||||||
 | 
					  if [ -z "${ROOT:-}" ] || [ -z "${SYNC_CMD:-}" ] || [ -z "${COLLECTION_LABELS:-}" ]; then
 | 
				
			||||||
    err "Configuration is incomplete."
 | 
					    err "Configuration is incomplete."
 | 
				
			||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
fi
 | 
					  fi
 | 
				
			||||||
 | 
					  export ROOT
 | 
				
			||||||
 | 
					  export SYNC_CMD
 | 
				
			||||||
 | 
					  export COLLECTION_LABELS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Tools
 | 
					  # Tools
 | 
				
			||||||
if command -v "fzf" >/dev/null; then
 | 
					  if command -v "fzf" >/dev/null; then
 | 
				
			||||||
    FZF="fzf"
 | 
					    FZF="fzf"
 | 
				
			||||||
else
 | 
					  else
 | 
				
			||||||
    err "Did not find the command-line fuzzy finder fzf."
 | 
					    err "Did not find the command-line fuzzy finder fzf."
 | 
				
			||||||
    exit 1
 | 
					    exit 1
 | 
				
			||||||
fi
 | 
					  fi
 | 
				
			||||||
if command -v "bat" >/dev/null; then
 | 
					  export FZF
 | 
				
			||||||
  CAT="bat"
 | 
					 | 
				
			||||||
elif command -v "batcat" >/dev/null; then
 | 
					 | 
				
			||||||
  CAT="batcat"
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
CAT=${CAT:+$CAT --color=always --style=numbers --language=md}
 | 
					 | 
				
			||||||
CAT=${CAT:-cat}
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
### AWK SCRIPTS
 | 
					  if command -v "uuidgen" >/dev/null; then
 | 
				
			||||||
AWK_ALTERTODO=$(
 | 
					    UUIDGEN="uuidgen"
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    err "Did not find the uuidgen command."
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  export UUIDGEN
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  if command -v "bat" >/dev/null; then
 | 
				
			||||||
 | 
					    CAT="bat"
 | 
				
			||||||
 | 
					  elif command -v "batcat" >/dev/null; then
 | 
				
			||||||
 | 
					    CAT="batcat"
 | 
				
			||||||
 | 
					  fi
 | 
				
			||||||
 | 
					  CAT=${CAT:+$CAT --color=always --style=numbers --language=md}
 | 
				
			||||||
 | 
					  CAT=${CAT:-cat}
 | 
				
			||||||
 | 
					  export CAT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  ### AWK SCRIPTS
 | 
				
			||||||
 | 
					  AWK_ALTERTODO=$(
 | 
				
			||||||
    cat <<'EOF'
 | 
					    cat <<'EOF'
 | 
				
			||||||
@@include src/awk/altertodo.awk
 | 
					@@include src/awk/altertodo.awk
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
)
 | 
					  )
 | 
				
			||||||
 | 
					  export AWK_ALTERTODO
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AWK_EXPORT=$(
 | 
					  AWK_EXPORT=$(
 | 
				
			||||||
    cat <<'EOF'
 | 
					    cat <<'EOF'
 | 
				
			||||||
@@include src/awk/export.awk
 | 
					@@include src/awk/export.awk
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
)
 | 
					  )
 | 
				
			||||||
 | 
					  export AWK_EXPORT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AWK_GET=$(
 | 
					  AWK_GET=$(
 | 
				
			||||||
    cat <<'EOF'
 | 
					    cat <<'EOF'
 | 
				
			||||||
@@include src/awk/get.awk
 | 
					@@include src/awk/get.awk
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
)
 | 
					  )
 | 
				
			||||||
 | 
					  export AWK_GET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AWK_LIST=$(
 | 
					  AWK_LIST=$(
 | 
				
			||||||
    cat <<'EOF'
 | 
					    cat <<'EOF'
 | 
				
			||||||
@@include src/awk/list.awk
 | 
					@@include src/awk/list.awk
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
)
 | 
					  )
 | 
				
			||||||
 | 
					  export AWK_LIST
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AWK_NEW=$(
 | 
					  AWK_NEW=$(
 | 
				
			||||||
    cat <<'EOF'
 | 
					    cat <<'EOF'
 | 
				
			||||||
@@include src/awk/new.awk
 | 
					@@include src/awk/new.awk
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
)
 | 
					  )
 | 
				
			||||||
 | 
					  export AWK_NEW
 | 
				
			||||||
 | 
					
 | 
				
			||||||
AWK_UPDATE=$(
 | 
					  AWK_UPDATE=$(
 | 
				
			||||||
    cat <<'EOF'
 | 
					    cat <<'EOF'
 | 
				
			||||||
@@include src/awk/update.awk
 | 
					@@include src/awk/update.awk
 | 
				
			||||||
EOF
 | 
					EOF
 | 
				
			||||||
)
 | 
					  )
 | 
				
			||||||
### END OF AWK SCRIPTS
 | 
					  export AWK_UPDATE
 | 
				
			||||||
 | 
					  ### END OF AWK SCRIPTS
 | 
				
			||||||
 | 
					  FZF_VJOUR_USE_EXPORTED="yes"
 | 
				
			||||||
 | 
					  export FZF_VJOUR_USE_EXPORTED
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
__lines() {
 | 
					__lines() {
 | 
				
			||||||
  find "$ROOT" -type f -name '*.ics' -print0 | xargs -0 -P 0 \
 | 
					  find "$ROOT" -type f -name '*.ics' -print0 | xargs -0 -P 0 \
 | 
				
			||||||
@@ -80,12 +105,7 @@ __lines() {
 | 
				
			|||||||
    -v flag_journal="📘" \
 | 
					    -v flag_journal="📘" \
 | 
				
			||||||
    -v flag_note="🗒️" \
 | 
					    -v flag_note="🗒️" \
 | 
				
			||||||
    "$AWK_LIST" |
 | 
					    "$AWK_LIST" |
 | 
				
			||||||
    sort -g -r |
 | 
					    sort -g -r
 | 
				
			||||||
    cut -d ' ' -f 3-
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
__filepath_from_selection() {
 | 
					 | 
				
			||||||
  echo "$1" | grep -o ' \{50\}.*$' | xargs
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Program starts here
 | 
					# Program starts here
 | 
				
			||||||
@@ -117,17 +137,19 @@ fi
 | 
				
			|||||||
# Command line arguments to be self-contained
 | 
					# Command line arguments to be self-contained
 | 
				
			||||||
# Generate preview of file from selection
 | 
					# Generate preview of file from selection
 | 
				
			||||||
if [ "${1:-}" = "--preview" ]; then
 | 
					if [ "${1:-}" = "--preview" ]; then
 | 
				
			||||||
  file=$(__filepath_from_selection "$2")
 | 
					  name=$(echo "$2" | cut -d ' ' -f 3)
 | 
				
			||||||
 | 
					  file="$ROOT/$name"
 | 
				
			||||||
  awk -v field="DESCRIPTION" "$AWK_GET" "$file" |
 | 
					  awk -v field="DESCRIPTION" "$AWK_GET" "$file" |
 | 
				
			||||||
    $CAT
 | 
					    $CAT
 | 
				
			||||||
  exit
 | 
					  exit
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
# Delete file from selection
 | 
					# Delete file from selection
 | 
				
			||||||
if [ "${1:-}" = "--delete" ]; then
 | 
					if [ "${1:-}" = "--delete" ]; then
 | 
				
			||||||
  file=$(__filepath_from_selection "$2")
 | 
					  name=$(echo "$2" | cut -d ' ' -f 3)
 | 
				
			||||||
 | 
					  file="$ROOT/$name"
 | 
				
			||||||
  summary=$(awk -v field="SUMMARY" "$AWK_GET" "$file")
 | 
					  summary=$(awk -v field="SUMMARY" "$AWK_GET" "$file")
 | 
				
			||||||
  while true; do
 | 
					  while true; do
 | 
				
			||||||
    printf "Do you want to delete the entry with the title \"%s\"? (yes/no)" "$summary" >/dev/tty
 | 
					    printf "Do you want to delete the entry with the title \"%s\"? (yes/no): " "$summary" >/dev/tty
 | 
				
			||||||
    read -r yn
 | 
					    read -r yn
 | 
				
			||||||
    case $yn in
 | 
					    case $yn in
 | 
				
			||||||
    "yes")
 | 
					    "yes")
 | 
				
			||||||
@@ -145,17 +167,10 @@ if [ "${1:-}" = "--delete" ]; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
# Generate new entry
 | 
					# Generate new entry
 | 
				
			||||||
if [ "${1:-}" = "--new" ]; then
 | 
					if [ "${1:-}" = "--new" ]; then
 | 
				
			||||||
  label=$(printf "%s" "$COLLECTION_LABELS" |
 | 
					  collection=$(echo "$COLLECTION_LABELS" | tr ';' '\n' | $FZF --delimiter='=' --with-nth=2 --accept-nth=1)
 | 
				
			||||||
    awk 'BEGIN { FS="="; RS=";"; } {print $2}' |
 | 
					 | 
				
			||||||
    $FZF \
 | 
					 | 
				
			||||||
      --margin 20% \
 | 
					 | 
				
			||||||
      --prompt="Select collection> ")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  collection=$(printf "%s" "$COLLECTION_LABELS" |
 | 
					 | 
				
			||||||
    awk -v label="$label" 'BEGIN { FS="="; RS=";"; } $2 == label {print $1}')
 | 
					 | 
				
			||||||
  file=""
 | 
					  file=""
 | 
				
			||||||
  while [ -f "$file" ] || [ -z "$file" ]; do
 | 
					  while [ -f "$file" ] || [ -z "$file" ]; do
 | 
				
			||||||
    uuid=$(uuidgen)
 | 
					    uuid=$($UUIDGEN)
 | 
				
			||||||
    file="$ROOT/$collection/$uuid.ics"
 | 
					    file="$ROOT/$collection/$uuid.ics"
 | 
				
			||||||
  done
 | 
					  done
 | 
				
			||||||
  tmpmd=$(mktemp --suffix='.md')
 | 
					  tmpmd=$(mktemp --suffix='.md')
 | 
				
			||||||
@@ -181,21 +196,24 @@ if [ "${1:-}" = "--new" ]; then
 | 
				
			|||||||
fi
 | 
					fi
 | 
				
			||||||
# Toggle completed flag
 | 
					# Toggle completed flag
 | 
				
			||||||
if [ "${1:-}" = "--toggle-completed" ]; then
 | 
					if [ "${1:-}" = "--toggle-completed" ]; then
 | 
				
			||||||
  file=$(__filepath_from_selection "$2")
 | 
					  name=$(echo "$2" | cut -d ' ' -f 3)
 | 
				
			||||||
 | 
					  file="$ROOT/$name"
 | 
				
			||||||
  tmpfile=$(mktemp)
 | 
					  tmpfile=$(mktemp)
 | 
				
			||||||
  awk "$AWK_ALTERTODO" "$file" >"$tmpfile"
 | 
					  awk "$AWK_ALTERTODO" "$file" >"$tmpfile"
 | 
				
			||||||
  mv "$tmpfile" "$file"
 | 
					  mv "$tmpfile" "$file"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
# Increase priority
 | 
					# Increase priority
 | 
				
			||||||
if [ "${1:-}" = "--increase-priority" ]; then
 | 
					if [ "${1:-}" = "--increase-priority" ]; then
 | 
				
			||||||
  file=$(__filepath_from_selection "$2")
 | 
					  name=$(echo "$2" | cut -d ' ' -f 3)
 | 
				
			||||||
 | 
					  file="$ROOT/$name"
 | 
				
			||||||
  tmpfile=$(mktemp)
 | 
					  tmpfile=$(mktemp)
 | 
				
			||||||
  awk -v delta="1" "$AWK_ALTERTODO" "$file" >"$tmpfile"
 | 
					  awk -v delta="1" "$AWK_ALTERTODO" "$file" >"$tmpfile"
 | 
				
			||||||
  mv "$tmpfile" "$file"
 | 
					  mv "$tmpfile" "$file"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
# Decrease priority
 | 
					# Decrease priority
 | 
				
			||||||
if [ "${1:-}" = "--decrease-priority" ]; then
 | 
					if [ "${1:-}" = "--decrease-priority" ]; then
 | 
				
			||||||
  file=$(__filepath_from_selection "$2")
 | 
					  name=$(echo "$2" | cut -d ' ' -f 3)
 | 
				
			||||||
 | 
					  file="$ROOT/$name"
 | 
				
			||||||
  tmpfile=$(mktemp)
 | 
					  tmpfile=$(mktemp)
 | 
				
			||||||
  awk -v delta="-1" "$AWK_ALTERTODO" "$file" >"$tmpfile"
 | 
					  awk -v delta="-1" "$AWK_ALTERTODO" "$file" >"$tmpfile"
 | 
				
			||||||
  mv "$tmpfile" "$file"
 | 
					  mv "$tmpfile" "$file"
 | 
				
			||||||
@@ -230,10 +248,8 @@ fi
 | 
				
			|||||||
if [ "${1:-}" = "--no-journal" ]; then
 | 
					if [ "${1:-}" = "--no-journal" ]; then
 | 
				
			||||||
  query="!📘"
 | 
					  query="!📘"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
if [ -z "$query" ]; then
 | 
					query=${query:-!✅}
 | 
				
			||||||
  query="!✅"
 | 
					query=$(echo "$query" | xargs)
 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
query=$(echo "$query" | sed 's/ *$//g')
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
selection=$(
 | 
					selection=$(
 | 
				
			||||||
  __lines | $FZF --ansi \
 | 
					  __lines | $FZF --ansi \
 | 
				
			||||||
@@ -241,6 +257,8 @@ selection=$(
 | 
				
			|||||||
    --no-sort \
 | 
					    --no-sort \
 | 
				
			||||||
    --no-hscroll \
 | 
					    --no-hscroll \
 | 
				
			||||||
    --ellipsis='' \
 | 
					    --ellipsis='' \
 | 
				
			||||||
 | 
					    --with-nth=4.. \
 | 
				
			||||||
 | 
					    --accept-nth=3 \
 | 
				
			||||||
    --preview="$0 --preview {}" \
 | 
					    --preview="$0 --preview {}" \
 | 
				
			||||||
    --bind="ctrl-r:reload-sync($0 --reload)" \
 | 
					    --bind="ctrl-r:reload-sync($0 --reload)" \
 | 
				
			||||||
    --bind="ctrl-alt-d:become($0 --delete {})" \
 | 
					    --bind="ctrl-alt-d:become($0 --delete {})" \
 | 
				
			||||||
@@ -252,13 +270,13 @@ selection=$(
 | 
				
			|||||||
    --bind="alt-1:change-query(📘)" \
 | 
					    --bind="alt-1:change-query(📘)" \
 | 
				
			||||||
    --bind="alt-2:change-query(🗒️)" \
 | 
					    --bind="alt-2:change-query(🗒️)" \
 | 
				
			||||||
    --bind="alt-3:change-query(✅ | 🔲)" \
 | 
					    --bind="alt-3:change-query(✅ | 🔲)" \
 | 
				
			||||||
    --bind="ctrl-s:execute($SYNC_CMD ; echo 'Press <enter> to continue.'; read -r tmp)"
 | 
					    --bind="ctrl-s:execute($SYNC_CMD ; printf 'Press <enter> to continue.'; read -r tmp)"
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
if [ -z "$selection" ]; then
 | 
					if [ -z "$selection" ]; then
 | 
				
			||||||
  return 0
 | 
					  return 0
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
file=$(__filepath_from_selection "$selection")
 | 
					file="$ROOT/$selection"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [ ! -f "$file" ]; then
 | 
					if [ ! -f "$file" ]; then
 | 
				
			||||||
  echo "ERROR: File '$file' does not exist!" >/dev/tty
 | 
					  echo "ERROR: File '$file' does not exist!" >/dev/tty
 | 
				
			||||||
@@ -275,7 +293,6 @@ $EDITOR "$filetmp" >/dev/tty
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Update only if changes are detected
 | 
					# Update only if changes are detected
 | 
				
			||||||
if [ "$checksum" != "$(cksum "$filetmp")" ]; then
 | 
					if [ "$checksum" != "$(cksum "$filetmp")" ]; then
 | 
				
			||||||
  echo "Uh... chages detected!" >/dev/tty
 | 
					 | 
				
			||||||
  file_new="$filetmp.ics"
 | 
					  file_new="$filetmp.ics"
 | 
				
			||||||
  awk "$AWK_UPDATE" "$filetmp" "$file" >"$file_new"
 | 
					  awk "$AWK_UPDATE" "$filetmp" "$file" >"$file_new"
 | 
				
			||||||
  mv "$file_new" "$file"
 | 
					  mv "$file_new" "$file"
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user