diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-02-23 20:30:19 +1100 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-02-23 20:30:19 +1100 |
| commit | 557e1e4abe52c938a4d92ae58a44856982d4e2c5 (patch) | |
| tree | adcfb8c1e9b7581052e7d43d9053555602f9c893 /scheme/main.fish | |
| parent | emoji-picker: add emoji (diff) | |
| download | caelestia-cli-557e1e4abe52c938a4d92ae58a44856982d4e2c5.tar.gz caelestia-cli-557e1e4abe52c938a4d92ae58a44856982d4e2c5.tar.bz2 caelestia-cli-557e1e4abe52c938a4d92ae58a44856982d4e2c5.zip | |
scheme: light/dark mode
Diffstat (limited to 'scheme/main.fish')
| -rwxr-xr-x | scheme/main.fish | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/scheme/main.fish b/scheme/main.fish new file mode 100755 index 0000000..06c4c14 --- /dev/null +++ b/scheme/main.fish @@ -0,0 +1,30 @@ +#!/bin/fish + +set -l src (dirname (status filename))/.. + +. $src/util.fish + +set -l valid_schemes (path change-extension '' $src/data/schemes/* | sed 's!.*/!!') +set -l light_schemes latte + +if contains -- "$argv[1]" $valid_schemes + mkdir -p $C_STATE/scheme + + # Update scheme colours + cp $src/data/schemes/$argv[1].txt $C_STATE/scheme/current.txt + + # Update scheme name + echo -n $argv[1] > $C_STATE/scheme/current-name.txt + + # Update scheme mode + if test $argv[1] = dynamic + set colour_scheme (cat $C_STATE/scheme/dynamic-mode.txt) + else + contains -- "$argv[1]" $light_schemes && set colour_scheme light || set colour_scheme dark + end + echo -n $colour_scheme > $C_STATE/scheme/current-mode.txt + + log "Changed scheme to $argv[1]" +else + error "Invalid scheme: $argv[1]" +end |