Skip to content

Commit

Permalink
Merge pull request #3 from AlperSakarya/master
Browse files Browse the repository at this point in the history
folder name and spacing update
  • Loading branch information
limhenry committed Apr 23, 2016
2 parents d62140e + 60bf169 commit ab2b54d
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions script/output.txt

Large diffs are not rendered by default.

File renamed without changes.
30 changes: 18 additions & 12 deletions wallpaper changer/indicator.py → wallpaper-changer/indicator.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import signal
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
gi.require_version('Notify', '0.7')
from gi.repository import Gtk as gtk
from gi.repository import AppIndicator3 as appindicator
import json
Expand Down Expand Up @@ -27,25 +31,27 @@ def build_menu():
menu.show_all()
return menu


def quit(source):
gtk.main_quit()


def changewallpaper(source):
with open('data.json') as data_file:
data = json.load(data_file)
with open('data.json') as data_file:
data = json.load(data_file)

rand = randint(0,1510)
data = data[rand]
wallpaper = data["Image URL"]
url = "http://" + wallpaper
rand = randint(0,1510)
data = data[rand]
wallpaper = data["Image URL"]
url = "http://" + wallpaper

urllib.urlretrieve(url, "wallpaper.jpg")
urllib.urlretrieve(url, "wallpaper.jpg")

location = '"' + "file://" + os.path.dirname(os.path.realpath(__file__)) + "/wallpaper.jpg" + '"'
command = "gsettings set org.gnome.desktop.background picture-uri " + location
os.system(command)
notify.Notification.new("<b>Earth View Wallpaper Changer</b>", "Wallpaper changed successfully", None).show()
location = '"' + "file://" + os.path.dirname(os.path.realpath(__file__)) + "/wallpaper.jpg" + '"'
command = "gsettings set org.gnome.desktop.background picture-uri " + location
os.system(command)
notify.Notification.new("<b>Earth View Wallpaper Changer</b>", "Wallpaper changed successfully", None).show()

if __name__ == "__main__":
signal.signal(signal.SIGINT, signal.SIG_DFL)
main()
main()
File renamed without changes
Binary file added wallpaper-changer/wallpaper.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ab2b54d

Please sign in to comment.