Compare commits
	
		
			4 Commits
		
	
	
		
			local
			...
			2cd4b02248
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 2cd4b02248 | |||
| aee1a1bf24 | |||
| 4ebcbe36e3 | |||
| acc231027b | 
@@ -1,4 +1,7 @@
 | 
				
			|||||||
A [fzf](https://github.com/junegunn/fzf)-based **calendar** application with CalDav support.
 | 
					A [fzf](https://github.com/junegunn/fzf)-based **calendar** application with CalDav support.
 | 
				
			||||||
 | 
					If you are interested in this, then you may also be interested in the
 | 
				
			||||||
 | 
					corresponding journaling application
 | 
				
			||||||
 | 
					[fzf-vjour](https://github.com/baumea/fzf-vjour).
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Description and Use Case
 | 
					Description and Use Case
 | 
				
			||||||
------------------------
 | 
					------------------------
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -27,10 +27,16 @@ BEGIN {
 | 
				
			|||||||
desc { desc = desc "\\n" $0; next; }
 | 
					desc { desc = desc "\\n" $0; next; }
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  from = substr($0, 1, 6) == "::: |>" ? substr($0, 8) : "";
 | 
					  from = substr($0, 1, 6) == "::: |>" ? substr($0, 8) : "";
 | 
				
			||||||
 | 
					  if (!from)
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
  getline
 | 
					  getline
 | 
				
			||||||
  to = substr($0, 1, 6) == "::: <|" ? substr($0, 8) : "";
 | 
					  to = substr($0, 1, 6) == "::: <|" ? substr($0, 8) : "";
 | 
				
			||||||
 | 
					  if (!to)
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
  getline
 | 
					  getline
 | 
				
			||||||
  summary = substr($0, 1, 2) == "# " ? substr($0, 3) : ""
 | 
					  summary = substr($0, 1, 2) == "# " ? substr($0, 3) : ""
 | 
				
			||||||
 | 
					  if (!summary)
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
  getline # This line should be empty
 | 
					  getline # This line should be empty
 | 
				
			||||||
  getline # First line of description
 | 
					  getline # First line of description
 | 
				
			||||||
  desc = $0;
 | 
					  desc = $0;
 | 
				
			||||||
@@ -41,7 +47,7 @@ END {
 | 
				
			|||||||
  # If nanoseconds are not 0, then we assume user enterd "tomorrow" or
 | 
					  # If nanoseconds are not 0, then we assume user enterd "tomorrow" or
 | 
				
			||||||
  # something the like, and we make this a date entry, as opposed to a
 | 
					  # something the like, and we make this a date entry, as opposed to a
 | 
				
			||||||
  # date-time entry.
 | 
					  # date-time entry.
 | 
				
			||||||
  from = from ? from : "now"
 | 
					  gsub("\"", "\\\"", from)
 | 
				
			||||||
  cmd = "date -d \"" from "\" +\"%N\"";
 | 
					  cmd = "date -d \"" from "\" +\"%N\"";
 | 
				
			||||||
  cmd | getline t
 | 
					  cmd | getline t
 | 
				
			||||||
  close(cmd)
 | 
					  close(cmd)
 | 
				
			||||||
@@ -53,10 +59,13 @@ END {
 | 
				
			|||||||
    from_type = "DATE"
 | 
					    from_type = "DATE"
 | 
				
			||||||
    cmd = "date -d \"" from "\" +\"%Y%m%d\"";
 | 
					    cmd = "date -d \"" from "\" +\"%Y%m%d\"";
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  cmd | getline from
 | 
					  suc = cmd | getline from
 | 
				
			||||||
  close(cmd)
 | 
					  close(cmd)
 | 
				
			||||||
 | 
					  if (suc != 1) {
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  #
 | 
					  #
 | 
				
			||||||
  to = to ? to : "now"
 | 
					  gsub("\"", "\\\"", to)
 | 
				
			||||||
  cmd = "date -d \"" to "\" +\"%N\"";
 | 
					  cmd = "date -d \"" to "\" +\"%N\"";
 | 
				
			||||||
  cmd | getline t
 | 
					  cmd | getline t
 | 
				
			||||||
  close(cmd)
 | 
					  close(cmd)
 | 
				
			||||||
@@ -68,8 +77,11 @@ END {
 | 
				
			|||||||
    to_type = "DATE"
 | 
					    to_type = "DATE"
 | 
				
			||||||
    cmd = "date -d \"" to "\" +\"%Y%m%d\"";
 | 
					    cmd = "date -d \"" to "\" +\"%Y%m%d\"";
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  cmd | getline to
 | 
					  suc = cmd | getline to
 | 
				
			||||||
  close(cmd)
 | 
					  close(cmd)
 | 
				
			||||||
 | 
					  if (suc != 1) {
 | 
				
			||||||
 | 
					    exit 1
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
  escape(summary);
 | 
					  escape(summary);
 | 
				
			||||||
  escape(desc);
 | 
					  escape(desc);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										21
									
								
								src/main.sh
									
									
									
									
									
								
							
							
						
						
									
										21
									
								
								src/main.sh
									
									
									
									
									
								
							@@ -307,10 +307,10 @@ __edit() {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
__refresh_data() {
 | 
					__refresh_data() {
 | 
				
			||||||
  if [ -n "${APPROX_DATA_FILE:-}" ]; then
 | 
					  if [ -n "${APPROX_DATA_FILE:-}" ]; then
 | 
				
			||||||
    rm "$APPROX_DATA_FILE"
 | 
					    rm -f "$APPROX_DATA_FILE"
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
  if [ -n "${WEEKLY_DATA_FILE:-}" ]; then
 | 
					  if [ -n "${WEEKLY_DATA_FILE:-}" ]; then
 | 
				
			||||||
    rm "$WEEKLY_DATA_FILE"
 | 
					    rm -f "$WEEKLY_DATA_FILE"
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
  APPROX_DATA_FILE=$(mktemp)
 | 
					  APPROX_DATA_FILE=$(mktemp)
 | 
				
			||||||
  __load_approx_data >"$APPROX_DATA_FILE"
 | 
					  __load_approx_data >"$APPROX_DATA_FILE"
 | 
				
			||||||
@@ -380,9 +380,14 @@ if [ "${1:-}" = "--new" ]; then
 | 
				
			|||||||
  # Update only if changes are detected
 | 
					  # Update only if changes are detected
 | 
				
			||||||
  if [ "$checksum" != "$(cksum "$filetmp")" ]; then
 | 
					  if [ "$checksum" != "$(cksum "$filetmp")" ]; then
 | 
				
			||||||
    filenew="$filetmp.ics"
 | 
					    filenew="$filetmp.ics"
 | 
				
			||||||
    awk -v uid="$uuid" "$AWK_NEW" "$filetmp" >"$filenew"
 | 
					    if awk -v uid="$uuid" "$AWK_NEW" "$filetmp" >"$filenew"; then
 | 
				
			||||||
    mv "$filenew" "$fpath"
 | 
					      mv "$filenew" "$fpath"
 | 
				
			||||||
    __refresh_data
 | 
					      __refresh_data
 | 
				
			||||||
 | 
					    else
 | 
				
			||||||
 | 
					      rm "$filenew"
 | 
				
			||||||
 | 
					      err "Failed to create new entry. Press <enter> to continue."
 | 
				
			||||||
 | 
					      read -r tmp
 | 
				
			||||||
 | 
					    fi
 | 
				
			||||||
  fi
 | 
					  fi
 | 
				
			||||||
  rm "$filetmp"
 | 
					  rm "$filetmp"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
@@ -608,13 +613,13 @@ selection=$(
 | 
				
			|||||||
      --preview-window=up,7,border-bottom \
 | 
					      --preview-window=up,7,border-bottom \
 | 
				
			||||||
      --preview="$0 --preview-week {}" \
 | 
					      --preview="$0 --preview-week {}" \
 | 
				
			||||||
      --expect="ctrl-n" \
 | 
					      --expect="ctrl-n" \
 | 
				
			||||||
      --bind="ctrl-j:transform:[ \$FZF_POS -le 1 ] &&
 | 
					      --bind="ctrl-j:transform:([ {1} = \"+\" ] && [ \$FZF_POS -le 1 ]) &&
 | 
				
			||||||
      echo unbind\(load\)+reload:$0 --list {2} '+1 day'||
 | 
					      echo unbind\(load\)+reload:$0 --list {2} '+1 day'||
 | 
				
			||||||
      echo down" \
 | 
					      echo down" \
 | 
				
			||||||
      --bind="ctrl-k:transform:[ \$FZF_POS -ge 7 ] &&
 | 
					      --bind="ctrl-k:transform:([ {1} = \"+\" ] && [ \$FZF_POS -ge 7 ]) &&
 | 
				
			||||||
      echo unbind\(load\)+reload:$0 --list {2} '-1 day'||
 | 
					      echo unbind\(load\)+reload:$0 --list {2} '-1 day'||
 | 
				
			||||||
      echo up" \
 | 
					      echo up" \
 | 
				
			||||||
      --bind="change:reload($0 --all)+hide-preview" \
 | 
					      --bind="change:unbind(load)+reload($0 --all)+hide-preview" \
 | 
				
			||||||
      --bind="backward-eof:rebind(load)+reload($0 --list)+show-preview" \
 | 
					      --bind="backward-eof:rebind(load)+reload($0 --list)+show-preview" \
 | 
				
			||||||
      --bind="load:pos($DISPLAY_POS)" \
 | 
					      --bind="load:pos($DISPLAY_POS)" \
 | 
				
			||||||
      --bind="ctrl-u:unbind(load)+reload:$0 --list {2} '-1 week'" \
 | 
					      --bind="ctrl-u:unbind(load)+reload:$0 --list {2} '-1 week'" \
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user