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

Load COL_SCHEMEs from files #163

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

baskervald
Copy link
Contributor

Rather than having ui/__main__.py need to be edited for users to add their own color styles, users can now add their colorschemes using .col files within $XDG_CONFIG_HOME/hangups/colors using this format:

(just a translation of the solarized-dark colorscheme to the format)

active_tab     'light gray' 'light blue'
inactive_tab   'underline'  'light green'
msg_date       'dark cyan'  ''
msg_sender     'dark blue'  ''
msg_text       ''           ''
status_line    'standout'   ''
tab_background 'underline'  'black'

Comments can be added if they're prefaced with #, and the spacing is unnecessary but more readable.

@tdryer
Copy link
Owner

tdryer commented Sep 15, 2015

Nice idea! I'm not sold on the custom file format though. What do you think of this method?

  1. Allow specifying colours in the arguments and config file, for example --col-active_tab "light gray". This keeps consistency with how the other options work.
  2. To support colour scheme files, use an approach similar to what you've done here, but load the file using ConfigArgParse again, so it can use the same format.

We'll also need to update the documentation.

@tdryer
Copy link
Owner

tdryer commented Sep 15, 2015

After writing that I remembered about the foreground/background issue, which would make the arguments messier. Maybe it's simpler to just keep colour schemes separate. I'll have to think about it.

@baskervald
Copy link
Contributor Author

Yeah. I was initially thinking of using the config format already in place, but I realized that it'd be really difficult to use for two values, especially since commas are already taken for having mutliple values in foreground (or background). ex. "underline,light blue", so I decided on a shlex-based format which has the easiest time processing multiple values.

@tdryer
Copy link
Owner

tdryer commented Sep 17, 2015

How about JSON? Slightly verbose, but it's also more self-documenting.

{
    "active_tab": {
        "foreground": "light gray",
        "background": "light blue"
    },
    ...
}

@baskervald
Copy link
Contributor Author

That's definitely an option. I didn't go with that due to my dislike for how verbose it is, but I'll throw together a branch that uses it real quick.

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