Liquid Glass Effect for GNU/Emacs

birdculture1 pts0 comments

GitHub - larrasket/emacs-liquid-glass: Liquid Glass effect for GNU/Emacs · GitHub

/" data-turbo-transient="true" />

Skip to content

Type / to search

Sign in<br>Sign upAppearance settings

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

larrasket

emacs-liquid-glass

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star<br>38

master

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>5 Commits<br>5 Commits

cmd

cmd

config

config

lisp

lisp

patches

patches

LICENSE

LICENSE

README.org

README.org

install.sh

install.sh

screenshot.png

screenshot.png

View all files

Repository files navigation

Emacs Liquid Glass

This repo is a small recipe for building Emacs with a<br>Ghostty-like macOS glass frame. It layers a local Cocoa patch on top of<br>Homebrew emacs-plus@31 and the community frame-transparency patch, then<br>configures Emacs with the same shape as Ghostty:

background-opacity = 0.01<br>background-blur = macos-glass-regular

This is not a dark overlay or a hard-coded theme. The patch adds native NSGlassEffectView<br>support only.

For the longer write-up, see the blog post.

What This Builds

The recipe uses the emacs-plus@31 formula, not the emacs-plus-app cask.<br>The cask ships a prebuilt binary and ignores ~/.config/emacs-plus/build.yml,<br>so it cannot apply local patches.

The build applies two patches, in order:

frame-transparency from d12frosted/emacs-plus

patches/ns-glass-effect.patch from this repo

The local patch adds these frame parameters:

ParameterPurpose<br>ns-glass-materialNative material, currently regular, clear, or nil.<br>ns-glass-tint-opacityTheme-owned tint opacity over the glass view.<br>ns-glass-saturationSaturation multiplier for the glass tint.<br>ns-glass-inactive-opacityOptional opacity when the frame is inactive.<br>ns-glass-corner-radiusOptional corner radius for the glass view.<br>ns-alpha-glyphs-alphaSeparate alpha for real glyph backgrounds.

The last parameter is what makes alpha-background values near 0 usable.<br>Without it, hl-line, regions, and completion selections disappear with the<br>frame background.

Quick Start

Install from your tap:

brew tap larrasket/emacs-liquid-glass https://github.com/larrasket/emacs-liquid-glass.git<br>brew emacs-liquid-glass install

Skip copying the rebuilt app bundle into /Applications:

brew emacs-liquid-glass install --no-copy-app

Direct clone usage also works:

git clone https://github.com/larrasket/emacs-liquid-glass<br>cd emacs-liquid-glass<br>./install.sh

Use ./install.sh --no-copy-app if you do not want it to update<br>/Applications/Emacs.app and /Applications/Emacs Client.app.

Manual Build

Copy the patch and build config:

mkdir -p ~/.config/emacs-plus<br>cp patches/ns-glass-effect.patch ~/.config/emacs-plus/ns-glass-effect.patch<br>cp config/build.yml ~/.config/emacs-plus/build.yml

Build Emacs from source:

brew tap d12frosted/emacs-plus<br>HOMEBREW_NO_AUTO_UPDATE=1 brew reinstall emacs-plus@31 --build-from-source<br>brew postinstall d12frosted/emacs-plus/emacs-plus@31

Copy the app bundles used by Spotlight and /opt/homebrew/bin/emacs:

rsync -a --delete /opt/homebrew/opt/emacs-plus@31/Emacs.app/ /Applications/Emacs.app/<br>rsync -a --delete "/opt/homebrew/opt/emacs-plus@31/Emacs Client.app/" "/Applications/Emacs Client.app/"

Emacs Config

Load lisp/lr-macos-glass.el from your Emacs config. If this repo is installed<br>as a Homebrew tap, you can find its path with:

brew emacs-liquid-glass path

Example:

(add-to-list 'load-path "/path/to/emacs-liquid-glass/lisp")<br>(require 'lr-macos-glass)

The regular preset currently uses:

(setq salih/glass-style 'macos-glass-regular<br>salih/alpha-background 0.01<br>salih/ns-background-blur 0<br>salih/ns-alpha-glyphs-min-alpha 0.24<br>salih/ns-glass-material 'regular<br>salih/ns-glass-tint-opacity 0.05<br>salih/ns-glass-saturation 1.9<br>salih/ns-glass-inactive-opacity 0.05<br>salih/ns-glass-corner-radius 2<br>salih/ns-transparent-titlebar t)

Interactive commands:

CommandEffect<br>M-x salih/set-glass-styleSwitch between macos-glass-regular and macos-glass-clear.<br>M-x salih/set-glassSet frame alpha and CGS blur.<br>M-x salih/set-glass-glyph-alphaSet highlight/selection glyph background alpha.<br>M-x salih/toggle-glassToggle between the glass frame and an opaque frame.

If you set salih/alpha-background to 0, keep<br>salih/ns-alpha-glyphs-min-alpha above 0 if you still want hl-line,<br>regions, and completion selections to be visible.

Verification

If you find issue, please first check that the installed binary contains the new frame parameters:

strings /Applications/Emacs.app/Contents/MacOS/Emacs \<br>| rg 'ns-alpha-glyphs-alpha|ns-glass-material|ns-glass-saturation'

If emacs reports an invalid ns-glass-* value, you are probably running an<br>older build...

glass emacs salih plus liquid alpha

Related Articles