pindexis / marker

The terminal command palette
MIT License
2.02k stars 106 forks source link

Request: Make colors configurable via .markerrc file or environment variables #67

Open jolsen71 opened 4 years ago

jolsen71 commented 4 years ago

Please make ANSI colors configurable via an .markerrc file and/or environment variables.

The default blue is hard for me to read in my terminal, and it looks like the only way for me to change it is to fork the project and update marker/ansi.py. I'd rather keep the original code and simply influence appearance via configuration and skip forking the project or having to stash/pop my change every time there's a new upstream update to pull.

import os
FOREGROUND_BLACK = os.getenv("MARKER_FOREGROUND_BLACK", "\x1b[30m")
BACKGROUND_WHITE = os.getenv("MARKER_BACKGROUND_WHITE", "\x1b[47m")
FOREGROUND_GREY = os.getenv("MARKER_FOREGROUND_GREY", "\x1b[34m")

Better yet, move away from constant names of colors and instead use their purpose names, like maybe COMMAND, TITLE, DESCRIPTION, and SELECTED LINE and combine the foreground and background sequences into a single configuration. So if I wanted the SELECTED_LINE to be bold blue on yellow, I would define SELECTED_LINE="\x1b[1;34;43m" and a brighter green description color as DESCRIPTION="\x1b[1;32m".

It might also be nice to prepend \x1b[ and append m in the code instead of requiring those constant strings to be repeated in each color configuration.

Thanks