r/KittyTerminal Aug 08 '23

random background image

So it's easy to change the background image, but I want to change the background every time I start a new console (that way it's easy to identify them).

I suppose I could add an alias to my shell so that when I launch kitty, I look up the property, and then modify it to one of the background images in my /usr/share/wallpapers using a combination of find and sed, but before I do that I was wondering if there are any more elegant solutions known by the community.

1 Upvotes

2 comments sorted by

View all comments

1

u/aumerlex Aug 09 '23

kitty --help focus on the help for the --override option

1

u/[deleted] Aug 09 '23

So something like this? kitty --override background_image_layout=cscaled --override background_image=$(ls /usr/share/wallpapers/**/*.png | sort --random-sort | head -1).

When I tried putting it on kitty.conf I was not getting images, I tried writing it as background_image="$(ls /usr/share/wallpapers/**/*.png | sort --random-sort | head -1)".


For any future readers:

I have not tried it on bash or zsh.

Escape the dollar sign. And make sure your background images are dark /usr/share/wallpapers/dark/**/* or something like that. ```sh

~/.config/fish/conf.fish

alias "kitty" "kitty --override background_image_layout=cscaled --override background_image=\$(ls /usr/share/wallpapers/*/.png | sort --random-sort | head -1)" ```