Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cmd color themes #495

Merged
merged 1 commit into from
Nov 23, 2016
Merged

add cmd color themes #495

merged 1 commit into from
Nov 23, 2016

Conversation

freignat91
Copy link
Contributor

@freignat91 freignat91 commented Nov 23, 2016

Related to #477

Have amp commands color themes to adapt colors to different terminals L&F.
Default is the "magenta" theme created by Neha, but it doesn't look good on Ubuntu default terminal which are magenta dark by default.
Added one named "dark" to be back to the original colors (white in place of magenta)

to change it, update $HOME/.amp.yaml file adding this line for instance:
cmdTheme: dark

For now only 2 themes (default or dark)

Test:

  • make install
  • start/stop amp: see the regular lines are magenta
  • update .amp.yml as explained
  • start/stop amp: see the regular lines are white

It's possible to add new theme updating cmd/amp/platform_manager.go

Copy link
Contributor

@ndegory ndegory left a comment

Choose a reason for hiding this comment

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

good idea to rename the column without the color, as it could change with the theme. The naming of the theme should be different though.


func (s *ampManager) setColors() {
theme := s.getTheme()
if theme == "white" {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the name of the theme should not be based on one of the color of the theme, but should match the terminal theme on which it displays best.
So here white should be black.

Copy link
Contributor Author

@freignat91 freignat91 Nov 23, 2016

Choose a reason for hiding this comment

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

done, renamed "dark", PR description updated too

@ndegory ndegory added this to the 0.4.0 milestone Nov 23, 2016
@freignat91 freignat91 force-pushed the cmd-theme branch 3 times, most recently from 91580a6 to 1c38d73 Compare November 23, 2016 10:39
if err != nil {
return ""
}
file, err := os.Open(path.Join(homedir, ".amp.yaml"))
Copy link
Contributor

Choose a reason for hiding this comment

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

why manually check the config?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, you're right, i updated the code to use the regular amp config

Copy link
Contributor

@bquenin bquenin left a comment

Choose a reason for hiding this comment

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

LGTM

@generalhenry
Copy link
Contributor

You can also do
amp config cmdTheme dark to switch to dark
and amp config cmdTheme default to switch back

@neha-viswanathan neha-viswanathan merged commit 31a5a4a into master Nov 23, 2016
@neha-viswanathan neha-viswanathan deleted the cmd-theme branch November 23, 2016 18:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants