[PR #1245] [MERGED] fix(bar): resolve env vars in the configuration switcher #1273

Closed
opened 2026-01-05 14:54:43 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/LGUG2Z/komorebi/pull/1245
Author: @CtByte
Created: 1/24/2025
Status: Merged
Merged: 1/24/2025
Merged by: @LGUG2Z

Base: masterHead: env_var


📝 Commits (1)

  • eb2fbab fix(bar): resolve env vars in the configuration switcher

📊 Changes

4 files changed (+53 additions, -1 deletions)

View changed files

📝 komorebi-bar/src/komorebi.rs (+2 -1)
📝 komorebi-client/src/lib.rs (+1 -0)
📝 komorebi/src/core/mod.rs (+2 -0)
komorebi/src/core/pathext.rs (+48 -0)

📄 Description

Environment variables were not supported in the location of the configuration switcher section as described in #1131.

I've decided to make an extension called PathExt (name debatable) that replaces any environment variable in a PathBuf.

It supports the following:

        "configuration_switcher": {
          "enable": true,
          "configurations": {
            "home": "$HOME/komorebi.json",
            "work": "$Env:USERPROFILE/komorebi.work.json"
          }
        }

My proposal is to use this extension other places as well in order to support any env vars in paths. Could it perhaps be used here?


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/LGUG2Z/komorebi/pull/1245 **Author:** [@CtByte](https://github.com/CtByte) **Created:** 1/24/2025 **Status:** ✅ Merged **Merged:** 1/24/2025 **Merged by:** [@LGUG2Z](https://github.com/LGUG2Z) **Base:** `master` ← **Head:** `env_var` --- ### 📝 Commits (1) - [`eb2fbab`](https://github.com/LGUG2Z/komorebi/commit/eb2fbabb8b253d97ece14e4694215eec4cde823a) fix(bar): resolve env vars in the configuration switcher ### 📊 Changes **4 files changed** (+53 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `komorebi-bar/src/komorebi.rs` (+2 -1) 📝 `komorebi-client/src/lib.rs` (+1 -0) 📝 `komorebi/src/core/mod.rs` (+2 -0) ➕ `komorebi/src/core/pathext.rs` (+48 -0) </details> ### 📄 Description Environment variables were not supported in the location of the configuration switcher section as described in #1131. I've decided to make an extension called `PathExt` (name debatable) that replaces _any_ environment variable in a PathBuf. It supports the following: ```json "configuration_switcher": { "enable": true, "configurations": { "home": "$HOME/komorebi.json", "work": "$Env:USERPROFILE/komorebi.work.json" } } ``` My proposal is to use this extension other places as well in order to support any env vars in paths. Could it perhaps be used [here](https://github.com/LGUG2Z/komorebi/blob/a575b28422b45ca4dc3cabef55009fed59fcf3be/komorebi/src/core/mod.rs#L496)? --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2026-01-05 14:54:43 +01:00
adam closed this issue 2026-01-05 14:54:43 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/komorebi#1273