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

Possible collaboration #130

Closed
livanh opened this issue Mar 14, 2018 · 12 comments
Closed

Possible collaboration #130

livanh opened this issue Mar 14, 2018 · 12 comments

Comments

@livanh
Copy link

livanh commented Mar 14, 2018

For quite some time, I've been writing my own tool to easily switch between color themes:
https://github.com/livanh/gcs
Under the hood, it uses oomox to generate themes for gtk+ 2/3, but it also applies the same colors to a number of applications that have their own settings (e.g. window managers, editors with syntax highlighting), similarly to how oomoxify works.

My main goal is to have as much visual consistency as possible across the entire desktop, and keep it while switching themes. I think there is the potential for some interesting synergies between the two projects. Things like a common format for themes or plugins. @actionless what do you think? I can share more details if you are interested (I still need to write some good documentation).

@actionless
Copy link
Member

actionless commented Mar 14, 2018

that seems to be similar to #101 and #102

first part of that is already implemented here:
https://github.com/actionless/oomox/tree/master/plugins/import_base16

second part will be to use base16 templates for exporting oomox themes, they covering quite a lot of applications:
https://github.com/base16-builder/base16-builder/tree/d022b9daa5c233a08a8d3b94fd534a3041e3a8c1/db/templates

also here list of templates is newer, but seems to be smaller: https://github.com/chriskempson/base16

