[+] Add global config option for overlay
This commit is contained in:
parent
0ac2ffbba5
commit
a37ee211f2
2 changed files with 5 additions and 1 deletions
|
@ -35,6 +35,7 @@ class GlobalConfig:
|
||||||
override_distro: str | None
|
override_distro: str | None
|
||||||
debug: bool
|
debug: bool
|
||||||
is_light: bool
|
is_light: bool
|
||||||
|
use_overlay: bool
|
||||||
|
|
||||||
def light_dark(self) -> LightDark:
|
def light_dark(self) -> LightDark:
|
||||||
return 'light' if self.is_light else 'dark'
|
return 'light' if self.is_light else 'dark'
|
||||||
|
@ -45,6 +46,6 @@ class GlobalConfig:
|
||||||
return 0.65 if term.lower() == 'dark' else 0.4
|
return 0.65 if term.lower() == 'dark' else 0.4
|
||||||
|
|
||||||
|
|
||||||
GLOBAL_CFG = GlobalConfig(color_mode='8bit', override_distro=None, debug=False, is_light=False)
|
GLOBAL_CFG = GlobalConfig(color_mode='8bit', override_distro=None, debug=False, is_light=False, use_overlay=False)
|
||||||
|
|
||||||
MINGIT_URL = 'https://github.com/git-for-windows/git/releases/download/v2.37.2.windows.2/MinGit-2.37.2.2-busybox-32-bit.zip'
|
MINGIT_URL = 'https://github.com/git-for-windows/git/releases/download/v2.37.2.windows.2/MinGit-2.37.2.2-busybox-32-bit.zip'
|
||||||
|
|
|
@ -119,6 +119,9 @@ class ColorProfile:
|
||||||
:param term: Terminal color (can be "dark" or "light")
|
:param term: Terminal color (can be "dark" or "light")
|
||||||
:return: New color profile (original isn't modified)
|
:return: New color profile (original isn't modified)
|
||||||
"""
|
"""
|
||||||
|
if GLOBAL_CFG.use_overlay:
|
||||||
|
return self.overlay_dl(light, term)
|
||||||
|
|
||||||
term = term or GLOBAL_CFG.light_dark()
|
term = term or GLOBAL_CFG.light_dark()
|
||||||
assert term.lower() in ['light', 'dark']
|
assert term.lower() in ['light', 'dark']
|
||||||
at_least, at_most = (True, None) if term.lower() == 'dark' else (None, True)
|
at_least, at_most = (True, None) if term.lower() == 'dark' else (None, True)
|
||||||
|
|
Loading…
Reference in a new issue