Skip to content

Add dynamic theming for gum#4467

Open
severin-richner wants to merge 7 commits intobasecamp:devfrom
severin-richner:sync-theme-with-gum
Open

Add dynamic theming for gum#4467
severin-richner wants to merge 7 commits intobasecamp:devfrom
severin-richner:sync-theme-with-gum

Conversation

@severin-richner
Copy link

@severin-richner severin-richner commented Feb 2, 2026

Summary

This adds dynamic theming for gum by using the colors from the current theme.

Why

The gum cli tool is used quite extensively in omarchy scripts and it's default pink theme can look quite out of place.

Remark

I don't like how this requires to add a lot of different environment variables. Sadly it doesn't seem like gum provides a "global theme" setting, so this might still be the best option.

To avoid having all those variables in the environment, we could add a bash function which shadows gum and adds the variables just for this scope.

Examples

first image is before, second is after

Catppuccin: Install > Web App

catppuccin_install_webapp_before catppuccin_install_webapp_after

Catppuccin Latte: Remove > TUI

catppuccin_latte_remove_tui_before catppuccin_latte_remove_tui_after

Matte Black: Update > Omarchy

matte_black_update_before matte_black_update_after

Rose Pine: Install > Web App

rose_pine_install_webapp_before rose_pine_install_webapp_after

@severin-richner severin-richner changed the title Dynamic Theming for gum Add dynamic theming for gum Feb 2, 2026
@dhh
Copy link
Member

dhh commented Feb 7, 2026

Can you show some images of where this improves things? The gum styling we have now is already derived from the terminal colors that are theme dependent.

@severin-richner
Copy link
Author

Can you show some images of where this improves things? The gum styling we have now is already derived from the terminal colors that are theme dependent.

Added some example screenshots.

@dhh
Copy link
Member

dhh commented Feb 7, 2026

That's a clear improvement. Just a few notes and we can merge this 👌

default/bash/rc Outdated
source ~/.local/share/omarchy/default/bash/functions
source ~/.local/share/omarchy/default/bash/init
source ~/.local/share/omarchy/default/bash/envs
[[ -f $HOME/.config/omarchy/current/theme/gum.envs ]] && source $HOME/.config/omarchy/current/theme/gum.envs
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the simplicity of this, but then it would only apply to new terminals opened. Not existing ones, right?

Copy link
Author

@severin-richner severin-richner Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I just realized that then the theming also only applies to user bash shells, so scripts like omarchy-menu which don't source the ~/.bashrc file don't set the environment variables. (If they are started using a keyboard shortcut.)

I think setting the variables via hyprland might be the easiest approach?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, fine to set via hyprland. Then we actually get reloading for free. You shouldn't even have to call hyprctl reload.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, in this case I just reverted the last commit and keep it in the default/themed/hyprland.conf.tpl (since adding something like a default/themed/gum.env.conf.tpl, which then also gets added as a config to hyprland will probably just we more confusing than helpful).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer having this in a separate file. Hyprland doesn't have a problem with includes. So we should use use gum.env.conf and then link those from the default hyprland config inside omarchy.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I now added a separate gum.env.conf.tpl file for this.

@@ -0,0 +1,4 @@
#!/bin/bash

# reapply the current theme (also restarts hyprland to add the gum env variables)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are no longer restarting.

Copy link
Author

@severin-richner severin-richner Feb 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the migration script to also add the new gum.env.conf to the user's hyprland.conf.

Migration script just runs omarchy-theme-restart. The gum.env.conf file gets sourced in the default/hypr/envs.conf file.

@severin-richner severin-richner marked this pull request as draft February 7, 2026 22:53
@severin-richner severin-richner marked this pull request as ready for review February 7, 2026 23:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants