Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions azote/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,17 @@ def set_env(language=None):
os.mkdir(common.thumb_dir)

# command file
common.cmd_file = os.path.join(os.getenv("HOME"), ".azotebg")


if os.path.isfile(os.path.join(os.getenv("HOME"), ".azotebg")):
common.cmd_file = os.path.join(os.getenv("HOME"), ".azotebg")
log("~/.azotebg file found", common.INFO)
elif os.path.join(os.getenv("HOME"), ".local/bin") in os.getenv("PATH"):
common.cmd_file = os.path.join(os.getenv("HOME"), ".local/bin/azotebg")
elif os.path.join(os.getenv("HOME"), "bin") in os.getenv("PATH"):
common.cmd_file = os.path.join(os.getenv("HOME"), "bin/azotebg")
else:
common.cmd_file = os.path.join(os.getenv("HOME"), ".azotebg")
log("No valid $PATH location found, using the fallback location", common.INFO)
# temporary folder
common.tmp_dir = os.path.join(common.data_home, "temp")
if not os.path.isdir(common.tmp_dir):
Expand Down