You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Themes are currently hardcoded within the application, offering a limited set of predefined options. Check - internal/tui/theme.go
Desired Behavior:
Implement a system that allows users to create and use their own custom themes by placing theme configuration files in a designated directory within their .config folder (e.g., ~/.config/gitx/config.toml). This will enable greater personalization and flexibility.
Use toml as the config file format. (Open for discussion)
This would involve adding functionality to check if a file exists at ~/.config/gitx/config.toml. (If it doesn't exist gitx should not bother loading the user provided themes).
If a file is found, that is ~/.config/gitx/config.toml. It should contain a format as such:
# Default: "GitHub Dark"theme = "GitHub Dark"
If a theme is provided in the config.toml file, it would check if it's an inbuilt theme and default to that, if not it would check whether a matching theme is found in themes subdirectory.
The theme config file should include a format like such:
# General foreground and background colorsFg = "#ebdbb2"Bg = "#282828"# Normal colors
[normal]
Black = "#282828"Red = "#cc241d"Green = "#98971a"Yellow = "#d79921"Blue = "#458588"Magenta = "#b16286"Cyan = "#689d6a"White = "#a89984"# Bright colors
[bright]
Black = "#928374"Red = "#fb4934"Green = "#b8bb26"Yellow = "#fabd2f"Blue = "#83a598"Magenta = "#d3869b"Cyan = "#8ec07c"White = "#ebdbb2"# Dark colors
[dark]
Black = "#1d2021"Red = "#9d0006"Green = "#79740e"Yellow = "#b57614"Blue = "#076678"Magenta = "#8f3f71"Cyan = "#427b58"White = "#928374"
The final config file structure should look like this:
Add Custom Theme Support via Configuration Files
Current Behavior:
Themes are currently hardcoded within the application, offering a limited set of predefined options. Check - internal/tui/theme.go
Desired Behavior:
Implement a system that allows users to create and use their own custom themes by placing theme configuration files in a designated directory within their .config folder (e.g.,
~/.config/gitx/config.toml). This will enable greater personalization and flexibility.tomlas the config file format. (Open for discussion)~/.config/gitx/config.toml. (If it doesn't exist gitx should not bother loading the user provided themes).~/.config/gitx/config.toml. It should contain a format as such:config.tomlfile, it would check if it's an inbuilt theme and default to that, if not it would check whether a matching theme is found inthemessubdirectory.Tip
The desired behavior is open to discussion, if you think a better approach or behavior would be better, let us know!
PR Acceptance Criteria:
~/.config/gitx/themesdirectory.