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

NatLink configuration and the $HOME directory #26

Open
Voxellence opened this issue Oct 11, 2022 · 2 comments
Open

NatLink configuration and the $HOME directory #26

Voxellence opened this issue Oct 11, 2022 · 2 comments
Assignees

Comments

@Voxellence
Copy link

Voxellence commented Oct 11, 2022

The NatLink configuration utility's documentation says the .natlink directory is by default under the $HOME directory.
However, the utility doesn't actually query the $HOME environment variable. Instead it assumes that everyone has left $HOME at its default Windows location, but in my case I have indeed changed it entirely.

I've managed to do a workaround by changing the location of the .natlink directory. I did this by creating and setting a new environment variable...
$NATLINK_USERDIR
...and then using the Windows Environment Variables dialog box to add a New... User variable like...
Variable name: NATLINK_USERDIR
Variable value: %HOME%\.natlink

That way the directory still has the same name but is now actually under $HOME as originally intended. Still, the configuration utility should probably look at the environment variable so that, when the user has changed the path pointed to by $HOME, things work without the user having to define an additional environment variable (NATLINK_USERDIR) due to naïve assumptions made by the configuration utility.

@dougransom
Copy link
Member

Interesting. So many programs don't read the $HOME directory and hard code c:... that I have found changing my home directory a path to madness.

@dougransom dougransom self-assigned this Oct 18, 2022
@dougransom
Copy link
Member

dougransom commented Oct 18, 2022

@Voxellence Could you please post the results of running this on your computer?

`S C:\Users\Doug\dictation toolbox\natlinkcore> python
Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 13:51:36) [MSC v.1933 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

from pathlib import Path
Path.home()
WindowsPath('C:/Users/Doug')`

and
import os print(os.path.expanduser("~"))

and

Path('~').expanduser()

natlinkcore config.py uses Path.home() to locate the home folder.

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

No branches or pull requests

2 participants