jschlatow / taskopen

Tool for taking notes and open urls with taskwarrior
GNU General Public License v2.0
364 stars 31 forks source link

xdg-basedirs #116

Closed ixil closed 3 years ago

ixil commented 5 years ago

Is it possible to support the xdg-basedir specification? It shouldn't affect anyone who doesn't use it, but will help keep $HOME clean of dotfiles if you do use it?

I don't know any perl but I think it's supported through here: https://metacpan.org/pod/File::BaseDir

jschlatow commented 5 years ago

@ixil that is an interesting suggestion. I'm still pondering on the pros and cons of this. On the con side, it adds perl dependency. A benefit could be that we could install a system-wide default config file and allow user-level overrides, however, there is no implementation of such a configuration logic yet. Do you have anything to add?

ixil commented 5 years ago

it adds perl dependency.

This could be easily done in bash, or some alternative means - though I don't think this is your point?

https://wiki.archlinux.org/index.php/XDG_Base_Directory has a nice list of existing applications that support this - and often the relevant commit - perhaps trawling through to find a relevant implementation with no dependency could just make this a case of copypasta?

Anything to add?

The only issue I could forsee is it should probably be backwards compatible - users who already have set the xdg-basedir variables (but may not necessarily know it) could find their config is no longer respected after an upgrade/update depending on their package.

jschlatow commented 5 years ago

Well, I am still a bit hesitant here because I think the behaviour should be similar to taskwarrior's configuration approach. In order to customise taskopen and integrate it with taskwarrior one needs to adapt both config files. As long as taskwarrior goes for ~/.taskrc as its default location I'd rather stay with ~/.taskopenrc for the taskopen config location. Please note, that nevertheless it is possible to specify a different location using by using the command line parameter -c.

ixil commented 5 years ago

A similar approach for using env variables as an override, and -c as the ultimate override, would be helpful - and inline with taskwarrior:

TASKDATA=/home/ixil/.local/share/task
TASKRC=/home/ixil/.config/task/taskrc

For now I guess the best idea is to just use an alias for the -c flag

jschlatow commented 5 years ago

I agree, adding support for an environment variable TASKOPENRC would be a reasonable enhancement.