anufrievroman / calcure

Modern TUI calendar and task manager with minimal and customizable UI.
https://anufrievroman.gitbook.io/calcure
MIT License
1.51k stars 43 forks source link

Reload tasks #95

Closed CyanMonkey closed 8 months ago

CyanMonkey commented 8 months ago

Hi can you please set the tasks to reload as well when Q is pressed? I am planning to create a script to insert/delete tasks to the tasks.csv file from my email provider's task folder. So I can effectively sync task lists between my work/home.

P.S. for anyone else this is how I configured my crontab to update calcure 59 18-23 * /home/bubbles/.local/bin/setenv.sh "vdirsyncer sync" && tmux send-keys -t email:1.0 Q || export DISPLAY=:0 ; notify-send -u critical -t 0 "pls unlock GPG"

I found that some cron managers don't handle environment variables needed as paths in vdirsyncer and tmux so I created a helper script to set the variables before running the sync. update the env variables as you need as this is just an example

#!/bin/sh
# Default programs:
export EDITOR="nvim"
export TERMINAL="st"
export BROWSER="firefox"

export NOTMUCH_CONFIG="${XDG_CONFIG_HOME:-$HOME/.config}/notmuch-config"
export GNUPGHOME="${XDG_DATA_HOME:-$HOME/.local/share}/gnupg"
export PASSWORD_STORE_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/private/password-store"

[ -z "$1" ] && { echo "please supply a cmd argument";exit; }

exec $1
anufrievroman commented 8 months ago

Hi, I think it is the case now, Q reloads both events and tasks. It's not working for you?

CyanMonkey commented 8 months ago

I was browsing through the source files and I think it is just reloading the tasks from ics files and not csv. main.py

       if screen.reload_data:
            user_ics_events = event_loader_ics.load()
            user_ics_tasks = task_loader_ics.load()
            screen.reload_data = False
anufrievroman commented 8 months ago

Ah, I see, you are right, I missed that you mean .csv files. Okay, I'll make it so that they are updated as well.

anufrievroman commented 8 months ago

I implemented it in the current main, you can try to install it and test it as:

pipx install git+https://github.com/anufrievroman/calcure

Or just wait for release 3.1 :)