惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Full Disclosure
WordPress大学
WordPress大学
小众软件
小众软件
Cloudbric
Cloudbric
AWS News Blog
AWS News Blog
腾讯CDC
量子位
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Vulnerabilities – Threatpost
Scott Helme
Scott Helme
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
The Hacker News
The Hacker News
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
IT之家
IT之家
Jina AI
Jina AI
Attack and Defense Labs
Attack and Defense Labs
S
SegmentFault 最新的问题
Simon Willison's Weblog
Simon Willison's Weblog
The Cloudflare Blog
阮一峰的网络日志
阮一峰的网络日志
T
Tailwind CSS Blog
Last Week in AI
Last Week in AI
博客园 - 【当耐特】
Google Online Security Blog
Google Online Security Blog
美团技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
Visual Studio Blog
罗磊的独立博客
L
LINUX DO - 最新话题
博客园 - Franky
博客园 - 叶小钗
Apple Machine Learning Research
Apple Machine Learning Research
The Last Watchdog
The Last Watchdog
J
Java Code Geeks
AI
AI
C
Cisco Blogs
酷 壳 – CoolShell
酷 壳 – CoolShell
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
博客园 - 三生石上(FineUI控件)
雷峰网
雷峰网
Help Net Security
Help Net Security
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
云风的 BLOG
云风的 BLOG
I
Intezer
S
Securelist

Fatih Arslan

Review of the MoErgo Go60 Keyboard Typeface Specimens of Houston Mono™ Nakaya Aka-Tame Fountain Pen Books I Read in 2025 A Look at My Fountain Pens Midori MD Notebooks My two-part desk setup Thoughts on the Leica M EV1 Bambu Lab H2S vs X1C A Week in Billund: LEGO House, LEGOLAND, and Lalandia Hyper Case: Designing my own keyboard case Fujifilm X half: Is it the perfect family camera ? The Barbican Managing friction I was wrong about AI Coding Plotter Notebook System
Automatic dark mode for Terminal Apps, Revisited
Fatih Arslan · 2025-06-06 · via Fatih Arslan

Four years ago, I wrote a blog post explaining how I set up automatic dark mode for my terminal apps. Back then, it needed some workarounds— Fish scripts, AppleScript installation, and other tricks to make everything sync together. I can't say it was easy. The scripts were simple, but there were always certain things that broke when I upgraded the tools or macOS itself.

With the recent developments, a lot of things are easier. And I thought I'll do a recap on what has changed. You'll be surprised how much code I've deleted. Here is a how it looks, you can see how Ghostty, Tmux and NeoVim all change their themes automatically:

Ghostty

First of all, I switched from Alacritty to Ghostty Terminal. Ghostty is well built and has top-notch, first class support for macOS. There are a few features that I still miss (e.g: scrollback search), but for now it's working fine. But one feature I really like is its built-in support for switching themes based on system appearance.

All I had to do was add this line to my ghostty.config:

theme = light:GruvboxLightHard,dark:GruvboxDarkHard

That’s it. No need for extra scripts or tools. Ghostty automatically listens to macOS appearance settings and uses the light/dark themes accordingly.

Neovim

Next, I set up Neovim to follow system appearance. I’m using a plugin called cormacrelf/dark-notify. It runs in the background and automatically updates the theme when the system changes.

Here’s what I added to my init.lua:

-- automatic dark mode
{ 
  "cormacrelf/dark-notify",
  config = function ()
    require("dark_notify").run()
  end,
},

The plugin listens to the events by the dark-notify service, and then updates the theme automatically. Behind the scenes it updates the background to 'dark' and 'light'. So all you have to use is to setup a theme that supports dark and light mode.

I use gruvbox everywhere, so this is what I have in my init.lua:

-- colorscheme
{ 
  "ellisonleao/gruvbox.nvim", 
  priority = 1000, -- make sure to load this before all the other start plugins
  config = function ()
    require("gruvbox").setup({
      contrast = "hard"
    })
    vim.cmd([[colorscheme gruvbox]])
  end,
},

Tmux

Lastly, even tmux can follow dark mode. The same plugin we use for Vim also works for tmux too.

Here’s what I added to my tmux.conf:

set -g @plugin 'erikw/tmux-dark-notify'

set -g @dark-notify-theme-path-light '$HOME/.tmux/tmux-light.conf'
set -g @dark-notify-theme-path-dark '$HOME/.tmux/tmux-dark.conf'

This sets up light mode styles and tells dark-notify to handle tmux switching too. It updates the background and foreground colors based on the system setting.

Verdict

All these changes are tracked in my dotfiles, go check them out. The old setup had too much glue code. Now, each app handles theme switching by itself or with a small plugin. Meaning I also deleted all the bespoke scripts I wrote.

We’ve gone from:

  • Writing custom shell scripts
  • Polling system appearance
  • Manually syncing theme configs

…to just adding a few lines in a config file.

If you’ve read my 2021 post and still use that approach, I’d recommend trying this new setup. You’ll get the same results, with much less effort.