blob: 44ddff0b252eb42e0c5866cf2d39b0f79723a346 (
plain) (
blame)
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
|
#!/usr/bin/env bash
# ==================================================
# KoolDots (2026)
# Project URL: https://github.com/LinuxBeginnings
# License: GNU GPLv3
# SPDX-License-Identifier: GPL-3.0-or-later
# ==================================================
# Wallust version compatibility helpers
#
# Purpose:
# - Wallust v3 reads ~/.config/wallust/wallust.toml (this repo ships a v3 config)
# - Wallust v4 alpha uses a different config schema; users frequently install it
# via wallust-git, which will fail to parse the v3 config.
#
# This file detects Wallust major version and sets arrays used by scripts:
# - wallust_args: args to pass to wallust for wallpaper-derived palette generation
# - wallust_kitty_args: args to pass to wallust for kitty-only palette generation
wallust_args=()
wallust_kitty_args=()
wallust_prepare_args() {
wallust_args=()
wallust_kitty_args=()
command -v wallust >/dev/null 2>&1 || return 0
local version major
version=$(wallust --version 2>/dev/null | awk '{print $2}')
major=${version%%.*}
# Wallust v4 supports -C/--config-file.
if [ -n "$major" ] && [ "$major" -ge 4 ]; then
local v4_cfg="$HOME/.config/wallust/wallust-v4.toml"
local v4_kitty_cfg="$HOME/.config/wallust/wallust-kitty-v4.toml"
if [ -f "$v4_cfg" ]; then
wallust_args=(-C "$v4_cfg")
fi
if [ -f "$v4_kitty_cfg" ]; then
wallust_kitty_args=(-C "$v4_kitty_cfg")
fi
fi
}
wallust_prepare_args
|