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

feat: add a 'theme' command #1603

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

feat: add a 'theme' command #1603

wants to merge 2 commits into from

Conversation

teto
Copy link
Contributor

@teto teto commented Jun 6, 2022

to be able to change the theme dynamically see #1588

When running the command in development mode, I get:
Could not read toto and/or /home/teto/alot/alot/settings/../defaults/theme.spec

What is weird too is that starting alot in development mode takes 5 sec while the system one starts <1 sec . The system alot took longer the first time though so I wonder if alot generates some cache along the way ? Same happened with neomutt, took a long time starting the first time I ran it in a while then successive starts were much faster. I've got 136675 messages in DB and ran a notmuch compact.

to be able to change the theme dynamically
Copy link
Owner

@pazz pazz left a comment

Choose a reason for hiding this comment

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

It looks safe but needs cleaning up.

class ThemeCommand(Command):

"""move in widget"""
def __init__(self, theme_name=None, **kwargs):
Copy link
Owner

Choose a reason for hiding this comment

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

this does not do anything so could be omitted? the docstring is also not correct is it?

@pazz
Copy link
Owner

pazz commented Jun 7, 2022

I have not yet tested this but I agree that this feature would be nice to have.
I do not know why you see delayed startups in dev mode. perhaps printing the extra debug messages takes time due to some file system issue? There is certainly no caching going on as far as I am aware.

@teto teto marked this pull request as draft June 7, 2022 09:23
@teto
Copy link
Contributor Author

teto commented Jun 7, 2022

It doesn't work yet for some reason, the error message Could not read toto and/or /home/teto/alot/alot/settings/../defaults/theme.spec seems wrong: the file exists so it's probably that it cant "load" it instead. Gonna troubleshoot

@teto
Copy link
Contributor Author

teto commented Jul 10, 2022

still a WIP so no need to review yet but at least it's working. Planning to autocomplete theme name.
I find working with alot colorschmes a bit painful, I wonder if we could not update this to an easier format. One painful thing is to have mono, 16bit,256 colors on the same line:

[global]
    footer = 'standout','','white,bold','dark blue','white,bold','#006'

It's hard to read + If you want to create a theme, you have to set all of those.
maybe a file per format would be easier to work with ? e.g. sup_mono / sup_256 .
Also do we support RGB ? almost all terminals do and it looks ok in urwid http://urwid.org/manual/displayattributes.html and then we can automate the generation of theme to work with https://github.com/dylanaraps/pywal

@teto
Copy link
Contributor Author

teto commented Jul 10, 2022

hum I was looking at how to pass CI but I notice none of the current PRs pass CI: is that even doable ?
I was hoping to run the checks locally too but this seems to be all SAAS ?

@teto teto mentioned this pull request Jul 30, 2023
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