Skip to content
This repository has been archived by the owner on Dec 16, 2021. It is now read-only.

how to specify theme? #110

Closed
1 of 2 tasks
aaronjanse opened this issue Jul 27, 2019 · 12 comments
Closed
1 of 2 tasks

how to specify theme? #110

aaronjanse opened this issue Jul 27, 2019 · 12 comments

Comments

@aaronjanse
Copy link

Is your source up to date

  • Yes
  • No

What happened

Looking at theme.go, I assumed that creating a themes.json next to the existing config.json (based on the default values) would change the theme of cordless.

What did you expect to happen

I expected the theme to change

How do you reproduce this bug

cat ~/.config/cordless/theme.json << EOF
{
	"PrimitiveBackgroundColor":    "#181920",
	"ContrastBackgroundColor":     "#6272a4",
	"MoreContrastBackgroundColor": "#ff79c6",
	"BorderColor":                 "#f8f8f2",
	"BorderFocusColor":            "#8be9fd",
	"TitleColor":                  "#f8f8f2",
	"GraphicsColor":               "#f8f8f2",
	"PrimaryTextColor":            "#f8f8f2",
	"SecondaryTextColor":          "#f1fa8c",
	"TertiaryTextColor":           "#50fa7b",
	"InverseTextColor":            "#ff5555",
        "ContrastSecondaryTextColor":  "#ffb86c"
}
EOF

Error output

How to fix

System information

Key Value
OS NixOS
Architechture x86
@Bios-Marcel
Copy link
Owner

I am sorry, currently the theming feature is more than a workaround. Since tview doesn't keep the actual background color, this feature was necessary at least in a minimal form to me. The plan for later is to actually make certain elements colorable, not just general stuff like "Primary Text". Anyway, currently the only way to generate a theme, is filling the struct in https://github.com/Bios-Marcel/cordless/blob/master/tools/theme/theme.go

Just change the values and do go run main.go > config.json.

@Bios-Marcel
Copy link
Owner

For reference, this is what happens when you actually keep don't manually set background colors: rivo/tview#314

@Bios-Marcel Bios-Marcel pinned this issue Jul 27, 2019
@aaronjanse
Copy link
Author

hey, no problem!

Just change the values and do go run main.go > config.json

Will this generate a configuration that will work with an unmodified version of cordless?

@Bios-Marcel
Copy link
Owner

oh btw i meant theme.json and yes, should work either way, just drop it in your configuration folder.

@aaronjanse
Copy link
Author

Hmmm, I got themes to work by editing theme.go, but a theme.json is not being sent to stdout (i.e. go run main.go > theme.json is writing anything to disk)

@Bios-Marcel
Copy link
Owner

oh sorry, sometimes my brain is off ... imeant to execute the theme utility not cordless main

@aaronjanse
Copy link
Author

I ended up writing a custom func main for theme.go and encoding json from there.
Thanks @Bios-Marcel!

@Bios-Marcel
Copy link
Owner

Okay, I am sorry wasn't able to explain stuff. Just for clarity, here again:

In order to change the theme you need to edit the values in:

https://github.com/Bios-Marcel/cordless/blob/master/tools/theme/theme.go

Go the sourcedirectory of cordless and run that file via go run tools/theme/theme.go it and pipe it into a file called theme.json. The theme.json`file then has to be moved to your config folder.

I am not sure what exactly you did. Mind to show me? I am glad that it worked anyway ^^

@aaronjanse
Copy link
Author

aaronjanse commented Jul 28, 2019 via email

@Bios-Marcel
Copy link
Owner

lol, good job.

@Bios-Marcel Bios-Marcel unpinned this issue Aug 11, 2019
@indeedwatson
Copy link

Is there no way to individually change these text colors?
img-2020-03-30-14:33:44

Show PMs seems to be the same color as the primary text, and the channel name is the same color as the primary (it says primitive but I assume it means to be primary) background. This seems like an oversight, given I can change the highlight background without being able to change the text color independent of the background.

@Bios-Marcel
Copy link
Owner

The theming hasn't been designed from the bottom up, so there's no principle to theme everything. We could technically come up with something though. Maybe something like css with component types and component ids or so 🤷‍♂️

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants