mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-05 23:09:27 -05:00
Compare commits
49 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a91c7b990 | |||
| bdc5f91009 | |||
| 164bda5462 | |||
| fe071cb285 | |||
| 2d5bec14a5 | |||
| 2395347d36 | |||
| cf6092b77b | |||
| 6dad795297 | |||
| 016a566bb7 | |||
| 2240ad4adf | |||
| fccf32250e | |||
| 90fc2a981e | |||
| 6cdb131e3a | |||
| ecf0c6156a | |||
| 52a3a3c50e | |||
| 6b3f927d2c | |||
| 74ddac98eb | |||
| d09e36299a | |||
| 50c8f9c84d | |||
| 33fb69dc8c | |||
| 7de6c60631 | |||
| 0cd11ef665 | |||
| 64686104a1 | |||
| 08dc3e0e87 | |||
| 7900d05459 | |||
| 315f1daf9d | |||
| ad555d5129 | |||
| 70a8624eac | |||
| 86b0c94bd1 | |||
| 55d75a1175 | |||
| 55590bd9e4 | |||
| 337c711371 | |||
| f3ea42d43a | |||
| e33e6ccf72 | |||
| b049cb1749 | |||
| 78e0b9d795 | |||
| e9f3f00bb9 | |||
| 8c83ae1e6a | |||
| 10639b5de0 | |||
| e1efe59e55 | |||
| b1e4e92e98 | |||
| 3e59c5acc2 | |||
| 1eead86151 | |||
| 02442e0f85 | |||
| 5fa4d1b278 | |||
| c0813790c2 | |||
| ed12d4cb82 | |||
| 1e1edfcd38 | |||
| 0fdab31bc7 |
@@ -105,6 +105,7 @@ complete -c caelestia -n "$seen screenshot" -s 'f' -l 'freeze' -d 'Freeze while
|
|||||||
# Record
|
# Record
|
||||||
complete -c caelestia -n "$seen record" -s 'r' -l 'region' -d 'Capture region'
|
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 's' -l 'sound' -d 'Capture sound'
|
||||||
|
complete -c caelestia -n "$seen record" -s 'c' -l 'clipboard' -d 'Copy recording path to clipboard'
|
||||||
|
|
||||||
# Clipboard
|
# Clipboard
|
||||||
complete -c caelestia -n "$seen clipboard" -s 'd' -l 'delete' -d 'Delete from cliboard history'
|
complete -c caelestia -n "$seen clipboard" -s 'd' -l 'delete' -d 'Delete from cliboard history'
|
||||||
|
|||||||
Generated
+10
-10
@@ -9,11 +9,11 @@
|
|||||||
"quickshell": "quickshell"
|
"quickshell": "quickshell"
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1763974329,
|
"lastModified": 1770527631,
|
||||||
"narHash": "sha256-8bljTh08KrIzTwzJEM8rGCg56hGtIH6/oT0LctCPTOQ=",
|
"narHash": "sha256-QFZAXF80GUrgdmgjMLPzhGOqjiRk4ukCEkpr0dehdnk=",
|
||||||
"owner": "caelestia-dots",
|
"owner": "caelestia-dots",
|
||||||
"repo": "shell",
|
"repo": "shell",
|
||||||
"rev": "11282f6abe32f9671dc0a7ce49d64bc4f2d79e6b",
|
"rev": "5b2e1a6231af24472fb8ff3bfa7183a4f63c6ba7",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -24,11 +24,11 @@
|
|||||||
},
|
},
|
||||||
"nixpkgs": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1763835633,
|
"lastModified": 1770562336,
|
||||||
"narHash": "sha256-HzxeGVID5MChuCPESuC0dlQL1/scDKu+MmzoVBJxulM=",
|
"narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=",
|
||||||
"owner": "nixos",
|
"owner": "nixos",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "050e09e091117c3d7328c7b2b7b577492c43c134",
|
"rev": "d6c71932130818840fc8fe9509cf50be8c64634f",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -46,11 +46,11 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1763629934,
|
"lastModified": 1769593411,
|
||||||
"narHash": "sha256-jWz10RbNAyylJbH4cUTLS/CsDjkd8gxfT8OsIgQIgEg=",
|
"narHash": "sha256-WW00FaBiUmQyxvSbefvgxIjwf/WmRrEGBbwMHvW/7uQ=",
|
||||||
"ref": "refs/heads/master",
|
"ref": "refs/heads/master",
|
||||||
"rev": "ed036d514b0fdbce03158a0b331305be166f4555",
|
"rev": "1e4d804e7f3fa7465811030e8da2bf10d544426a",
|
||||||
"revCount": 708,
|
"revCount": 732,
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
|
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -15,8 +15,10 @@
|
|||||||
@import url("https://refact0r.github.io/midnight-discord/build/midnight.css");
|
@import url("https://refact0r.github.io/midnight-discord/build/midnight.css");
|
||||||
|
|
||||||
body {
|
body {
|
||||||
/* font, change to '' for default discord font */
|
/* font options */
|
||||||
--font: "figtree";
|
--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 */
|
/* sizes */
|
||||||
--gap: 12px; /* spacing between panels */
|
--gap: 12px; /* spacing between panels */
|
||||||
@@ -27,13 +29,14 @@ body {
|
|||||||
--animations: on; /* turn off to disable all midnight animations/transitions */
|
--animations: on; /* turn off to disable all midnight animations/transitions */
|
||||||
--list-item-transition: 0.2s ease; /* transition for list items */
|
--list-item-transition: 0.2s ease; /* transition for list items */
|
||||||
--dms-icon-svg-transition: 0.4s ease; /* transition for the dms icon */
|
--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 options */
|
||||||
--top-bar-height: var(
|
--top-bar-height: var(
|
||||||
--gap
|
--gap
|
||||||
); /* height of the titlebar/top bar (discord default is 36px, 24px recommended if moving/hiding top bar buttons) */
|
); /* 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-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: hide; /* off: default centered position, hide: hide title completely, left: left align title (like old discord) */
|
--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) */
|
--subtle-top-bar-title: off; /* off: default, on: hide the icon and use subtle text color (like old discord) */
|
||||||
|
|
||||||
/* window controls */
|
/* window controls */
|
||||||
@@ -42,9 +45,9 @@ body {
|
|||||||
|
|
||||||
/* dms button icon options */
|
/* dms button icon options */
|
||||||
--custom-dms-icon: custom; /* off: use default discord icon, hide: remove icon entirely, custom: use custom icon */
|
--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-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-icon-color-after: var(--white); /* icon color when button is hovered/selected */
|
||||||
|
|
||||||
/* dms button background options */
|
/* 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 */
|
--bg-floating: #{c.$surface}; /* you can set this to a more opaque color if floating panels look too transparent */
|
||||||
|
|
||||||
/* chatbar options */
|
/* chatbar options */
|
||||||
--custom-chatbar: aligned; /* off: default chatbar, aligned: chatbar aligned with the user panel, separated: chatbar separated from chat */
|
--custom-chatbar: off; /* off: default chatbar, separated: chatbar separated from chat */
|
||||||
--chatbar-height: 47px; /* height of the chatbar (52px by default, 47px recommended for aligned, 56px recommended for separated) */
|
--chatbar-height: 47px; /* height of the chatbar (56px by default, 47px to align with user panel, 56px recommended for separated) */
|
||||||
--chatbar-padding: 8px; /* padding of the chatbar. only applies in aligned mode. */
|
|
||||||
|
|
||||||
/* other options */
|
/* 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 */
|
/* color options */
|
||||||
|
|||||||
@@ -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("-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("-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("-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
|
# Create parser for clipboard opts
|
||||||
clipboard_parser = command_parser.add_parser("clipboard", help="open clipboard history")
|
clipboard_parser = command_parser.add_parser("clipboard", help="open clipboard history")
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
from pathlib import Path
|
||||||
import json
|
import json
|
||||||
import re
|
import re
|
||||||
import shutil
|
import shutil
|
||||||
@@ -108,6 +109,10 @@ class Command:
|
|||||||
except IOError:
|
except IOError:
|
||||||
pass
|
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 = notify(
|
||||||
"--action=watch=Watch",
|
"--action=watch=Watch",
|
||||||
"--action=open=Open",
|
"--action=open=Open",
|
||||||
|
|||||||
@@ -172,10 +172,15 @@ def gen_scheme(scheme, primary: Hct) -> dict[str, str]:
|
|||||||
|
|
||||||
# Material colours
|
# Material colours
|
||||||
primary_scheme = get_scheme(scheme.variant)(primary, not light, 0)
|
primary_scheme = get_scheme(scheme.variant)(primary, not light, 0)
|
||||||
for colour in vars(MaterialDynamicColors).keys():
|
dyn_colours = MaterialDynamicColors()
|
||||||
colour_name = getattr(MaterialDynamicColors, colour)
|
for colour in dyn_colours.all_colors:
|
||||||
if hasattr(colour_name, "get_hct"):
|
colours[colour.name] = colour.get_hct(primary_scheme)
|
||||||
colours[colour] = colour_name.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
|
# Harmonize terminal colours
|
||||||
for i, hct in enumerate(light_gruvbox if light else dark_gruvbox):
|
for i, hct in enumerate(light_gruvbox if light else dark_gruvbox):
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ import json
|
|||||||
import re
|
import re
|
||||||
import subprocess
|
import subprocess
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import tempfile
|
||||||
|
import shutil
|
||||||
|
|
||||||
from caelestia.utils.colour import get_dynamic_colours
|
from caelestia.utils.colour import get_dynamic_colours
|
||||||
from caelestia.utils.logging import log_exception
|
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
|
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:
|
def fill_colour(match: re.Match) -> str:
|
||||||
data = match.group(1).strip().split(".")
|
data = match.group(1).strip().split(".")
|
||||||
if len(data) != 2:
|
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)
|
return getattr(colours_dyn[col], form)
|
||||||
|
|
||||||
# match atomic {{ . }} pairs
|
# match atomic {{ . }} pairs
|
||||||
field = r"\{\{((?:(?!\{\{|\}\}).)*)\}\}"
|
dotField = r"\{\{((?:(?!\{\{|\}\}).)*)\}\}"
|
||||||
|
|
||||||
|
# match {{ mode }}
|
||||||
|
modeField = r"\{\{\s*mode\s*\}\}"
|
||||||
|
|
||||||
colours_dyn = get_dynamic_colours(colours)
|
colours_dyn = get_dynamic_colours(colours)
|
||||||
template_content = template.read_text()
|
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
|
return template_filled
|
||||||
|
|
||||||
@@ -101,8 +109,11 @@ def gen_sequences(colours: dict[str, str]) -> str:
|
|||||||
|
|
||||||
def write_file(path: Path, content: str) -> None:
|
def write_file(path: Path, content: str) -> None:
|
||||||
path.parent.mkdir(parents=True, exist_ok=True)
|
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
|
@log_exception
|
||||||
def apply_terms(sequences: str) -> None:
|
def apply_terms(sequences: str) -> None:
|
||||||
@@ -224,13 +235,13 @@ def apply_cava(colours: dict[str, str]) -> None:
|
|||||||
|
|
||||||
|
|
||||||
@log_exception
|
@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():
|
if not user_templates_dir.is_dir():
|
||||||
return
|
return
|
||||||
|
|
||||||
for file in user_templates_dir.iterdir():
|
for file in user_templates_dir.iterdir():
|
||||||
if file.is_file():
|
if file.is_file():
|
||||||
content = gen_replace_dynamic(colours, file)
|
content = gen_replace_dynamic(colours, file, mode)
|
||||||
write_file(theme_dir / file.name, content)
|
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)
|
apply_warp(colours, mode)
|
||||||
if check("enableCava"):
|
if check("enableCava"):
|
||||||
apply_cava(colours)
|
apply_cava(colours)
|
||||||
apply_user_templates(colours)
|
apply_user_templates(colours, mode)
|
||||||
|
|||||||
Reference in New Issue
Block a user