-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
HARDThis bug/feature request requires deep understanding of the problem and the codebase.This bug/feature request requires deep understanding of the problem and the codebase.enhancementNew feature or requestNew feature or requesthacktoberfestIssue is up for grabs for hacktoberfestIssue is up for grabs for hacktoberfestlanguage/goRequires the knowledge of "Go"Requires the knowledge of "Go"
Description
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.
- Use
tomlas 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.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. - The theme config file should include a format like such:
# General foreground and background colors
Fg = "#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:
.config/
└ gitx/
├ config.toml
└ themes/
└ my_custom_theme.toml
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:
- gitx must be able to load custom theme files from a
~/.config/gitx/themesdirectory. - A clear and well-documented format for theme configuration files must be created and added to the project's documentation.
- Users should be able to switch between both built-in and custom themes from within the application.
- Attach a screenshot or short video showcasing a custom theme being loaded and applied.
Metadata
Metadata
Assignees
Labels
HARDThis bug/feature request requires deep understanding of the problem and the codebase.This bug/feature request requires deep understanding of the problem and the codebase.enhancementNew feature or requestNew feature or requesthacktoberfestIssue is up for grabs for hacktoberfestIssue is up for grabs for hacktoberfestlanguage/goRequires the knowledge of "Go"Requires the knowledge of "Go"