Skip to content

In Emacs, set the MacOS transparent titlebar to match the current theme

Notifications You must be signed in to change notification settings

purcell/ns-auto-titlebar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Melpa Status Melpa Stable Status Support me

ns-auto-titlebar.el

Recent builds of Emacs (27, 26?) support transparent titlebars on MacOS via the ns-transparent-titlebar and ns-appearance frame properties. The latter indicates whether the titlebar background should be dark or light, and it is not set automatically by Emacs. However, the text colour is always taken from the current theme, which can lead to unreadable titlebar text if ns-appearance is not set correctly.

This Emacs package provides a global minor mode, ns-auto-titlebar-mode which - when enabled - keeps the "ns-appearance" frame parameter correctly set in GUI frames so that it matches the currently-enabled theme, whether it is light or dark.

For this package to work correctly, it is generally necessary that the theme you use sets the frame-background-mode variable appropriately. This can be set manually if necessary, but see the docs for that variable.

Installation

If you choose not to use one of the convenient packages in MELPA, you'll need to add the directory containing ns-auto-titlebar.el to your load-path, and then (require 'ns-auto-titlebar).

Usage

Enable ns-auto-titlebar-mode with M-x customize, or like this:

(when (eq system-type 'darwin) (ns-auto-titlebar-mode))

Note that it is safe to omit the "when" condition if you prefer.


💝 Support this project and my other Open Source work

💼 LinkedIn profile

✍ sanityinc.com

🐦 @sanityinc

About

In Emacs, set the MacOS transparent titlebar to match the current theme

Resources

Stars

Watchers

Forks

Sponsor this project

Packages