Marlon's Blog

记录生活、技术中的二三事.


  • Home

  • Archives

  • Tags

  • Bio

自动切换 MacOS 主题颜色

Published at: 2021-04-10   |   Reading: 312 words ~1min

最近白天在公司使用 Dark 模式的主题眼睛刺痛. 但是又比较喜欢暗色系主题. 想到 macos 下 部分软件是支持主题颜色跟随系统切换的, 那么白天就可以使用相对护眼的浅色系主题, 晚上再换回来~ 探索下如何在自己常用的几个工具中做对应设置:

  • VSCode
  • Goland
  • Iterm2
  • Neovim

目前初步达到想要的效果了~

VSCode

vscode本身支持了设置:

1
2
3
4
5
{
    "workbench.colorTheme": "Atom One Dark",
    "workbench.preferredDarkColorTheme": "Atom One Dark",
    "workbench.preferredLightColorTheme": "Solarized Light"
}

设置对应模式下的模板即可

Goland

Goland 需要安装一个插件 Auto Dark Mode, 然后在 Plugin 的设置中设置对应模式主题即可.

设置

Iterm2

Iterm2可以借助 python 插件的能力, 来监听系统的 Dark 模式切换.

设置教程

Neovim

Neovim 的设置依赖一个vim插件 dark_notify

通过 vim 插件安装后, 在 init.vim 中增加以下设置

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
" dark-notify
:lua <<EOF
local dn = require('dark_notify')
dn.run({
    schemes = {
        dark = "gruvbox",
        light = "solarized8",
    },
})
EOF

就万事大吉啦~

最终效果

播放效果

参考

  • Automatic dark mode for terminal applications
  • iterm2_switch_automatic.md
#vim#
  • Author: Marlon Fan
  • Link: https://marlon.life/2021/04/10/auto-switch-dark-mode/
  • License: All articles in this blog are licensed under CC BY-NC-ND 4.0 unless stating additionally.
Golang自研网关的灰度部署方案
关于istio
Marlon Fan

Marlon Fan

宁静致远

48 Blogs
30 Tags
Homepage GitHub Twitter Zhihu
Friends
    过往云烟
© 2008 - 2022 Marlon Fan. All rights reserved. 晋ICP备20002733号-1
0%