SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-08-18 10:52:12

hrnn187
Member
Registered: 2014-07-29
Posts: 20

simpler rotating wallpapers script

just fooling around with google, python and feh, ended up with this:

pick a random file from a folder with images (as far as I know it's recursive, but I have only one level, so I didn't test it).

#!/usr/bin/python

import os, random

working_directory = '/home/hrnn/wallpapers/'
new_wallpaper = random.choice(os.listdir('/home/hrnn/wallpapers'))

os.system('DISPLAY=:0 feh --bg-scale ' + working_directory + new_wallpaper )

the "DISPLAY=:0" bit is necessary as cron runs in a lower level and doesn't care about X, so it must be explicitly stated in order for feh to do what I'm asking. so said google, at least.

saved simply as rotatewallpaper (no extension)

and the crontab, every ten minutes

*/10 * * * * /home/hrnn/rotatewallpaper  

cheers!

Last edited by hrnn187 (2014-08-18 10:53:39)

Offline

Be excellent to each other!

#2 2014-09-13 01:06:32

uriel1998
Member
From: Dayton, OH
Registered: 2012-02-10
Posts: 49
Website

Re: simpler rotating wallpapers script

Does it cause your monitor to flicker when changing wallpapers?

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: acrobat

Debian Logo