wakatime / jetbrains-wakatime

IntelliJ IDEA, PyCharm, RubyMine, PhpStorm, AppCode, AndroidStudio, Goland, Rider, & WebStorm plugin for quantifying your coding.
https://wakatime.com/intellij-idea
BSD 3-Clause "New" or "Revised" License
1.12k stars 162 forks source link

Please respect `WAKATIME_HOME` environment variable #252

Open ivuorinen opened 1 year ago

ivuorinen commented 1 year ago

Currently setting WAKATIME_HOME env variable is being ignored, causing there to be two sets of configurations.

The best would be to support XDG Base Directory Specification if user has made it possible. Here's a nicer to read spec and examples of applications using it.

alanhamlett commented 1 year ago

We're working towards using XDG base directory with https://github.com/wakatime/wakatime-cli/issues/558.

For now, I'll release a new version of jetbrains-wakatime today supporting $WAKATIME_HOME.

alanhamlett commented 1 year ago

Turns out we're already reading and using $WAKATIME_HOME if it's available to the jetbrains IDE process:

https://github.com/wakatime/jetbrains-wakatime/blob/66d85885a26ddd3cca5c300a485c11ab8223fa17/src/com/wakatime/intellij/plugin/ConfigFile.java#L27 https://github.com/wakatime/jetbrains-wakatime/blob/531769c2d570cebdb6a0191e5f0a03d690b1381f/src/com/wakatime/intellij/plugin/Dependencies.java#L64

How are you setting that env var and making it available to the ide?

ivuorinen commented 1 year ago

All of zsh (my default), sh and bash echo the $WAKATIME_HOME to one I've set (~/.local/state/wakatime), and after deleting the files (~/.wakatime.cfg, ~/.wakatime-internal.cfg) and relaunching PHPStorm it asks for the API key and the files appear again to the root of my homedir.

Is there a special way I should make PHPStorm aware of the env settings?

corruptmane commented 6 months ago

Issue still persists. I also checked Run/Debug configurations to see system-wide env variables that my IDE (PyCharm) can see, and I see WAKATIME_HOME variable there, but PyCharm (or should I say WakaTime plugin) still asks me to enter API_KEY and automatically creates .wakatime.cfg file as well as .wakatime directory