-
Notifications
You must be signed in to change notification settings - Fork 936
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
xdg support for .mackup.cfg and .mackup #632
base: master
Are you sure you want to change the base?
Conversation
@@ -94,7 +94,20 @@ def get_config_files(): | |||
# Configure the config parser | |||
apps_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), | |||
APPS_DIR) | |||
custom_apps_dir = os.path.join(os.environ['HOME'], CUSTOM_APPS_DIR) | |||
xdg_config_home = os.environ.get('XDG_CONFIG_HOME') | |||
if xdg_config_home: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a lot of copy pasta. Can you add a util that you can use to look for a file in XDG_CONFIG_HOME if set, else in HOME? And use it everywhere?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very true. Will do.
Would you be ok with 2 utils?
|
@lra I updated this with the util functions as requested. I hope this isn't too much to merge at once... |
|
||
# Directory that can contains user defined app configs | ||
CUSTOM_APPS_DIR = '.mackup' | ||
if os.environ.get('XDG_CONFIG_HOME'): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry constants are constants, no code in here.
You can have different constants and pick one or another in functions defined elsewhere (e.g. utils)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I kinda felt that way too so I put it in a separate commit. Ill fix that.
I'll give it another review pass once those comments are dealt with, thanks! |
* upstream/master: changelog Update CHANGELOG.md Update ubersicht.cfg Update CHANGELOG.md Update bettertouchtool.cfg Add support for AppCode 3.2 Update README.md Add configuration for MacDive
@lra I made the suggested changes (at least I think I got all of them). Let me know if you want me to rebase/squash... |
@lra Just checking up on this... is there something I missed? |
no idea, I need to spend time reviewing it. |
Any updates here? |
@lra Are there any reviews or merge plans for this PR? |
Implements #473