Skip to content

Instantly share code, notes, and snippets.

View wroyca's full-sized avatar
💭
I may be slow to respond.

William Roy wroyca

💭
I may be slow to respond.
View GitHub Profile
@wroyca
wroyca / appearance.el
Last active April 30, 2025 16:02
Automatic synchronization between Emacs themes and system appearance settings (light/dark mode) via D-Bus.
;;; appearance.el --- System theme integration via D-Bus -*- lexical-binding: t -*-
;;; Commentary:
;;
;; This module provides automatic synchronization between Emacs themes
;; and the system appearance settings (light/dark mode) via D-Bus.
;;
;; NOTE: This *only* works with desktop environments that support the
;; org.freedesktop.appearance portal interface.
@wroyca
wroyca / appearance-control-sequences.el
Last active April 30, 2025 16:09
Synchronizes Emacs' background color with the terminal background by using VT100 control sequences
;;; appearance-control-sequences.el --- Terminal control sequence integration -*- lexical-binding: t -*-
;;; Commentary:
;;
;; This module synchronizes Emacs' background color with the terminal background
;; by using VT100 control sequences. It supports both setting the background
;; color (using the "\e]11;" sequence) and resetting it on exit (using "\e]111;"
;; if available, or restoring the original color otherwise).
;;
@wroyca
wroyca / which-key-prefix-descriptions.el
Created May 3, 2025 23:39 — forked from mmarshall540/which-key-prefix-descriptions.el
Missing Which-key Prefix descriptions
;; By default, Which-key doesn't give much help for prefix-keys. It
;; either shows the generic description, "+prefix", or the name of a
;; prefix-command, which usually isn't as descriptive as we'd like.
;;
;; Here are some descriptions for the default bindings in `global-map'
;; and `org-mode-map'.
(which-key-add-key-based-replacements
"<f1> 4" "help-other-win"
"<f1>" "help"
@wroyca
wroyca / dotemacs-mouse.el
Created May 7, 2025 17:49
Emacs overlay-based selection model
;;; dotemacs-mouse.el --- Persistent selections -*- lexical-binding: t -*-
;;; Commentary:
;;
;; Architectural Overview
;;
;; Overlay-Based Selection Model
;;
;; Represent selections using overlays instead of the point/mark pair:
;;
@wroyca
wroyca / build2-ci-bindist-snapshot.yml
Last active May 13, 2025 17:10
Create snapshot release on GitHub when using build2 GitHub CI integration with bbot.bindist.upload.
name: snapshot
run-name: snapshot pre-release from build2 CI bindist
on:
# Trigger on completion of any check suite.
#
# This triggering mechanism enables the workflow to automatically detect when
# a potential new build might be available on the CI server. That is, we
# avoid having to periodically poll the CI server.
check_suite:
@wroyca
wroyca / inactive_regions.lua
Created June 7, 2025 17:03
Clangd inactive regions with Neovim
---@class InactiveRegionsModule
---@field config InactiveRegionsConfig
---@field ns integer Namespace ID for highlights
---@field _state InactiveRegionsState Internal state
local InactiveRegions = {}
---@class InactiveRegionsConfig
---@field opacity number Opacity level for inactive regions (0.0-1.0)
---@field namespace string? Custom namespace name
---@field debounce_ms integer Debounce delay for updates in milliseconds