and regarding theme file format: i think what extending the current omox theme file format with grayscale shades (https://github.com/base16-builder/base16-builder/blob/master/db/schemes/3024.yml#L4-L11) should make oomox themes compatible with base16 themes in both directions and generally (together with all currently available theme variables) should cover most of the usecases i could come up with.

however current plugin API also allows for plugins to extend oomox theme format with their own theme variables or import theme in its own format (defined by theme file extension)

also i took a look on gcs, https://github.com/livanh/gcs/tree/master/src/share/modules, the list and themes themselves quite different from the ones in base16, so it could work well as an export plugin

@actionless
Copy link
Member

so, are you still interested? otherwise please close the ticket

@actionless
Copy link
Member

see also related discussion here: #116

@livanh
Copy link
Author

livanh commented Mar 26, 2018

Sure, still interested, I was just busy with real life things (more than usual, but getting normal again).

I had a quick look at base16, is seems to be focused on syntax highlighting in text editors. At this point I think it makes sense to treat UI colors and syntax highlighting colors independently, or mostly so. I was triyng to do both together but it kind of looked as a forced thing.

What's the scope of oomox with respect to this? Do you want to do both or just UI colors? Does it make sense to use base16 colors for UI? What about a base16 export plugin?

@actionless
Copy link
Member

actionless commented Mar 26, 2018

Regarding base16 i am not proposing to stick to their format but just to extend the current oomox theme format to be fully-compatible with base16.
Right now in base16 format there are not only colors like 'Red' or 'Green', but also Light1, Light2, Dark1, Dark2 (which are not supported in oomox). So when base16 theme is being imported those extra colors are used for, let's say, Background, Text or Button color, but oomox theme can't be exported back to base16 because oomox theme is not storing those Dark1, Dark2, etc.

Regarding oomox format itself, in the base theme model (which can be extended by plugins), https://github.com/actionless/oomox/blob/master/oomox_gui/theme_model.py, currently are presented:

  1. UI-related colors, mostly a copy of standard stylecontext variable in both gtk2/gtk3 (bg, fg, base, text, sel_bg, sel_fg, etc); there are some extra theme options there but they eventually will move to the plugins themselves, like here: https://github.com/actionless/oomox/blob/master/plugins/theme_materia/oomox_plugin.py#L51-L74
  2. terminal-related colors, bg, fg, 8+8 main colors
  3. name of the currently chosen plugins for theme, icons

Do you have any more suggestions rather than adding Light/Dark colors? Also I am not sure how to handle those colors in the UI since so far they will be used only for importing/exporting base16 colortheme so it could be quite confusing for a user to have them in the list.

Also on exporting to base16, i was thinking what for the themes which doesn't have Light/Dark colors (ie were not imported from base16 format) to generate those colors from gtk BG and FG (choosing whatever of them is darker than other one)

@livanh
Copy link
Author

livanh commented Mar 30, 2018

I don't think you can do a perfect 1:1 mapping between base16 themes (intended for text editors) and oomox themes (intended for GUI elements). They're not meant to be compatible, because they have a different target.
If you decide to extend oomox to generate syntax highlighting styles, then base16 themes would become a subset of oomox themes, and you could import/export them. You'd lose most UI colors when exporting, but it can't be helped IMHO. Probably the simplest way is to actually use a base16 builder as an export plugin, so that all their templates are immediately available.

@actionless
Copy link
Member

I don't think you can do a perfect 1:1 mapping between base16 themes (intended for text editors)

oomox already have mapping for terminal colors which are almost compatible (except for missing Orange color), so as i mentioned before only adding Dark/Light is required (and yes, to do something with orange, mb just mix red and yellow during the export from oomox to base16). I think we can continue the discussion related to base16 export in this issue: #101

Probably the simplest way is to actually use a base16 builder as an export plugin, so that all their templates are immediately available.

Yup, i've linked that ticket before, #102

@livanh
Copy link
Author

livanh commented Mar 30, 2018

Going back to the initial topic, I'll try to summarize the features in gcs that we could try to replicate in oomox:

  • export themes for syntax highlighting in text editors and IDEs (either using base16 or written from scratch)
  • export colors for window managers (e.g. active/inactive/urgent titlebars)
  • export colors for miscellaneous applications which have their own color settings (as I said, I like to have consistent colors across all applications)
  • apply the new colors right after generating themes, in all supported applications, even on-the-fly where possible
  • set the desktop wallpaper as specified in the theme

Of course, this is your project and you choose what features are important to you.
Also, I have limited free time to do this kind of things unfortunately, so it would be better to do one thing at a time, if we decide to do any of this.

@actionless
Copy link
Member

actionless commented Mar 31, 2018

export themes for syntax highlighting in text editors and IDEs (either using base16 or written from scratch)

export colors for miscellaneous applications which have their own color settings (as I said, I like to have consistent colors across all applications)

i don't have strong preference on that, actually. for me it's not a big difference if export plugin will be named export_gcs or export_base16_generator, PRs for both would be appreciated

export colors for window managers (e.g. active/inactive/urgent titlebars)

it can be done either as part of previous point or they can be added here: https://github.com/actionless/oomox-gtk-theme/tree/master/src

apply the new colors right after generating themes, in all supported applications, even on-the-fly where possible

set the desktop wallpaper as specified in the theme

oomox was always meant to be theme generator/designer. on Linux/*BSD trying to write something like in quotes above would always quite flacky and potentially-destroyable to user's configs. for example I know at least 5 different ways of changing GTK+3 theme, nyaff said

@livanh
Copy link
Author

livanh commented Mar 31, 2018

on Linux/*BSD trying to write something like in quotes above would always quite flacky and potentially-destroyable to user's configs.

This is true, sadly. There are few cases where it can be done safely, but most of the times I end up editing config files directly.
In the end, I think I'll try to do #101 and #102, so I can use oomox to design themes and gcs for quick switching.

@actionless
Copy link
Member

so I can use oomox to design themes and gcs for quick switching.

that's quite unix-way approach, i think

@actionless
Copy link
Member

actionless commented Mar 31, 2018

also i think to make it easier for gcs to quickly switch the theme, you can make export plugin to export all the terminal and other themes right to ~/.themes/THEME_NAME directory together with GTK/WM themes, so you'll have a single directory which you could use as input for theme-switching

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

No branches or pull requests

2 participants