49 Commits

Author SHA1 Message Date
AteebXYZ 6a91c7b990 fix: apply mode substitution after dynamic template fill (#84) 2026-02-10 21:37:58 +11:00
2 * r + 2 * t bdc5f91009 fix: xxx_paletteKeyColor rename in myc 3.0.0
Fixes caelestia-dots/shell#1112
2026-02-10 21:33:19 +11:00
Chea Vuthearith 164bda5462 record: add arg to copy screen recording to clipboard (#83) 2026-02-10 20:53:27 +11:00
github-actions fe071cb285 [CI] chore: update flake 2026-02-09 02:54:39 +00:00
github-actions 2d5bec14a5 [CI] chore: update flake 2026-02-08 03:19:32 +00:00
github-actions 2395347d36 [CI] chore: update flake 2026-02-06 02:39:29 +00:00
github-actions cf6092b77b [CI] chore: update flake 2026-02-05 02:40:10 +00:00
github-actions 6dad795297 [CI] chore: update flake 2026-02-04 02:38:06 +00:00
github-actions 016a566bb7 [CI] chore: update flake 2026-02-03 02:42:43 +00:00
github-actions 2240ad4adf [CI] chore: update flake 2026-02-02 02:53:33 +00:00
github-actions fccf32250e [CI] chore: update flake 2026-02-01 03:04:44 +00:00
github-actions 90fc2a981e [CI] chore: update flake 2026-01-30 02:37:13 +00:00
github-actions 6cdb131e3a [CI] chore: update flake 2026-01-26 02:35:07 +00:00
github-actions ecf0c6156a [CI] chore: update flake 2026-01-25 02:35:40 +00:00
Kalagmitan 52a3a3c50e theme: inject mode into user templates (#77)
* theme: apply_user_templates accepts mode.

* Some themes like those in NvChad require a mode to be supplied to
work. Added a minimal change that makes apply_user_templates accept a
mode parameter and replaces any {{ mode }} placeholder in a file with
the actual mode.

* theme: mode replace integrated with gen_replace_dynamic

+ Moved the {{ mode }} replacement logic to the gen_replace_dynamic
function.

* refactor: adjusted comment
2026-01-24 14:45:32 +11:00
github-actions 6b3f927d2c [CI] chore: update flake 2026-01-23 02:11:56 +00:00
github-actions 74ddac98eb [CI] chore: update flake 2026-01-22 02:21:06 +00:00
github-actions d09e36299a [CI] chore: update flake 2026-01-21 02:21:30 +00:00
github-actions 50c8f9c84d [CI] chore: update flake 2026-01-20 02:12:10 +00:00
github-actions 33fb69dc8c [CI] chore: update flake 2026-01-18 02:32:10 +00:00
mj0x0 7de6c60631 theme: ensure atomic writes for configuration files (#76)
* fix: ensure atomic writes for configuration files

* requested changes
2026-01-18 00:11:13 +11:00
github-actions 0cd11ef665 [CI] chore: update flake 2026-01-17 02:06:07 +00:00
github-actions 64686104a1 [CI] chore: update flake 2026-01-16 02:12:09 +00:00
2 * r + 2 * t 08dc3e0e87 theme: update discord theme template
Fixes caelestia-dots/caelestia#206
2026-01-14 19:22:19 +11:00
github-actions 7900d05459 [CI] chore: update flake 2026-01-13 02:08:26 +00:00
github-actions 315f1daf9d [CI] chore: update flake 2026-01-12 02:23:10 +00:00
github-actions ad555d5129 [CI] chore: update flake 2026-01-11 02:32:22 +00:00
github-actions 70a8624eac [CI] chore: update flake 2026-01-10 02:06:38 +00:00
github-actions 86b0c94bd1 [CI] chore: update flake 2026-01-08 02:10:20 +00:00
github-actions 55d75a1175 [CI] chore: update flake 2026-01-07 02:09:52 +00:00
github-actions 55590bd9e4 [CI] chore: update flake 2026-01-04 02:27:36 +00:00
github-actions 337c711371 [CI] chore: update flake 2026-01-02 02:16:30 +00:00
github-actions f3ea42d43a [CI] chore: update flake 2025-12-29 02:28:26 +00:00
github-actions e33e6ccf72 [CI] chore: update flake 2025-12-28 02:30:51 +00:00
github-actions b049cb1749 [CI] chore: update flake 2025-12-26 02:06:29 +00:00
github-actions 78e0b9d795 [CI] chore: update flake 2025-12-23 02:07:06 +00:00
github-actions e9f3f00bb9 [CI] chore: update flake 2025-12-21 02:13:41 +00:00
github-actions 8c83ae1e6a [CI] chore: update flake 2025-12-20 01:59:18 +00:00
github-actions 10639b5de0 [CI] chore: update flake 2025-12-16 02:07:04 +00:00
github-actions e1efe59e55 [CI] chore: update flake 2025-12-14 02:13:56 +00:00
github-actions b1e4e92e98 [CI] chore: update flake 2025-12-10 02:04:42 +00:00
github-actions 3e59c5acc2 [CI] chore: update flake 2025-12-07 02:18:43 +00:00
github-actions 1eead86151 [CI] chore: update flake 2025-12-04 02:02:53 +00:00
github-actions 02442e0f85 [CI] chore: update flake 2025-12-03 02:02:50 +00:00
github-actions 5fa4d1b278 [CI] chore: update flake 2025-12-02 02:03:08 +00:00
github-actions c0813790c2 [CI] chore: update flake 2025-11-30 02:17:28 +00:00
github-actions ed12d4cb82 [CI] chore: update flake 2025-11-29 01:56:50 +00:00
github-actions 1e1edfcd38 [CI] chore: update flake 2025-11-27 01:58:53 +00:00
github-actions 0fdab31bc7 [CI] chore: update flake 2025-11-26 02:07:00 +00:00
7 changed files with 56 additions and 31 deletions
+1
View File
@@ -105,6 +105,7 @@ complete -c caelestia -n "$seen screenshot" -s 'f' -l 'freeze' -d 'Freeze while
# Record
complete -c caelestia -n "$seen record" -s 'r' -l 'region' -d 'Capture region'
complete -c caelestia -n "$seen record" -s 's' -l 'sound' -d 'Capture sound'
complete -c caelestia -n "$seen record" -s 'c' -l 'clipboard' -d 'Copy recording path to clipboard'
# Clipboard
complete -c caelestia -n "$seen clipboard" -s 'd' -l 'delete' -d 'Delete from cliboard history'
Generated
+10 -10
View File
@@ -9,11 +9,11 @@
"quickshell": "quickshell"
},
"locked": {
"lastModified": 1763974329,
"narHash": "sha256-8bljTh08KrIzTwzJEM8rGCg56hGtIH6/oT0LctCPTOQ=",
"lastModified": 1770527631,
"narHash": "sha256-QFZAXF80GUrgdmgjMLPzhGOqjiRk4ukCEkpr0dehdnk=",
"owner": "caelestia-dots",
"repo": "shell",
"rev": "11282f6abe32f9671dc0a7ce49d64bc4f2d79e6b",
"rev": "5b2e1a6231af24472fb8ff3bfa7183a4f63c6ba7",
"type": "github"
},
"original": {
@@ -24,11 +24,11 @@
},
"nixpkgs": {
"locked": {
"lastModified": 1763835633,
"narHash": "sha256-HzxeGVID5MChuCPESuC0dlQL1/scDKu+MmzoVBJxulM=",
"lastModified": 1770562336,
"narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=",
"owner": "nixos",
"repo": "nixpkgs",
"rev": "050e09e091117c3d7328c7b2b7b577492c43c134",
"rev": "d6c71932130818840fc8fe9509cf50be8c64634f",
"type": "github"
},
"original": {
@@ -46,11 +46,11 @@
]
},
"locked": {
"lastModified": 1763629934,
"narHash": "sha256-jWz10RbNAyylJbH4cUTLS/CsDjkd8gxfT8OsIgQIgEg=",
"lastModified": 1769593411,
"narHash": "sha256-WW00FaBiUmQyxvSbefvgxIjwf/WmRrEGBbwMHvW/7uQ=",
"ref": "refs/heads/master",
"rev": "ed036d514b0fdbce03158a0b331305be166f4555",
"revCount": 708,
"rev": "1e4d804e7f3fa7465811030e8da2bf10d544426a",
"revCount": 732,
"type": "git",
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
},
+12 -10
View File
@@ -15,8 +15,10 @@
@import url("https://refact0r.github.io/midnight-discord/build/midnight.css");
body {
/* font, change to '' for default discord font */
--font: "figtree";
/* font options */
--font: "figtree"; /* change to '' for default discord font */
--code-font: "JetBrainsMono NF"; /* change to '' for default discord font */
font-weight: 400; /* normal text font weight. DOES NOT AFFECT BOLD TEXT */
/* sizes */
--gap: 12px; /* spacing between panels */
@@ -27,13 +29,14 @@ body {
--animations: on; /* turn off to disable all midnight animations/transitions */
--list-item-transition: 0.2s ease; /* transition for list items */
--dms-icon-svg-transition: 0.4s ease; /* transition for the dms icon */
--border-hover-transition: 0.2s ease; /* transition for borders when hovered */
/* top bar options */
--top-bar-height: var(
--gap
); /* height of the titlebar/top bar (discord default is 36px, 24px recommended if moving/hiding top bar buttons) */
--top-bar-button-position: hide; /* off: default position, hide: hide inbox/support buttons completely, serverlist: move inbox button to server list, titlebar: move inbox button to titlebar (will hide title) */
--top-bar-title-position: hide; /* off: default centered position, hide: hide title completely, left: left align title (like old discord) */
--top-bar-button-position: titlebar; /* off: default position, hide: hide inbox/support buttons completely, serverlist: move inbox button to server list, titlebar: move inbox button to titlebar (will hide title) */
--top-bar-title-position: off; /* off: default centered position, hide: hide title completely, left: left align title (like old discord) */
--subtle-top-bar-title: off; /* off: default, on: hide the icon and use subtle text color (like old discord) */
/* window controls */
@@ -42,9 +45,9 @@ body {
/* dms button icon options */
--custom-dms-icon: custom; /* off: use default discord icon, hide: remove icon entirely, custom: use custom icon */
--dms-icon-svg-url: url("https://upload.wikimedia.org/wikipedia/commons/c/c4/Font_Awesome_5_solid_moon.svg"); /* icon svg url. MUST BE A SVG. */
--dms-icon-svg-url: url("https://refact0r.github.io/midnight-discord/assets/Font_Awesome_5_solid_moon.svg"); /* icon svg url. MUST BE A SVG. */
--dms-icon-svg-size: 90%; /* size of the svg (css mask-size) */
--dms-icon-color-before: var(--icon-secondary); /* normal icon color */
--dms-icon-color-before: var(--icon-subtle); /* normal icon color */
--dms-icon-color-after: var(--white); /* icon color when button is hovered/selected */
/* dms button background options */
@@ -71,12 +74,11 @@ body {
--bg-floating: #{c.$surface}; /* you can set this to a more opaque color if floating panels look too transparent */
/* chatbar options */
--custom-chatbar: aligned; /* off: default chatbar, aligned: chatbar aligned with the user panel, separated: chatbar separated from chat */
--chatbar-height: 47px; /* height of the chatbar (52px by default, 47px recommended for aligned, 56px recommended for separated) */
--chatbar-padding: 8px; /* padding of the chatbar. only applies in aligned mode. */
--custom-chatbar: off; /* off: default chatbar, separated: chatbar separated from chat */
--chatbar-height: 47px; /* height of the chatbar (56px by default, 47px to align with user panel, 56px recommended for separated) */
/* other options */
--small-user-panel: off; /* turn on to make the user panel smaller like in old discord */
--small-user-panel: off; /* off: default user panel, on: smaller user panel like in old discord */
}
/* color options */
+1
View File
@@ -71,6 +71,7 @@ def parse_args() -> (argparse.ArgumentParser, argparse.Namespace):
record_parser.add_argument("-r", "--region", nargs="?", const="slurp", help="record a region")
record_parser.add_argument("-s", "--sound", action="store_true", help="record audio")
record_parser.add_argument("-p", "--pause", action="store_true", help="pause/resume the recording")
record_parser.add_argument("-c", "--clipboard", action="store_true", help="copy recording path to clipboard")
# Create parser for clipboard opts
clipboard_parser = command_parser.add_parser("clipboard", help="open clipboard history")
+5
View File
@@ -1,3 +1,4 @@
from pathlib import Path
import json
import re
import shutil
@@ -108,6 +109,10 @@ class Command:
except IOError:
pass
if self.args.clipboard:
file_uri = Path(new_path).resolve().as_uri() + "\n"
subprocess.run(["wl-copy", "--type", "text/uri-list"], input=file_uri.encode())
action = notify(
"--action=watch=Watch",
"--action=open=Open",
+9 -4
View File
@@ -172,10 +172,15 @@ def gen_scheme(scheme, primary: Hct) -> dict[str, str]:
# Material colours
primary_scheme = get_scheme(scheme.variant)(primary, not light, 0)
for colour in vars(MaterialDynamicColors).keys():
colour_name = getattr(MaterialDynamicColors, colour)
if hasattr(colour_name, "get_hct"):
colours[colour] = colour_name.get_hct(primary_scheme)
dyn_colours = MaterialDynamicColors()
for colour in dyn_colours.all_colors:
colours[colour.name] = colour.get_hct(primary_scheme)
# Backwards compatibility with old colour names
if "primaryPaletteKeyColor" in colours: # materialyoucolor-python >= 3.0.0
for colour in "primary", "secondary", "tertiary", "neutral":
colours[f"{colour}_paletteKeyColor"] = colours[f"{colour}PaletteKeyColor"]
colours["neutral_variant_paletteKeyColor"] = colours["neutralVariantPaletteKeyColor"]
# Harmonize terminal colours
for i, hct in enumerate(light_gruvbox if light else dark_gruvbox):
+18 -7
View File
@@ -2,6 +2,8 @@ import json
import re
import subprocess
from pathlib import Path
import tempfile
import shutil
from caelestia.utils.colour import get_dynamic_colours
from caelestia.utils.logging import log_exception
@@ -37,7 +39,7 @@ def gen_replace(colours: dict[str, str], template: Path, hash: bool = False) ->
return template
def gen_replace_dynamic(colours: dict[str, str], template: Path) -> str:
def gen_replace_dynamic(colours: dict[str, str], template: Path, mode: str) -> str:
def fill_colour(match: re.Match) -> str:
data = match.group(1).strip().split(".")
if len(data) != 2:
@@ -48,10 +50,16 @@ def gen_replace_dynamic(colours: dict[str, str], template: Path) -> str:
return getattr(colours_dyn[col], form)
# match atomic {{ . }} pairs
field = r"\{\{((?:(?!\{\{|\}\}).)*)\}\}"
dotField = r"\{\{((?:(?!\{\{|\}\}).)*)\}\}"
# match {{ mode }}
modeField = r"\{\{\s*mode\s*\}\}"
colours_dyn = get_dynamic_colours(colours)
template_content = template.read_text()
template_filled = re.sub(field, fill_colour, template_content)
template_filled = re.sub(dotField, fill_colour, template_content)
template_filled = re.sub(modeField, mode, template_filled)
return template_filled
@@ -101,8 +109,11 @@ def gen_sequences(colours: dict[str, str]) -> str:
def write_file(path: Path, content: str) -> None:
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(content)
with tempfile.NamedTemporaryFile("w") as f:
f.write(content)
f.flush()
shutil.move(f.name, path)
@log_exception
def apply_terms(sequences: str) -> None:
@@ -224,13 +235,13 @@ def apply_cava(colours: dict[str, str]) -> None:
@log_exception
def apply_user_templates(colours: dict[str, str]) -> None:
def apply_user_templates(colours: dict[str, str], mode: str) -> None:
if not user_templates_dir.is_dir():
return
for file in user_templates_dir.iterdir():
if file.is_file():
content = gen_replace_dynamic(colours, file)
content = gen_replace_dynamic(colours, file, mode)
write_file(theme_dir / file.name, content)
@@ -267,4 +278,4 @@ def apply_colours(colours: dict[str, str], mode: str) -> None:
apply_warp(colours, mode)
if check("enableCava"):
apply_cava(colours)
apply_user_templates(colours)
apply_user_templates(colours, mode)