fix gemini clock styling

This commit is contained in:
end-4
2026-02-20 09:11:43 +01:00
parent 60c197e2f5
commit 2e7ea9d9f6
2 changed files with 12 additions and 13 deletions
@@ -66,16 +66,9 @@ Item {
} }
} }
Connections {
target: Config
function onReadyChanged() {
categoryFileView.path = Directories.generatedWallpaperCategoryPath
}
}
FileView { FileView {
id: categoryFileView id: categoryFileView
path: "" path: Config.ready ? Directories.generatedWallpaperCategoryPath : ""
watchChanges: true watchChanges: true
onFileChanged: reload() onFileChanged: reload()
onLoaded: { onLoaded: {
@@ -85,7 +78,7 @@ Item {
property bool useSineCookie: Config.options.background.widgets.clock.cookie.useSineCookie property bool useSineCookie: Config.options.background.widgets.clock.cookie.useSineCookie
StyledDropShadow { StyledDropShadow {
target: useSineCookie ? sineCookieLoader : roundedPolygonCookieLoader target: root.useSineCookie ? sineCookieLoader : roundedPolygonCookieLoader
RotationAnimation on rotation { RotationAnimation on rotation {
running: Config.options.background.widgets.clock.cookie.constantlyRotate running: Config.options.background.widgets.clock.cookie.constantlyRotate
@@ -100,7 +93,7 @@ Item {
id: sineCookieLoader id: sineCookieLoader
z: 0 z: 0
visible: false // The DropShadow already draws it visible: false // The DropShadow already draws it
active: useSineCookie active: root.useSineCookie
sourceComponent: SineCookie { sourceComponent: SineCookie {
implicitSize: root.implicitSize implicitSize: root.implicitSize
sides: Config.options.background.widgets.clock.cookie.sides sides: Config.options.background.widgets.clock.cookie.sides
@@ -111,7 +104,7 @@ Item {
id: roundedPolygonCookieLoader id: roundedPolygonCookieLoader
z: 0 z: 0
visible: false // The DropShadow already draws it visible: false // The DropShadow already draws it
active: !useSineCookie active: !root.useSineCookie
sourceComponent: MaterialCookie { sourceComponent: MaterialCookie {
implicitSize: root.implicitSize implicitSize: root.implicitSize
sides: Config.options.background.widgets.clock.cookie.sides sides: Config.options.background.widgets.clock.cookie.sides
@@ -155,6 +155,12 @@ set_thumbnail_path() {
fi 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() { switch() {
imgpath="$1" imgpath="$1"
mode_flag="$2" mode_flag="$2"
@@ -163,9 +169,9 @@ switch() {
color="$5" color="$5"
# Start Gemini auto-categorization if enabled # 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 if [[ "$aiStylingEnabled" == "true" ]]; then
"$SCRIPT_DIR/../ai/gemini-categorize-wallpaper.sh" "$imgpath" > "$STATE_DIR/user/generated/wallpaper/category.txt" & categorize_wallpaper "$imgpath" &
fi fi
read scale screenx screeny screensizey < <(hyprctl monitors -j | jq '.[] | select(.focused) | .scale, .x, .y, .height' | xargs) read scale screenx screeny screensizey < <(hyprctl monitors -j | jq '.[] | select(.focused) | .scale, .x, .y, .height' | xargs)