Created
May 14, 2013 09:38
-
-
Save mainerror/5574806 to your computer and use it in GitHub Desktop.
A desktop wallpaper switcher inspired by Google Now's themes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2004 Sam Hocevar <[email protected]> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | |
0. You just DO WHAT THE FUCK YOU WANT TO. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# | |
# Copyright © 2013 Octavian Damiean <[email protected]> | |
# This work is free. You can redistribute it and/or modify it under the | |
# terms of the Do What The Fuck You Want To Public License, Version 2, | |
# as published by Sam Hocevar. See the COPYING file for more details. | |
# | |
# | |
# This script is meant to be used in conjunction with the Google Now wallpaper sets. | |
# An example wallpaper set can be found here. http://fav.me/d5utjso | |
# Change the 'image_path' variable to the path where you excracted your images. | |
# Obviously this script assumes your are using Gnome or a Gnome based environment. | |
# | |
# Make sure the script is executable and in PATH directory, then add it to crontab using following line: | |
# 0 * * * * google-now.py | |
import time | |
from subprocess import call | |
from os.path import expanduser | |
hour = int(time.strftime('%H')) | |
home = expanduser('~') | |
image_path = '/Pictures/' | |
if 5 <= hour < 12: | |
call(['gsettings', 'set', 'org.gnome.desktop.background', 'picture-uri', 'file:///' + home + image_path + '1.jpg']) | |
elif 12 <= hour < 14: | |
call(['gsettings', 'set', 'org.gnome.desktop.background', 'picture-uri', 'file:///' + home + image_path + '2.jpg']) | |
elif 14 <= hour < 20: | |
call(['gsettings', 'set', 'org.gnome.desktop.background', 'picture-uri', 'file:///' + home + image_path + '3.jpg']) | |
elif 20 <= hour or hour < 5: | |
call(['gsettings', 'set', 'org.gnome.desktop.background', 'picture-uri', 'file:///' + home + image_path + '4.jpg']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment