-
Notifications
You must be signed in to change notification settings - Fork 21
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
Pick default theme based on terminal background color #67
Comments
Example shell script for querying the terminal background color: #!/bin/sh
OLDSTTY=$(stty -g)
stty raw -echo min 0
echo "\033]11;?\033\\"
# If this delay is too short you will miss your terminal's response
sleep 1
read -r ANSWER
stty "$OLDSTTY"
# Extract response body
RGB=$(echo "$ANSWER" | sed 's/[^r]*//' | sed 's@[^rgb:0-9a-f/]@@g')
echo "$RGB" Example response: Inspired by: https://stackoverflow.com/a/30540928/473672 |
We should re-apply ed49174 (pick status bar color based on the current style) or something to that effect after this is done. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
According to https://stackoverflow.com/a/7767891/473672 some terminals support querying the actual background color of the terminal window.
Unclear what happens with background images / transparency, but still.
Example usage, text after the second
$
is the response from the terminal.The text was updated successfully, but these errors were encountered: