티스토리 뷰

Posted by treed@surreality.us on 2003-08-02 00:00:00

I got bored the other day and wanted to see if I could set up a way to randomly change the background image in GNOME from a directory of jpg files.

After a bit of experimentation, I came up with this:
gconftool -t str -s /desktop/gnome/background/picture_filename "`find "$BACKGROUND_DIR" -name \*.jpg | random | tail -n 1`"
It recursively searches $BACKGROUND_DIR for *.jpg, and randomly picks one, then sets the background to it. I've noticed that the random command isn't very random, but it works. I thought about adapting the weighted random algorithm I use in one of my IRC bots, as a fix. Perhaps another day.

Oh, and for some more fun, you can stick that command (you may need to replace "$BACKGROUND_DIR" with the actual directory), in a cronjob, to run say, once daily, or hourly.

'hacking > linux&gnome' 카테고리의 다른 글

Transparent background images  (0) 2003.08.18
Random GDM theme  (0) 2003.08.18
Installing Straw on Red Hat 8/9  (0) 2003.08.09
Theme-agnostic desktop entries  (0) 2003.08.09
gconf-editor  (0) 2003.08.09
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
«   2024/04   »
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30
글 보관함