mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-06 07:19:29 -05:00
Compare commits
106 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 | |||
| 909c25eefd | |||
| 434841e000 | |||
| 178e73a065 | |||
| 1cfd405eaa | |||
| 03d485ec07 | |||
| 0c08188584 | |||
| d89c438284 | |||
| f9acac8fb2 | |||
| 1e3d75fa8f | |||
| 5a80ac77ed | |||
| 9323fbf1b4 | |||
| c05f6ef57a | |||
| 57dfea955e | |||
| 0ae99bbe39 | |||
| f13803af6b | |||
| 1cea6fb42a | |||
| 94d5477908 | |||
| a8590220bb | |||
| 27be3dbd84 | |||
| cc458bf859 | |||
| b2ea4e3aad | |||
| 98da4c0266 | |||
| a9f8bde28e | |||
| d0f8a06e59 | |||
| dcca082ee6 | |||
| 4593b823d7 | |||
| c6f46db36c | |||
| 40fbf3bd68 | |||
| 8dc745c936 | |||
| 14ee3c66ef | |||
| 601d08bdec | |||
| e9668d58f5 | |||
| 3f7f3bab15 | |||
| 1394e32a7e | |||
| f912d33f26 | |||
| 8b1d0257df | |||
| 276f18d198 | |||
| ebbd636b79 | |||
| ee7c7c2d5d | |||
| 28a831779e | |||
| 069d3a95da | |||
| af79030bf5 | |||
| 1de7da5f2b | |||
| 4be834aa11 | |||
| 8399eee947 | |||
| 62e5dc317a | |||
| 60a6be2dfd | |||
| 7fc5bcca1a | |||
| 64fd3a4a28 | |||
| dd982bcb96 | |||
| 1bac394029 | |||
| b36794bbb5 | |||
| c3e8a6de72 | |||
| 65df31dca4 | |||
| ad6df1c9d2 | |||
| e038c5d86a | |||
| e560a6e3d2 |
@@ -130,6 +130,12 @@ All configuration options are in `~/.config/caelestia/cli.json`.
|
||||
|
||||
```json
|
||||
{
|
||||
"record": {
|
||||
"extraArgs": []
|
||||
},
|
||||
"wallpaper": {
|
||||
"postHook": "echo $WALLPAPER_PATH"
|
||||
},
|
||||
"theme": {
|
||||
"enableTerm": true,
|
||||
"enableHypr": true,
|
||||
|
||||
@@ -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'
|
||||
|
||||
+3
-2
@@ -65,10 +65,11 @@ python3.pkgs.buildPythonApplication {
|
||||
substituteInPlace src/caelestia/subcommands/screenshot.py \
|
||||
--replace-fail '"qs", "-c", "caelestia"' '"caelestia-shell"'
|
||||
|
||||
# Use config bin instead of discord + fix todoist
|
||||
# Use config bin instead of discord + fix todoist + fix app2unit
|
||||
substituteInPlace src/caelestia/subcommands/toggle.py \
|
||||
--replace-fail 'discord' ${discordBin} \
|
||||
--replace-fail 'todoist' 'todoist.desktop'
|
||||
--replace-fail 'todoist' 'todoist.desktop'\
|
||||
--replace-fail 'app2unit' ${app2unit}/bin/app2unit
|
||||
|
||||
# Use config style instead of darkly
|
||||
substituteInPlace src/caelestia/data/templates/qtct.conf \
|
||||
|
||||
Generated
+10
-10
@@ -9,11 +9,11 @@
|
||||
"quickshell": "quickshell"
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1757726711,
|
||||
"narHash": "sha256-nihMIyW+IN01jLH+XhRDJ4V/9ulD/iqi0dvA7gYlclA=",
|
||||
"lastModified": 1770527631,
|
||||
"narHash": "sha256-QFZAXF80GUrgdmgjMLPzhGOqjiRk4ukCEkpr0dehdnk=",
|
||||
"owner": "caelestia-dots",
|
||||
"repo": "shell",
|
||||
"rev": "a57dd9343a2643f73f3994dc230b824617f89ecf",
|
||||
"rev": "5b2e1a6231af24472fb8ff3bfa7183a4f63c6ba7",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -24,11 +24,11 @@
|
||||
},
|
||||
"nixpkgs": {
|
||||
"locked": {
|
||||
"lastModified": 1757487488,
|
||||
"narHash": "sha256-zwE/e7CuPJUWKdvvTCB7iunV4E/+G0lKfv4kk/5Izdg=",
|
||||
"lastModified": 1770562336,
|
||||
"narHash": "sha256-ub1gpAONMFsT/GU2hV6ZWJjur8rJ6kKxdm9IlCT0j84=",
|
||||
"owner": "nixos",
|
||||
"repo": "nixpkgs",
|
||||
"rev": "ab0f3607a6c7486ea22229b92ed2d355f1482ee0",
|
||||
"rev": "d6c71932130818840fc8fe9509cf50be8c64634f",
|
||||
"type": "github"
|
||||
},
|
||||
"original": {
|
||||
@@ -46,11 +46,11 @@
|
||||
]
|
||||
},
|
||||
"locked": {
|
||||
"lastModified": 1756981260,
|
||||
"narHash": "sha256-GhuD9QVimjynHI0OOyZsqJsnlXr2orowh9H+HYz4YMs=",
|
||||
"lastModified": 1769593411,
|
||||
"narHash": "sha256-WW00FaBiUmQyxvSbefvgxIjwf/WmRrEGBbwMHvW/7uQ=",
|
||||
"ref": "refs/heads/master",
|
||||
"rev": "6eb12551baf924f8fdecdd04113863a754259c34",
|
||||
"revCount": 672,
|
||||
"rev": "1e4d804e7f3fa7465811030e8da2bf10d544426a",
|
||||
"revCount": 732,
|
||||
"type": "git",
|
||||
"url": "https://git.outfoxxed.me/outfoxxed/quickshell"
|
||||
},
|
||||
|
||||
@@ -132,6 +132,7 @@
|
||||
😯 hushed face epic face hushed omg stunned surprised whoa woah
|
||||
😲 :o :O astonished face astonished cost face no omg shocked totally way
|
||||
😳 :$ flushed face amazed awkward crazy dazed dead disbelief embarrassed face flushed geez heat hot impressed jeez what wow
|
||||
distorted face anxiety bloated panic shocked surprised vulnerable
|
||||
🥺 pleading face begging big eyes face mercy not pleading please pretty puppy sad why
|
||||
🥹 face holding back tears admiration aww back cry embarrassed face feelings grateful gratitude holding joy please proud resist sad tears
|
||||
😦 frowning face with open mouth caught face frown frowning guard mouth open scared scary surprise what wow
|
||||
@@ -205,6 +206,7 @@
|
||||
💋 kiss mark dating emotion heart kiss kissing lips mark romance sexy
|
||||
💯 hundred points 100 a+ agree clearly definitely faithful fleek full hundred keep perfect point score true truth yup
|
||||
💢 anger symbol anger angry comic mad symbol upset
|
||||
fight cloud argument brawl debate disagreement fight ruckus wrestle
|
||||
💥 collision bomb boom collide comic explode
|
||||
💫 dizzy comic shining shooting star stars
|
||||
💦 sweat droplets comic drip droplet droplets drops splashing squirt sweat water wet work workout
|
||||
@@ -449,6 +451,7 @@
|
||||
🧟♂️ man zombie apocalypse dead halloween horror man scary undead walking zombie
|
||||
🧟♀️ woman zombie apocalypse dead halloween horror scary undead walking woman zombie
|
||||
🧌 troll fairy fantasy monster tale trolling
|
||||
hairy creature bigfoot cryptid forest giant hairy sasquatch woodwose yeti
|
||||
💆 person getting massage face getting headache massage person relax relaxing salon soothe spa tension therapy treatment
|
||||
💆♂️ man getting massage face getting headache man massage relax relaxing salon soothe spa tension therapy treatment
|
||||
💆♀️ woman getting massage face getting headache massage relax relaxing salon soothe spa tension therapy treatment woman
|
||||
@@ -458,42 +461,43 @@
|
||||
🚶 person walking amble gait hike man pace pedestrian person stride stroll walk walking
|
||||
🚶♂️ man walking amble gait hike man pace pedestrian stride stroll walk walking
|
||||
🚶♀️ woman walking amble gait hike man pace pedestrian stride stroll walk walking woman
|
||||
🚶➡️ person walking facing right amble gait hike man pace pedestrian person stride stroll walk walking
|
||||
🚶♀️➡️ woman walking facing right amble gait hike man pace pedestrian stride stroll walk walking woman
|
||||
🚶♂️➡️ man walking facing right amble gait hike man pace pedestrian stride stroll walk walking
|
||||
🚶➡️ person walking: facing right amble facing gait hike man pace pedestrian person right stride stroll walk walking
|
||||
🚶♀️➡️ woman walking: facing right amble facing gait hike man pace pedestrian right stride stroll walk walking woman
|
||||
🚶♂️➡️ man walking: facing right amble facing gait hike man pace pedestrian right stride stroll walk walking
|
||||
🧍 person standing person stand standing
|
||||
🧍♂️ man standing man stand standing
|
||||
🧍♀️ woman standing stand standing woman
|
||||
🧎 person kneeling kneel kneeling knees person
|
||||
🧎♂️ man kneeling kneel kneeling knees man
|
||||
🧎♀️ woman kneeling kneel kneeling knees woman
|
||||
🧎➡️ person kneeling facing right kneel kneeling knees person
|
||||
🧎♀️➡️ woman kneeling facing right kneel kneeling knees woman
|
||||
🧎♂️➡️ man kneeling facing right kneel kneeling knees man
|
||||
🧎➡️ person kneeling: facing right facing kneel kneeling knees person right
|
||||
🧎♀️➡️ woman kneeling: facing right facing kneel kneeling knees right woman
|
||||
🧎♂️➡️ man kneeling: facing right facing kneel kneeling knees man right
|
||||
🧑🦯 person with white cane accessibility blind cane person probing white
|
||||
🧑🦯➡️ person with white cane facing right accessibility blind cane person probing white
|
||||
🧑🦯➡️ person with white cane: facing right accessibility blind cane facing person probing right white
|
||||
👨🦯 man with white cane accessibility blind cane man probing white
|
||||
👨🦯➡️ man with white cane facing right accessibility blind cane man probing white
|
||||
👨🦯➡️ man with white cane: facing right accessibility blind cane facing man probing right white
|
||||
👩🦯 woman with white cane accessibility blind cane probing white woman
|
||||
👩🦯➡️ woman with white cane facing right accessibility blind cane probing white woman
|
||||
👩🦯➡️ woman with white cane: facing right accessibility blind cane facing probing right white woman
|
||||
🧑🦼 person in motorized wheelchair accessibility motorized person wheelchair
|
||||
🧑🦼➡️ person in motorized wheelchair facing right accessibility motorized person wheelchair
|
||||
🧑🦼➡️ person in motorized wheelchair: facing right accessibility facing motorized person right wheelchair
|
||||
👨🦼 man in motorized wheelchair accessibility man motorized wheelchair
|
||||
👨🦼➡️ man in motorized wheelchair facing right accessibility man motorized wheelchair
|
||||
👨🦼➡️ man in motorized wheelchair: facing right accessibility facing man motorized right wheelchair
|
||||
👩🦼 woman in motorized wheelchair accessibility motorized wheelchair woman
|
||||
👩🦼➡️ woman in motorized wheelchair facing right accessibility motorized wheelchair woman
|
||||
👩🦼➡️ woman in motorized wheelchair: facing right accessibility facing motorized right wheelchair woman
|
||||
🧑🦽 person in manual wheelchair accessibility manual person wheelchair
|
||||
🧑🦽➡️ person in manual wheelchair facing right accessibility manual person wheelchair
|
||||
🧑🦽➡️ person in manual wheelchair: facing right accessibility facing manual person right wheelchair
|
||||
👨🦽 man in manual wheelchair accessibility man manual wheelchair
|
||||
👨🦽➡️ man in manual wheelchair facing right accessibility man manual wheelchair
|
||||
👨🦽➡️ man in manual wheelchair: facing right accessibility facing man manual right wheelchair
|
||||
👩🦽 woman in manual wheelchair accessibility manual wheelchair woman
|
||||
👩🦽➡️ woman in manual wheelchair facing right accessibility manual wheelchair woman
|
||||
👩🦽➡️ woman in manual wheelchair: facing right accessibility facing manual right wheelchair woman
|
||||
🏃 person running fast hurry marathon move person quick race racing run rush speed
|
||||
🏃♂️ man running fast hurry man marathon move quick race racing run rush speed
|
||||
🏃♀️ woman running fast hurry marathon move quick race racing run rush speed woman
|
||||
🏃➡️ person running facing right fast hurry marathon move person quick race racing run rush speed
|
||||
🏃♀️➡️ woman running facing right fast hurry marathon move quick race racing run rush speed woman
|
||||
🏃♂️➡️ man running facing right fast hurry man marathon move quick race racing run rush speed
|
||||
🏃➡️ person running: facing right facing fast hurry marathon move person quick race racing right run rush speed
|
||||
🏃♀️➡️ woman running: facing right facing fast hurry marathon move quick race racing right run rush speed woman
|
||||
🏃♂️➡️ man running: facing right facing fast hurry man marathon move quick race racing right run rush speed
|
||||
🧑🩰 ballet dancer ballet dancer
|
||||
💃 woman dancing dance dancer dancing elegant festive flair flamenco groove let’s salsa tango woman
|
||||
🕺 man dancing dance dancer dancing elegant festive flair flamenco groove let’s man salsa tango
|
||||
🕴️ person in suit levitating business levitating person suit
|
||||
@@ -711,6 +715,7 @@
|
||||
🐳 spouting whale animal beach face ocean spouting whale
|
||||
🐋 whale animal beach ocean
|
||||
🐬 dolphin animal beach flipper ocean
|
||||
orca marine ocean whale
|
||||
🦭 seal animal lion ocean sea
|
||||
🐟️ fish animal dinner fishes fishing pisces zodiac
|
||||
🐠 tropical fish animal fish fishes tropical
|
||||
@@ -910,6 +915,7 @@
|
||||
🧭 compass direction magnetic navigation orienteering
|
||||
🏔️ snow-capped mountain cold mountain snow snow-capped
|
||||
⛰️ mountain mountain
|
||||
landslide avalanche danger disaster earthquake mountain mudslide rocks
|
||||
🌋 volcano eruption mountain nature
|
||||
🗻 mount fuji fuji mount mountain nature
|
||||
🏕️ camping camping
|
||||
@@ -1270,10 +1276,11 @@
|
||||
🎧️ headphone earbud sound
|
||||
📻️ radio entertainment tbt video
|
||||
🎷 saxophone instrument music sax
|
||||
🎺 trumpet instrument music
|
||||
trombone brass instrument jazz music sad slide
|
||||
🪗 accordion box concertina instrument music squeeze squeezebox
|
||||
🎸 guitar instrument music strat
|
||||
🎹 musical keyboard instrument keyboard music musical piano
|
||||
🎺 trumpet instrument music
|
||||
🎻 violin instrument music
|
||||
🪕 banjo music stringed
|
||||
🥁 drum drumsticks music
|
||||
@@ -1334,8 +1341,9 @@
|
||||
📑 bookmark tabs bookmark mark marker tabs
|
||||
🔖 bookmark mark
|
||||
🏷️ label tag
|
||||
💰️ money bag bag bank bet billion cash cost dollar gold million money moneybag paid paying pot rich win
|
||||
🪙 coin dollar euro gold metal money rich silver treasure
|
||||
💰️ money bag bag bank bet billion cash cost dollar gold million money moneybag paid paying pot rich win
|
||||
treasure chest gem gold jewels loot money prize silver valuables wealth
|
||||
💴 yen banknote bank banknote bill currency money note yen
|
||||
💵 dollar banknote bank banknote bill currency dollar money note
|
||||
💶 euro banknote 100 bank banknote bill currency euro money note rich
|
||||
@@ -1608,16 +1616,16 @@
|
||||
splatter drip holi ink liquid mess paint spill stain
|
||||
#️⃣ keycap: # keycap
|
||||
*️⃣ keycap: * keycap
|
||||
0️⃣ keycap: 0 keycap
|
||||
1️⃣ keycap: 1 keycap
|
||||
2️⃣ keycap: 2 keycap
|
||||
3️⃣ keycap: 3 keycap
|
||||
4️⃣ keycap: 4 keycap
|
||||
5️⃣ keycap: 5 keycap
|
||||
6️⃣ keycap: 6 keycap
|
||||
7️⃣ keycap: 7 keycap
|
||||
8️⃣ keycap: 8 keycap
|
||||
9️⃣ keycap: 9 keycap
|
||||
0️⃣ keycap: 0 0 keycap zero
|
||||
1️⃣ keycap: 1 1 keycap one
|
||||
2️⃣ keycap: 2 2 keycap two
|
||||
3️⃣ keycap: 3 3 keycap three
|
||||
4️⃣ keycap: 4 4 four keycap
|
||||
5️⃣ keycap: 5 5 five keycap
|
||||
6️⃣ keycap: 6 6 keycap six
|
||||
7️⃣ keycap: 7 7 keycap seven
|
||||
8️⃣ keycap: 8 8 eight keycap
|
||||
9️⃣ keycap: 9 9 keycap nine
|
||||
🔟 keycap: 10 keycap
|
||||
🔠 input latin uppercase abcd input latin letters uppercase
|
||||
🔡 input latin lowercase abcd input latin letters lowercase
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from pathlib import Path
|
||||
import json
|
||||
import re
|
||||
import shutil
|
||||
@@ -7,7 +8,7 @@ from argparse import Namespace
|
||||
from datetime import datetime
|
||||
|
||||
from caelestia.utils.notify import close_notification, notify
|
||||
from caelestia.utils.paths import recording_notif_path, recording_path, recordings_dir
|
||||
from caelestia.utils.paths import recording_notif_path, recording_path, recordings_dir, user_config_path
|
||||
|
||||
RECORDER = "gpu-screen-recorder"
|
||||
|
||||
@@ -63,6 +64,15 @@ class Command:
|
||||
if self.args.sound:
|
||||
args += ["-a", "default_output"]
|
||||
|
||||
try:
|
||||
config = json.loads(user_config_path.read_text())
|
||||
if "record" in config and "extraArgs" in config["record"]:
|
||||
args += config["record"]["extraArgs"]
|
||||
except (json.JSONDecodeError, FileNotFoundError):
|
||||
pass
|
||||
except TypeError as e:
|
||||
raise ValueError(f"Config option 'record.extraArgs' should be an array: {e}")
|
||||
|
||||
recording_path.parent.mkdir(parents=True, exist_ok=True)
|
||||
proc = subprocess.Popen([RECORDER, *args, "-o", str(recording_path)], start_new_session=True)
|
||||
|
||||
@@ -99,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",
|
||||
|
||||
@@ -27,7 +27,7 @@ class Command:
|
||||
# Start the shell
|
||||
args = ["qs", "-c", "caelestia", "-n"]
|
||||
if self.args.log_rules:
|
||||
args.append("--log-rules", self.args.log_rules)
|
||||
args.extend(["--log-rules", self.args.log_rules])
|
||||
if self.args.daemon:
|
||||
args.append("-d")
|
||||
subprocess.run(args)
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -200,7 +200,7 @@ scheme: Scheme = None
|
||||
|
||||
|
||||
def read_colours_from_file(path: Path) -> dict[str, str]:
|
||||
return {k.strip(): v.strip() for k, v in (line.split(" ") for line in path.read_text().splitlines())}
|
||||
return {k.strip(): v.strip() for k, v in (line.split(" ") for line in path.read_text().splitlines() if line)}
|
||||
|
||||
|
||||
def get_scheme_path() -> Path:
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -36,7 +36,7 @@ def print_version() -> None:
|
||||
shell_ver = subprocess.check_output(["/usr/lib/caelestia/version", "-s"], text=True).strip()
|
||||
print("Shell:")
|
||||
print(" ", shell_ver)
|
||||
except subprocess.CalledProcessError:
|
||||
except FileNotFoundError:
|
||||
print("Shell: version helper not available")
|
||||
|
||||
print()
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import json
|
||||
import os
|
||||
import random
|
||||
import subprocess
|
||||
from argparse import Namespace
|
||||
from pathlib import Path
|
||||
|
||||
@@ -11,6 +13,7 @@ from caelestia.utils.hypr import message
|
||||
from caelestia.utils.material import get_colours_for_image
|
||||
from caelestia.utils.paths import (
|
||||
compute_hash,
|
||||
user_config_path,
|
||||
wallpaper_link_path,
|
||||
wallpaper_path_path,
|
||||
wallpaper_thumbnail_path,
|
||||
@@ -48,12 +51,7 @@ def get_wallpapers(args: Namespace) -> list[Path]:
|
||||
return walls
|
||||
|
||||
monitors = message("monitors")
|
||||
filter_size = monitors[0]["width"], monitors[0]["height"]
|
||||
for monitor in monitors[1:]:
|
||||
if filter_size[0] > monitor["width"]:
|
||||
filter_size[0] = monitor["width"]
|
||||
if filter_size[1] > monitor["height"]:
|
||||
filter_size[1] = monitor["height"]
|
||||
filter_size = min(m["width"] for m in monitors), min(m["height"] for m in monitors)
|
||||
|
||||
return [f for f in walls if check_wall(f, filter_size, args.threshold)]
|
||||
|
||||
@@ -158,6 +156,19 @@ def set_wallpaper(wall: Path | str, no_smart: bool) -> None:
|
||||
scheme.update_colours()
|
||||
apply_colours(scheme.colours, scheme.mode)
|
||||
|
||||
# Run custom post-hook if configured
|
||||
try:
|
||||
cfg = json.loads(user_config_path.read_text()).get("wallpaper", {})
|
||||
if post_hook := cfg.get("postHook"):
|
||||
subprocess.run(
|
||||
post_hook,
|
||||
shell=True,
|
||||
env={**os.environ, "WALLPAPER_PATH": str(wall)},
|
||||
stderr=subprocess.DEVNULL,
|
||||
)
|
||||
except (FileNotFoundError, json.JSONDecodeError):
|
||||
pass
|
||||
|
||||
|
||||
def set_random(args: Namespace) -> None:
|
||||
wallpapers = get_wallpapers(args)
|
||||
|
||||
Reference in New Issue
Block a user