Replace cursor_ask.sh with popup.sh launching popups from a Kando "popups" menu; cursor_follow.lua gains a popups table (sizes, follow until Enter, stay_focused) and pauses following while Kando is open. Add aichat config/role for the quick Claude popup and Kando menu/theme configs, with gen-colors syncing the Kando theme palette. Co-Authored-By: Claude Opus 5.5 <[email protected]>
88 lines
2.9 KiB
Bash
Executable File
88 lines
2.9 KiB
Bash
Executable File
#!/bin/sh
|
|
# Generate color fragment files for all configs from colors.conf
|
|
set -e
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
SRC="$SCRIPT_DIR/colors.conf"
|
|
|
|
if [ ! -f "$SRC" ]; then
|
|
echo "Error: $SRC not found" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Read colors into variables
|
|
while IFS='=' read -r key value; do
|
|
case "$key" in \#* | "") continue ;; esac
|
|
eval "color_$key=$value"
|
|
done <"$SRC"
|
|
|
|
# Hyprland (Lua): color_name = "rgb(HEXVAL)" globals (no #)
|
|
{
|
|
echo "-- Generated by sh/gen-colors from colors.conf. Do not edit."
|
|
while IFS='=' read -r key value; do
|
|
case "$key" in \#* | "") continue ;; esac
|
|
hex="${value#\#}"
|
|
echo "color_$key = \"rgb($hex)\""
|
|
done <"$SRC"
|
|
} >"$SCRIPT_DIR/hypr/colors.lua"
|
|
echo "Wrote hypr/colors.lua"
|
|
|
|
# Sway: set $color_name #HEXVAL
|
|
{
|
|
while IFS='=' read -r key value; do
|
|
case "$key" in \#* | "") continue ;; esac
|
|
echo "set \$color_$key $value"
|
|
done <"$SRC"
|
|
} >"$SCRIPT_DIR/sway/colors.conf"
|
|
echo "Wrote sway/colors.conf"
|
|
|
|
# i3: same format as sway
|
|
cp "$SCRIPT_DIR/sway/colors.conf" "$SCRIPT_DIR/i3/colors.conf"
|
|
echo "Wrote i3/colors.conf"
|
|
|
|
# Waybar CSS: @define-color color_name #HEXVAL;
|
|
{
|
|
while IFS='=' read -r key value; do
|
|
case "$key" in \#* | "") continue ;; esac
|
|
echo "@define-color color_$key $value;"
|
|
done <"$SRC"
|
|
} >"$SCRIPT_DIR/waybar/colors.css"
|
|
echo "Wrote waybar/colors.css"
|
|
|
|
# Wofi CSS: same as waybar
|
|
cp "$SCRIPT_DIR/waybar/colors.css" "$SCRIPT_DIR/wofi/colors.css"
|
|
echo "Wrote wofi/colors.css"
|
|
|
|
# Kando: colors for its Purity pie menu theme, set in kando/config.json (Kando reloads it live)
|
|
# rgba <#hex> <alpha> -> rgb(r g b / alpha)
|
|
rgba() {
|
|
hex="${1#\#}"
|
|
printf 'rgb(%d %d %d / %s)' "0x$(echo "$hex" | cut -c1-2)" "0x$(echo "$hex" | cut -c3-4)" "0x$(echo "$hex" | cut -c5-6)" "$2"
|
|
}
|
|
kando="$SCRIPT_DIR/kando/config.json"
|
|
if [ -f "$kando" ]; then
|
|
colors=$(
|
|
jq -n \
|
|
--arg text "$(rgba "$color_text_light" 0.9)" \
|
|
--arg icon "$(rgba "$color_text_light" 0.9)" \
|
|
--arg icon_hover "$(rgba "$color_primary" 1)" \
|
|
--arg ring "$(rgba "$color_bg" 0.94)" \
|
|
--arg inner "$(rgba "$color_primary" 0.6)" \
|
|
--arg wedge "$(rgba "$color_primary" 0.18)" \
|
|
--arg submenu "$(rgba "$color_alt_bg" 0.9)" \
|
|
--arg action "$(rgba "$color_alt_bg" 0.9)" \
|
|
--arg background "$(rgba "$color_bg_secondary" 0)" \
|
|
--arg vignette "$(rgba "$color_bg_secondary" 0.55)" \
|
|
'{"text-color": $text, "icon-color": $icon, "icon-hover-color": $icon_hover,
|
|
"ring-color": $ring, "inner-circle": $inner, "wedge-color": $wedge,
|
|
"sector-color-submenu": $submenu, "sector-color-action": $action,
|
|
"background-main": $background, "background-secondary": $vignette}'
|
|
)
|
|
# written in place, so the symlink in ~/.config/kando keeps pointing here
|
|
updated=$(jq --argjson colors "$colors" '.menuThemeColors.purity = $colors' "$kando")
|
|
printf '%s\n' "$updated" >"$kando"
|
|
echo "Wrote kando/config.json (Purity theme colors)"
|
|
fi
|
|
|
|
echo "Done. All color fragments generated."
|