changes from main

This commit is contained in:
end-4
2026-02-20 22:56:59 +01:00
parent 6f5ab232a6
commit 368df5b717
6 changed files with 39 additions and 27 deletions
@@ -8,7 +8,7 @@ fi
# Variables
SOURCE_IMG_PATH="$1"
MODEL="${2:-${GEMINI_WALLPAPER_MODEL:-gemini-2.0-flash}}" # We use the flash variant so it's fast
MODEL="${2:-${GEMINI_WALLPAPER_MODEL:-gemini-2.5-flash}}" # We use the flash variant so it's fast
WALLPAPER_NAME="$(basename "$SOURCE_IMG_PATH")"
PROMPT="${3:-${GEMINI_WALLPAPER_PROMPT:-Categorize the wallpaper. Its file name is $WALLPAPER_NAME}}"
RESIZED_IMG_PATH="/tmp/quickshell/ai/wallpaper.jpg"
@@ -155,6 +155,12 @@ set_thumbnail_path() {
fi
}
categorize_wallpaper() {
img_cat=$("$SCRIPT_DIR/../ai/gemini-categorize-wallpaper.sh" "$1")
# notify-send "Wallpaper category" "$img_cat"
echo "$img_cat" > "$STATE_DIR/user/generated/wallpaper/category.txt"
}
switch() {
imgpath="$1"
mode_flag="$2"
@@ -163,9 +169,9 @@ switch() {
color="$5"
# Start Gemini auto-categorization if enabled
aiStylingEnabled=$(jq -r '.background.clock.cookie.aiStyling' "$SHELL_CONFIG_FILE")
aiStylingEnabled=$(jq -r '.background.widgets.clock.cookie.aiStyling' "$SHELL_CONFIG_FILE")
if [[ "$aiStylingEnabled" == "true" ]]; then
"$SCRIPT_DIR/../ai/gemini-categorize-wallpaper.sh" "$imgpath" > "$STATE_DIR/user/generated/wallpaper/category.txt" &
categorize_wallpaper "$imgpath" &
fi
read scale screenx screeny screensizey < <(hyprctl monitors -j | jq '.[] | select(.focused) | .scale, .x, .y, .height' | xargs)