lemnos / theme.sh

A script which lets you set your $terminal theme.
Other
912 stars 45 forks source link

Why test for history file in configuration snippets in README? #50

Open jrd-oje opened 11 months ago

jrd-oje commented 11 months ago

Hi, thanks for your life-changing script. I especially admire anyone who tries to stay posix compliant and not bash out.

Unfortunately, I don't understand why the configuration snippets in the README test for the existence of the history file. After all, theme -l gives a valid output whether the file exists or not. The snippets didn't work for me at first because I set XDG_CONFIG_HOME and the awk statements in theme.sh determine the location of the history file with the environment variables:

config_dir = (ENVIRON["XDG_CONFIG_HOME"] ?  ENVIRON["XDG_CONFIG_HOME"] : ENVIRON["HOME"])

histfile = config_dir"/.theme_history"

If there is no error in my logic, here is already a PR for the change.