Add instant background image cycling via GPU-preloaded textures#9836
Add instant background image cycling via GPU-preloaded textures#9836OmarMusayev wants to merge 2 commits intokovidgoyal:masterfrom
Conversation
a26dc2e to
24ad3f3
Compare
|
Instead background_image should become a glob expression that resolves By default the first matching image should be used. The change_background_image should take an optional argument that is an @ set-background-image should override and set the specified image for The list of background images should be lazy loaded, each item should |
… loading Reworked based on maintainer feedback: - background_image now accepts glob patterns (e.g., ~/backgrounds/*.png) that resolve to a sorted list of image paths - New change_background_image action: no arg = +1, +N/-N = delta with wraparound, plain N = absolute index clamped to list size - Lazy loading: images loaded on first access, cached in VRAM after - Failed image loads are silently removed from the list - kitten @ set-background-image extended: number or +/-N arguments cycle through the background image list for all matching OS windows - Per-window index tracking into shared image path list
24ad3f3 to
99cc202
Compare
|
Thanks for the feedback! I've reworked the implementation to match your suggestions:
Let me know if there's anything else to adjust. |
|
|
Thanks for the detailed feedback! I've addressed all 9 items:
Note on |
- Remove *_generated.go from source control (covered by .gitignore) - Add NULL checks in free_bg_image_list() before dereferencing - Improve docs for change_background_image action (syntax for +N/-N/N) - Document set-background-image remote control semantics (index, delta, path) - Make bg_image_idx unsigned in OSWindow struct - Refactor Go parser: extract read_image_file() shared helper, read_window_logo() (path only), read_background_image() (path + index) - set_bg_image_paths() now takes a tuple instead of a list - Remove background_image_paths field; background_image is now tuple[str, ...] - Fix option processing: dedicated background_image() function in utils.py, option_type changed in definition.py, parse.py updated via codegen - Update to-c.h to handle tuple from Python for C Options struct
ed24546 to
7eb9785
Compare
Summary
Reworked based on maintainer feedback.
background_imagenow accepts glob patterns that resolve to a sorted list of image paths, with a newchange_background_imageaction and lazy loading.Changes
background_imageaccepts globs: e.g.background_image ~/backgrounds/*.pngresolves to a sorted list of matching image files. Non-image files and directories are ignored. First match is used by default (backwards compatible with single paths).change_background_imageaction: Optional argument acts as index into the image list.+N/-N= delta with wraparound. Plain number = absolute index, clamped to list size. No argument =+1.kitten @ set-background-imageextended: If the argument is a number or+N/-N, it acts likechange_background_imageon all matching OS windows.Usage
Files changed (11)
kitty/graphics.hBackgroundImageListstructkitty/state.hkitty/state.ckitty/options/definition.pybackground_imagedescriptionkitty/options/parse.pykitty/options/types.pybackground_image_pathsfieldkitty/options/utils.pychange_background_imageaction parserkitty/boss.pykitty/rc/set_background_image.pytools/cmd/at/set_window_logo.gokitty/fast_data_types.pyiTest plan
change_background_imagecycles with +/-/absolutekitten @ set-background-image +1remote control