Skip to content

Instantly share code, notes, and snippets.

View ngquerol's full-sized avatar
📖

Nicolas G. Querol ngquerol

📖
View GitHub Profile
@ngquerol
ngquerol / sync_emacs_nsappeareance_patches.sh
Last active August 22, 2024 19:09
Script to automate maintainance of the ns_system_appearance emacs patch set
#!/bin/sh
set -eux
origin_remote="origin"
upstream_remote="upstream"
patch_branch_prefix="ns-system-appearance-change"
emacs_branches="master emacs-30 emacs-29 emacs-28 emacs-27"
gist_ids="9618d4aba60a6e691c3a4bdbefbdb9e9 ba7d50d281e71ba9a585be7c89590b1a 6dbb6f21bbb5756b59c1500f1f97094c 33e099eceae527b368bdf196c95d1ba3 8f430884386d1fcc4e216e484cc44c59"
@ngquerol
ngquerol / cleanup_history.sh
Last active June 11, 2024 21:18
Cleanup fish history imported from zsh
#!/bin/sh
perl \
-0777 \
-pe \
-i.old \
"${HOME}/.local/share/fish/fish_history" \
's/- cmd: : (\d{10}):\d+;(.+)\n when: (\d{10})/- cmd: $2\n when: $1/g'
@ngquerol
ngquerol / ns_system_appearance_change_emacs-30.patch
Last active March 2, 2025 21:01
Patch to make emacs (emacs-30 branch) aware of the macOS 10.14+ system appearance changes.
From 00c4de86544f597df5cb10dcf8ce390617ceefa3 Mon Sep 17 00:00:00 2001
From: "Nicolas G. Querol" <[email protected]>
Date: Wed, 11 Nov 2020 12:35:47 +0100
Subject: [PATCH] Add `ns-system-appearance-change-functions' hook
This implements a new hook, effective only on macOS >= 10.14 (Mojave),
that is called when the system changes its appearance (e.g. from light
to dark). Users can then implement functions that take this change
into account, for instance to load a particular theme.