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

sncli colors not working correctly #113

Open
drewauff opened this issue Aug 29, 2021 · 10 comments
Open

sncli colors not working correctly #113

drewauff opened this issue Aug 29, 2021 · 10 comments

Comments

@drewauff
Copy link

drewauff commented Aug 29, 2021

Decided I want to change the colours to a monochrome style. Does not working. There is not a single colour in my .snclirc, only white, grey a black.

sncli insists on using the default colors.

the error message:

Traceback (most recent call last): File "/usr/local/bin/sncli", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.9/site-packages/simplenote_cli/sncli.py", line 1356, in main sncli(sync, verbose, config).gui(key) File "/usr/local/lib/python3.9/site-packages/simplenote_cli/sncli.py", line 1052, in gui self.sncli_loop = urwid.MainLoop(self.master_frame, File "/usr/local/lib/python3.9/site-packages/urwid/main_loop.py", line 118, in __init__ screen.register_palette(palette) File "/usr/local/lib/python3.9/site-packages/urwid/display_common.py", line 856, in register_palette self.register_palette_entry(*item) File "/usr/local/lib/python3.9/site-packages/urwid/display_common.py", line 923, in register_palette_entry basic = AttrSpec(foreground, background, 16) File "/usr/local/lib/python3.9/site-packages/urwid/display_common.py", line 537, in __init__ self.foreground = fg File "/usr/local/lib/python3.9/site-packages/urwid/display_common.py", line 637, in _set_foreground raise AttrSpecError(("Unrecognised color specification %s " + urwid.display_common.AttrSpecError: Unrecognised color specification 'gray' in foreground ('gray')

@samuelallan72
Copy link

samuelallan72 commented Aug 29, 2021

@drewauff sncli uses urwid - see http://urwid.org/reference/constants.html#standard-background-and-foreground-colors for the names of the supported colours. There is also this page which lists more colour options: http://urwid.org/manual/displayattributes.html#standard-foreground-colors I'm not sure which will be supported based on how the colours are used, but you're welcome to experiment.

Btw the error you're getting (Unrecognised color specification 'gray' in foreground ('gray')), means that gray is not a supported colour. Try light gray or dark gray.

@drewauff
Copy link
Author

changing gray to light gray got it to load, but im still stuck default colors — nothing changed?

@samuelallan72
Copy link

@drewauff please post your .snclirc file (obviously with credentials removed), and I'll be happy to take a look.

@drewauff
Copy link
Author

drewauff commented Sep 4, 2021

sorry about the delay, but here it is...

cfg_format_note_title = %F %-N %T
cfg_pager = micro

cfg_sn_username = 
cfg_sn_password = 

cfg_status_bar = no

kb_quit = esc
kb_edit_note = enter
cfg_editor = micro

kb_create_not = 'ctrl n'

kb_exit_note = 'left'

kb_view_note = right
kb_view_note_ext = enter

kb_down = down
kb_up = up

clr_note_focus_fg = white
clr_note_focus_bg = dark gray

clr_default_fg = white
clr_default_bg = black

clr_user_input_bar_bg = dark gray
clr_user_input_bar_fg = white

clr_note_date_fg = dark gray
clr_note_date_bg = black

clr_note_content_focus_fg = white
clr_note_content_focus_bg = black

clr_note_content_old_focus_fg = dark gray
clr_note_content_old_focus_bg = black

clr_help_header_fg = white
clr_help_header_bg = black

note_title_focus_fg = white
note_title_focus_bg = black


clr_focus_fg = white
clr_focus_bg = black

clr_status_bar_fg =  white
clr_status_bar_bg =  black

clr_log_fg = white
clr_log_bg = light green

@samuelallan72
Copy link

samuelallan72 commented Sep 5, 2021

@drewauff hmm there may be more you need to override - see the full list with defaults below:

'clr_default_fg' : 'default',
'clr_default_bg' : 'default',
'clr_status_bar_fg' : 'dark gray',
'clr_status_bar_bg' : 'light gray',
'clr_log_fg' : 'dark gray',
'clr_log_bg' : 'light gray',
'clr_user_input_bar_fg' : 'white',
'clr_user_input_bar_bg' : 'light red',
'clr_note_focus_fg' : 'white',
'clr_note_focus_bg' : 'light red',
'clr_note_title_day_fg' : 'light red',
'clr_note_title_day_bg' : 'default',
'clr_note_title_week_fg' : 'light green',
'clr_note_title_week_bg' : 'default',
'clr_note_title_month_fg' : 'brown',
'clr_note_title_month_bg' : 'default',
'clr_note_title_year_fg' : 'light blue',
'clr_note_title_year_bg' : 'default',
'clr_note_title_ancient_fg' : 'light blue',
'clr_note_title_ancient_bg' : 'default',
'clr_note_date_fg' : 'dark blue',
'clr_note_date_bg' : 'default',
'clr_note_flags_fg' : 'dark magenta',
'clr_note_flags_bg' : 'default',
'clr_note_tags_fg' : 'dark red',
'clr_note_tags_bg' : 'default',
'clr_note_content_fg' : 'default',
'clr_note_content_bg' : 'default',
'clr_note_content_focus_fg' : 'white',
'clr_note_content_focus_bg' : 'light red',
'clr_note_content_old_fg' : 'yellow',
'clr_note_content_old_bg' : 'dark gray',
'clr_note_content_old_focus_fg' : 'white',
'clr_note_content_old_focus_bg' : 'light red',
'clr_help_focus_fg' : 'white',
'clr_help_focus_bg' : 'light red',
'clr_help_header_fg' : 'dark blue',
'clr_help_header_bg' : 'default',
'clr_help_config_fg' : 'dark green',
'clr_help_config_bg' : 'default',
'clr_help_value_fg' : 'dark red',
'clr_help_value_bg' : 'default',
'clr_help_descr_fg' : 'default',
'clr_help_descr_bg' : 'default'

For example, clr_note_title_day_fg defaults to light red, and it's missing from your config.

@samuelallan72
Copy link

@drewauff by the way, you can see the current configuration by hitting h when sncli is running - this will show the description of each colour config option, the key, and the current setting.

@drewauff
Copy link
Author

drewauff commented Sep 5, 2021

hmmm, I only put the ones I needed to change.

So, I have to include al of them in the .snclirc ?

Ok thanks for tip.

@samuelallan72
Copy link

@drewauff well you'll need to include all that you want to change from the default. In your case, if you want monochrome, yeah you'll probably need to change all of them.

@drewauff
Copy link
Author

drewauff commented Sep 5, 2021

Ok, thanks..Ill give it go 👍🏽

@drewauff
Copy link
Author

drewauff commented Sep 5, 2021

nope same error even though "Gray" is not being used anywhere at all.

note: There is light gray and dark gray

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

No branches or pull requests

2 participants