blinksh / blink

Blink Mobile Shell for iOS (Mosh based)
https://blink.sh
GNU General Public License v3.0
6.17k stars 576 forks source link

[Feature Request] Automatic Theme Toggle #752

Open pbnj opened 5 years ago

pbnj commented 5 years ago

Hi @yury & @carloscabanero 👋

Thank you for this awesome app.

Similar to iPadOS' automatic toggle between light and dark mode, I am wondering if it is possible to have Blink toggle between light and dark themes (or toggle between any 2 themes based on time of day).

For my use-case, I generally prefer lighter themes during the day as it is easier to read black text on white background in bright environments and switch to darker themes at night as it's softer on the eyes in dark environments.

macOS Catalina also supports automatic toggling between light and dark mode as well, which extends to Apple's terminal app as well. Tied with #222, this feature would make for a really nice end-to-end light/dark mode experience on macOS as well as iPadOS, from the overall system all the way down to the vim process running in the terminal.

yury commented 5 years ago

Hi @petermbenjamin,

Yep, this is great feature for next release. Thank you.

goerz commented 5 years ago

+1. I'd very much like to be able to configure two themes in Blink's settings which get used depending on whether the system is in Dark Mode or Light Mode. Since 95% of the UI is determined by the scheme, the light-mode/dark-mode switch has little effect otherwise.

carloscabanero commented 5 years ago

I was thinking we could extend this through an environment variable to the remote. So emacs or vim can get it too. I know emacs has something like that, @goerz what do you think could work for the vim side?

goerz commented 5 years ago

Isn’t that what #222 is about?

carloscabanero commented 5 years ago

It actually is :)

helmut72 commented 4 years ago

That would be great. Nearly every of my used apps supports automatic dark mode switching.

rrroyal commented 4 years ago

Any progress?

aabdellah commented 3 years ago

Would really appreciate this as well.

sflomenb commented 3 years ago

Would like to add a +1 to this.

EinJochel commented 2 years ago

I found a workaround. You can create a Blink theme, that listens to changes to the preferred color theme of the OS.

Check whether dark mode is enabled:

window
  .matchMedia("(prefers-color-scheme: dark)")
  .matches

Add an event listener:

window
  .matchMedia("(prefers-color-scheme: dark)")
  .addEventListener("change", setPreferredScheme)

Here is an example theme.

The only caveat is, that the border of the terminal does not change with the color scheme. (Only visible when "Settings -> Appearance -> Default Layout" is set to "Fit" or "Fill".)

aabdellah commented 2 years ago

Thanks @EinJochel, great workaround, I think the safe area color is set by the app and it's set on tab creation and doesn't listen to trait collection events from iOS when dark mode state changes. I will try to look into it and do a PR if it's straightforward for me.