Обновить dwmbar
This commit is contained in:
parent
0e99ff770b
commit
071ea6e4ad
11
dwmbar
11
dwmbar
|
@ -33,6 +33,7 @@ async def dwmbar():
|
||||||
await asyncio.sleep(0.1)
|
await asyncio.sleep(0.1)
|
||||||
|
|
||||||
|
|
||||||
|
net = ram = cpu = gpu = wlan = disk = vol = lang = dat = tim = currates = weather = 0
|
||||||
def status():
|
def status():
|
||||||
global DELIM, net, ram, cpu, gpu, wlan, disk, vol, lang, dat, tim
|
global DELIM, net, ram, cpu, gpu, wlan, disk, vol, lang, dat, tim
|
||||||
|
|
||||||
|
@ -76,9 +77,10 @@ async def currates():
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
curs = []
|
curs = []
|
||||||
|
try:
|
||||||
curs.append(['', f"${float(requests.get('https://api.binance.com/api/v3/ticker/24hr?symbol=BTCUSDT').json()['lastPrice']):.2f}"])
|
curs.append(['', f"${float(requests.get('https://api.binance.com/api/v3/ticker/24hr?symbol=BTCUSDT').json()['lastPrice']):.2f}"])
|
||||||
curs.append(['', f"${float(requests.get('https://api.binance.com/api/v3/ticker/24hr?symbol=LTCUSDT').json()['lastPrice']):.2f}"])
|
# curs.append(['', f"${float(requests.get('https://api.binance.com/api/v3/ticker/24hr?symbol=LTCUSDT').json()['lastPrice']):.2f}"])
|
||||||
curs.append(['Ð', f"${float(requests.get('https://api.binance.com/api/v3/ticker/24hr?symbol=DOGEUSDT').json()['lastPrice']):.2f}"])
|
# curs.append(['Ð', f"${float(requests.get('https://api.binance.com/api/v3/ticker/24hr?symbol=DOGEUSDT').json()['lastPrice']):.2f}"])
|
||||||
|
|
||||||
if COLOR:
|
if COLOR:
|
||||||
row = list(map(lambda x: f'^b{COLOR1}^^c{COLOR2}^ {x[0]} ^c{COLOR1}^^b{COLOR2}^ {x[1]} ^d^', curs))
|
row = list(map(lambda x: f'^b{COLOR1}^^c{COLOR2}^ {x[0]} ^c{COLOR1}^^b{COLOR2}^ {x[1]} ^d^', curs))
|
||||||
|
@ -86,6 +88,8 @@ async def currates():
|
||||||
row = list(map(lambda x: f'[{x[0]} | {x[1]}]', curs))
|
row = list(map(lambda x: f'[{x[0]} | {x[1]}]', curs))
|
||||||
|
|
||||||
currates = DELIM.join(row)
|
currates = DELIM.join(row)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
await asyncio.sleep(60 * 10)
|
await asyncio.sleep(60 * 10)
|
||||||
|
|
||||||
|
@ -99,6 +103,7 @@ async def weather():
|
||||||
CITY='Tyumen'
|
CITY='Tyumen'
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
try:
|
||||||
i = requests.get(f"https://wttr.in/{CITY}?format=%c").text.strip() #.encode('utf-8')[0:3].decode('utf-8')
|
i = requests.get(f"https://wttr.in/{CITY}?format=%c").text.strip() #.encode('utf-8')[0:3].decode('utf-8')
|
||||||
t = requests.get(f"https://wttr.in/{CITY}?format=%t").text.strip()
|
t = requests.get(f"https://wttr.in/{CITY}?format=%t").text.strip()
|
||||||
w = requests.get(f"https://wttr.in/{CITY}?format=j2").json()['current_condition'][0]['windspeedKmph'].strip()
|
w = requests.get(f"https://wttr.in/{CITY}?format=j2").json()['current_condition'][0]['windspeedKmph'].strip()
|
||||||
|
@ -107,6 +112,8 @@ async def weather():
|
||||||
weather = f"^b{COLOR2}^^c{COLOR1}^ {w} km/h ^b{COLOR1}^^c{COLOR2}^ {i} ^c{COLOR1}^^b{COLOR2}^ {t} ^d^"
|
weather = f"^b{COLOR2}^^c{COLOR1}^ {w} km/h ^b{COLOR1}^^c{COLOR2}^ {i} ^c{COLOR1}^^b{COLOR2}^ {t} ^d^"
|
||||||
else:
|
else:
|
||||||
weather = f"[{w} km/h | {i} | {t}]"
|
weather = f"[{w} km/h | {i} | {t}]"
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
await asyncio.sleep(60 * 30)
|
await asyncio.sleep(60 * 30)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue