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

Feature request: color schemes for pywall #1447

Open
Migacz85 opened this issue Jan 21, 2019 · 9 comments
Open

Feature request: color schemes for pywall #1447

Migacz85 opened this issue Jan 21, 2019 · 9 comments

Comments

@Migacz85
Copy link

I like many other people found out that ranger is losing colors setup by pywall. And I found that troubling to setup it correctly.
Ranger is losing colors in situation when:

opening a file in text editor ( after closing it and coming back to ranger colors are original)
running custom shell function ( for this I found workaround just to include ; wal -R & but this is just ugly solution)

It is possible just to create some compability function for pywal that user can set it up like:

set color_scheme pywall

For using colors schemes that are located in .cache/wal/

?

@toonn
Copy link
Member

toonn commented Jan 21, 2019

To be quite frank I'm not sure what you're asking. I had no idea pywall did anything to ranger. And I have no idea how they change ranger's colorscheme. Ranger supports some RPC so it's potentially already possible.

@vifon
Copy link
Member

vifon commented Jan 24, 2019

From what I gather, pywal changes the terminal's colorscheme, not just ranger's. Now the question is how it does so since any "regular" customizations are not being erased. This ugly solution you found doesn't seem too bad considering ranger might need pywal to constantly "fix" the colors at this point.

Essentially further research required (why don't we have such tag yet?).

@vifon
Copy link
Member

vifon commented Jan 24, 2019

Here, I created it. :)

@Migacz85
Copy link
Author

I was thinking about that, the problem with ranger is that after reentering in to ranger again the colors are automaticaly setup by ranger colorscheme - there should be some option to completly turn off controling the colors by ranger. And that could potentialy solve the problem.

@Migacz85
Copy link
Author

If you have pywall installed
https://github.com/dylanaraps/pywal
You can look in ~/.cahe/wal/ folder
There are a bunch of nicely specified colors that are in python, bash, css, scss, json.

The question is how to implement them to ranger in the best possible way ?

@Migacz85
Copy link
Author

Migacz85 commented Jan 26, 2019

After reading this:
https://github.com/ranger/ranger/blob/master/doc/colorschemes.md

I think it would be best to create a colorscheme .py that will import colors from pywall files.
Structure should be simmilar to jungle.py snow.py default.py files. Located in:

Colorschemes are searched for in these directories:

~/.config/ranger/colorschemes/
/path/to/ranger/colorschemes/

But I'm not quite sure where is the file located when refferencing to import in this part of the code in this files:

from ranger.gui.color import (
black, blue, cyan, green, magenta, red, white, yellow, default,
normal, bold, reverse, dim, BRIGHT,
default_colors,
)

@Jitsusama
Copy link

I took a look at this, and those colours are mapped to curses colours which are integers starting from 0. I'm pretty sure that they map to the terminal colours 0-15. What I don't understand is how they end up getting over-ridden. I suspect that it might be the curses library itself doing this, though I haven't dug in far enough to validate this.

@Jitsusama
Copy link

I tried something else. I use Kitty as my terminal. I pointed Kitty at my ~/.cache/wal/colors-kitty.conf file instead of catting ~/.cache/wal/sequences and it seems to have fixed everything up with Ranger.

@hbthen3rd
Copy link

Is there a way to support the cat ~/.cache/wal/sequences & method?
I use iTerm2, and pywal set iTerm2 color scheme by doing cat ~/.cache/wal/sequences - which seems to NOT get updated when default.py import colors 0-15 from terminal colors.

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

5 participants