summaryrefslogtreecommitdiff
path: root/scheme
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-19 17:26:31 +1100
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-02-19 17:26:31 +1100
commit066b9256b2f1697db1f85cc529454dbb88bd5b57 (patch)
tree37523825b471865d11ff3fb947d209ce29229ccb /scheme
parentinstall: fix discord (diff)
downloadcaelestia-cli-066b9256b2f1697db1f85cc529454dbb88bd5b57.tar.gz
caelestia-cli-066b9256b2f1697db1f85cc529454dbb88bd5b57.tar.bz2
caelestia-cli-066b9256b2f1697db1f85cc529454dbb88bd5b57.zip
scheme: new way of tracking
centralise the colours so all of them are kept here
Diffstat (limited to 'scheme')
-rwxr-xr-xscheme/apply-scheme.fish91
-rwxr-xr-xscheme/gen-scheme.fish4
2 files changed, 3 insertions, 92 deletions
diff --git a/scheme/apply-scheme.fish b/scheme/apply-scheme.fish
deleted file mode 100755
index ea15aa4..0000000
--- a/scheme/apply-scheme.fish
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/fish
-
-function gen-hypr
- for colour in $argv
- set -l split (string split ' ' $colour)
- echo "\$$split[1] = $split[2]"
- end
-end
-
-function gen-scss
- for colour in $argv
- set -l split (string split ' ' $colour)
- echo "\$$split[1]: #$split[2];"
- end
-end
-
-function gen-ini -a program
- cp (dirname (status filename))/../data/$program.template $CONFIG/../$program/schemes/dynamic.ini
- for colour in $argv[2..]
- set -l split (string split ' ' $colour)
- sed -i "s/\$$split[1]/$split[2]/g" $CONFIG/../$program/schemes/dynamic.ini
- end
-end
-
-function gen-json
- set -e jq_args
- for colour in $argv
- set -l split (string split ' ' $colour)
- set -a jq_args --arg $split[1] "#$split[2]"
- end
- jq -n $jq_args '$ARGS.named'
-end
-
-function gen-gtk
- cp (dirname (status filename))/../data/gtk.template $CONFIG/gtk/schemes/dynamic.css
- for colour in $argv
- set -l split (string split ' ' $colour)
- sed -i "s/\$$split[1]/#$split[2]/g" $CONFIG/gtk/schemes/dynamic.css
- end
-end
-
-. (dirname (status filename))/../util.fish
-
-set -l src (dirname (status filename))
-set -l colours ($src/gen-scheme.fish $argv[1])
-
-if test -d $CONFIG/../hypr/scheme
- log 'Generating hypr scheme'
- gen-hypr $colours > $CONFIG/../hypr/scheme/dynamic.conf
-end
-
-if test -d $CONFIG/shell
- log 'Generating shell scheme'
- gen-scss $colours > $CONFIG/shell/scss/scheme/_dynamic.scss
-end
-
-if test -d $CONFIG/safeeyes
- log 'Generating SafeEyes scheme'
- gen-scss $colours > $CONFIG/safeeyes/scheme/_dynamic.scss
-end
-
-if test -d $CONFIG/discord
- log 'Generating discord scheme'
- gen-scss $colours > /tmp/_colours.scss
- sass --no-charset --no-source-map -I /tmp $src/../data/discord.template $CONFIG/discord/themes/dynamic.theme.css
-end
-
-if test -d $CONFIG/../foot/schemes
- log 'Generating foot scheme'
- gen-ini foot $colours
-end
-
-if test -d $CONFIG/../fuzzel/schemes
- log 'Generating fuzzel scheme'
- gen-ini fuzzel $colours
-end
-
-if test -d $CONFIG/vscode
- log 'Generating VSCode scheme'
- gen-json $colours > $CONFIG/vscode/schemes/dynamic.json
-end
-
-if test -d $CONFIG/gtk
- log 'Generating GTK+ schemes'
- gen-gtk $colours
-end
-
-# Reload programs if dynamic scheme
-if test -f $CACHE/scheme/current.txt -a "$(cat $CACHE/scheme/current.txt)" = 'dynamic'
- caelestia scheme dynamic
-end
diff --git a/scheme/gen-scheme.fish b/scheme/gen-scheme.fish
index aa0ddc7..82fa710 100755
--- a/scheme/gen-scheme.fish
+++ b/scheme/gen-scheme.fish
@@ -31,6 +31,8 @@ test "$(cat $CACHE/scheme/current.txt)" = dynamic && gsettings set org.gnome.des
set -l names rosewater flamingo pink mauve red maroon peach yellow green teal sky sapphire blue lavender text subtext1 subtext0 overlay2 overlay1 overlay0 surface2 surface1 surface0 base mantle crust
set -l colours ($src/autoadjust.py $colour_scheme (okolors $img -k 15 -w 0 -l $light_vals))
-for i in (seq 1 (count $colours))
+set -l last (count $colours)
+for i in (seq 1 (math $last - 1))
echo "$names[$i] $colours[$i]"
end
+echo -n "$names[$last] $colours[$last]"