.theme_history missing

Hello guys.
I don’t remember when it started, but recently I notice the file ~/.theme_history disappears from my home directory. Then, terminal theme fallbacks to default, losing the theme I’d chosen. When I call th command, the file is created and it applies the “3024” theme, creating a new .theme_history
I’ve have created (touched? :wink:) the file twice this week. Sometimes it keeps between boots. Nothing serious, just curious.

Hello there!
This is what I’ve found: the theme.sh script first looks for the .theme_history in the XDG_CONFIG_HOME and if not, in the home directory (lines 315 and 448)

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

Until now, the .theme_history file disappeared, with the inconsistent behavior I’ve describe in my first post.

I think I’ve solved it: the XDG_CONFIG_HOME directory wasn’t set in user-dirs.dirs. Now the selected terminal theme is set after boots and suspensions. Why the script was doing that even when it evaluates first one path and then the other to set the config_dir is beyond my knowledge.
Have a nice week.

Well, the erratic behavior has disminished: sometimes, after suspension, the .theme_history is rewritten with the 3024 theme. Besides, if the .theme_history file is remove from any of both paths, the issue reappears. Right now I have two files, one in XDG_CONFIG_HOME and the other in HOME. my terminal emulator is Terminator.

What shell you use?
If not default - bash, then you need to configure this yourself as described in detail on the project website.

Hello, Napcok,
I’m using bash in Terminator.
Last week I’ve reinstalled the script. Not a big deal, but it was annoying setting the theme I like each time I opened the terminal.
Keep up with the good work!

Can somebody reproduce/confirm this behavior?

I’ve done dozens of Mabox installs on live hardware and probably a few hundred as VMs. I’ve never seen anything like this before and I’m 100% certain that this behavior isn’t caused by a bug in the Mabox scripts.

@Rhuks if you have these weird things happening all the time and you can’t find the cause, you can simply force your favorite theme to be set at the end of the ~/.bashrc file, for example:

theme.sh one-dark
1 Like