# .theme\_history missing

**URL:** https://forum.maboxlinux.org/t/theme-history-missing/1699
**Category:** Terminals & CLI
**Created:** [June 14, 2024, 3:32am UTC](https://forum.maboxlinux.org/t/theme-history-missing/1699 "2024-06-14T03:32:45Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Rhuks](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/rhuks/32/511_2.png) [@Rhuks](https://forum.maboxlinux.org/u/Rhuks)
#### Post date: [June 14, 2024, 3:32am UTC](https://forum.maboxlinux.org/t/theme-history-missing/1699/1 "2024-06-14T03:32:45Z")

</div>

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? 😉) the file twice this week. Sometimes it keeps between boots. Nothing serious, just curious.

---

<div class="post-metadata">

### Author: ![Rhuks](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/rhuks/32/511_2.png) [@Rhuks](https://forum.maboxlinux.org/u/Rhuks)
#### Post date: [January 28, 2025, 2:23am UTC](https://forum.maboxlinux.org/t/theme-history-missing/1699/2 "2025-01-28T02:23:09Z")

</div>

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)

```auto
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.

---

<div class="post-metadata">

### Author: ![Rhuks](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/rhuks/32/511_2.png) [@Rhuks](https://forum.maboxlinux.org/u/Rhuks)
#### Post date: [January 30, 2025, 2:02pm UTC](https://forum.maboxlinux.org/t/theme-history-missing/1699/3 "2025-01-30T14:02:27Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![napcok](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/napcok/32/410_2.png) [@napcok](https://forum.maboxlinux.org/u/napcok)
#### Post date: [January 30, 2025, 2:07pm UTC](https://forum.maboxlinux.org/t/theme-history-missing/1699/4 "2025-01-30T14:07:12Z")

</div>

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

> **[GitHub - lemnos/theme.sh: A script which lets you set your $terminal theme.](https://github.com/lemnos/theme.sh)**
>
> A script which lets you set your $terminal theme.

---

<div class="post-metadata">

### Author: ![Rhuks](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/rhuks/32/511_2.png) [@Rhuks](https://forum.maboxlinux.org/u/Rhuks)
#### Post date: [January 30, 2025, 11:39pm UTC](https://forum.maboxlinux.org/t/theme-history-missing/1699/5 "2025-01-30T23:39:27Z")

</div>

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!

---

<div class="post-metadata">

### Author: ![napcok](https://forum.maboxlinux.org/user_avatar/forum.maboxlinux.org/napcok/32/410_2.png) [@napcok](https://forum.maboxlinux.org/u/napcok)
#### Post date: [January 30, 2025, 11:59pm UTC](https://forum.maboxlinux.org/t/theme-history-missing/1699/6 "2025-01-30T23:59:50Z")

</div>

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:

```auto
theme.sh one-dark

```
