blob: df5bcbaf4a4164d465098c5839ae8addcb2b3df6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#!/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-foot
cp (dirname (status filename))/../data/foot.template $CONFIG/../foot/schemes/dynamic.ini
for colour in $argv
set -l split (string split ' ' $colour)
sed -i "s/\$$split[1]/$split[2]/g" $CONFIG/../foot/schemes/dynamic.ini
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/scss/scheme
log 'Generating shell scheme'
gen-scss $colours > $CONFIG/shell/scss/scheme/_dynamic.scss
end
if test -d $CONFIG/safeeyes/scheme
log 'Generating SafeEyes scheme'
gen-scss $colours > $CONFIG/safeeyes/scheme/_dynamic.scss
end
if test -d $CONFIG/../foot/schemes
log 'Generating foot scheme'
gen-foot $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
|