Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macro support #396

Open
johannes-darms opened this issue Apr 11, 2016 · 5 comments
Open

Macro support #396

johannes-darms opened this issue Apr 11, 2016 · 5 comments

Comments

@johannes-darms
Copy link

I'd like to have the option to specify a key to start an "sync" command. I mostly work in ikhal modifying or reading events. Before or after that I quit ikhal start vidrsyncer and restart ikhal. This workflow isn’t that optimal. I could use a cronjob to sync any n minutes, but this isn't useful since mostly this cronjob wouldn't do anything, thus putting unnecessary load on the client and sever. Nobody is changing his calendar that often! Another option would be to wrap ikhal in a script which runs a sync before and after ikhal. Which does not solve the occasionally restarting of ikhal.
A solution like mutts macros would be great, or a slimmed down version of that (like mutt's query_command ).

@geier
Copy link
Member

geier commented Apr 11, 2016

Real macro support would probably involve a some refactoring (which I currently don't have time for).

But as this is probably a common workflow (it's mine too), supporting in with a bit of a hack is probably a good idea anyway. See #320 and #331 for related issues.

@untitaker
Copy link
Member

Perhaps this is better solved by pimutils/vdirsyncer#24? I.e. have a vdirsyncer daemon that just pushes new changes to the server.

If you really want the macro-thing, maybe you could launch khal in tmux and use tmux keybindings to launch sync?

@johannes-darms
Copy link
Author

Perhaps this is better solved by pimutils/vdirsyncer#24? I.e. have a vdirsyncer daemon that just
pushes new changes to the server.

This solution would have the same shortcomings as a cronjob. Most of the time the process will be idle. Another point is that users, who are using scp or some other tool to sync there vcards, cannot use this approach.

If you really want the macro-thing, maybe you could launch khal in tmux and use tmux keybindings to launch sync?

Yeah sure, I could use some external program for a macro. But then I need to restart ikhal anyhow since the update of the vcards isn't recognised.

Real macro support would probably involve a some refactoring (which I currently don't have time for).

I'm note sure if a 'real' macro thing is really needed. I just the term, since I couldn't find a better one. For me a simple solution is sufficient. One approach could be: Defining a shortcut and a command, and execute the command when the key is pressed. Afterwards the functions of #320 should be called.

sync_key="S" 
sync_key_command_="vdirsyncer sync"

@johannes-darms
Copy link
Author

I did some work on this issue and hacked a keyListener in the classicView and added some configuration options (like in my previous post) . Sadly I cannot refresh the whole frame from there without some kind of event propagation. So I thought about implementing it as a 'global' command in the window Class. IMHO this solution is better one thus it would be easier to add other Views without much altering the code/changing the behaviour. Currently the configuration isn't present in that scope of the Window Class. Would it be feasible/wise to add the configuration to the Window Class Scope?

@geier
Copy link
Member

geier commented May 3, 2016

Sure, feel free to pass around the config. In my opinion the current way of passing around parent objects to their own childs is much worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants