-
Notifications
You must be signed in to change notification settings - Fork 179
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
Implement way to automatically detect dark/light terminal #150
Comments
Totally agreed; this would be wonderful! For anyone stumbling upon this who uses zsh on Mac with Terminal.app, this is what I have in the interim: mcfly_auto_light_mode() {
if [[ $(defaults read -g AppleInterfaceStyle) != 'Dark' ]]; then
export MCFLY_LIGHT=TRUE
fi
}
zsh-defer mcfly_auto_light_mode (the |
I'm game if you want to make this change @cmer. I think the determination should be in the mcfly.bash / mcfly.zsh / mcfly.fish scripts that then set the ENV. |
I have submitted a PR. |
This would apply only to new terminal/tabs right? ie it would not apply for existing ones.
i update would love for mcfly to have a config where i could set this (so it checks for the theme on each run) and i could update that file with https://github.com/cormacrelf/dark-notify |
For Gnome 43 it works like this: colorscheme="$(gsettings get org.gnome.desktop.interface color-scheme)"
if [ ! "$colorscheme" = "'prefer-dark'" ]; then
export MCFLY_LIGHT=TRUE
fi |
dconf read /org/gnome/desktop/interface/color-scheme |
I'd like to propose the following:
If
MCFLY_LIGHT
is set toTRUE
orFALSE
, force McFly to display in the specified mode.If
MCFLY_LIGHT
is NOT set, make a best effort guess to determine which mode to display in, otherwise fall back to dark mode. I was able to detect light/dark mode in some terminals (but not all) with the following Fish script:It'd be awesome if McFly could perform this check every time it is triggered when
MCFLY_LIGHT
is not set to any particular value.The
COLORFGBG
environment variable is set by many terminals such as iTerm2, Rxvt and Konsole. macOS Terminal does NOT set it, however.The text was updated successfully, but these errors were encountered: