HEIC import, reimplement image change system
This commit is contained in:
17
cinnamon-dynamic-wallpaper@TobiZog/5.4/scripts/location.py
Normal file
17
cinnamon-dynamic-wallpaper@TobiZog/5.4/scripts/location.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import urllib.request, json
|
||||
from threading import Thread
|
||||
|
||||
class Location(Thread):
|
||||
def __init__(self):
|
||||
Thread.__init__(self)
|
||||
self.GEO_URL = "https://get.geojs.io/v1/ip/geo.json"
|
||||
|
||||
def run(self) -> dict:
|
||||
request = urllib.request.urlopen(self.GEO_URL)
|
||||
|
||||
data = json.load(request)
|
||||
|
||||
self.result = {
|
||||
"latitude": data["latitude"],
|
||||
"longitude": data["longitude"]
|
||||
}
|
||||
Reference in New Issue
Block a user