waybar!
This commit is contained in:
+1
-18
@@ -12,24 +12,7 @@ client.focused_inactive #000000 #000000 #000000 #000000
|
||||
client.unfocused #000000 #000000 #000000 #000000
|
||||
client.urgent #ffffff #ffffff #ffffff #ffffff
|
||||
client.placeholder #000000 #000000 #000000 #000000
|
||||
|
||||
|
||||
bar top {
|
||||
position top
|
||||
status_command python3 $base/main/sway_status.py
|
||||
font pango:Noto Sans Mono 10
|
||||
mode dock
|
||||
|
||||
colors {
|
||||
background #000000
|
||||
statusline #ffffff
|
||||
separator #ffffff
|
||||
focused_workspace #000000 #ffffff #000000
|
||||
active_workspace #000000 #ffffff #000000
|
||||
inactive_workspace #000000 #000000 #ffffff
|
||||
urgent_workspace #ffffff #ffffff #ffffff
|
||||
}
|
||||
}
|
||||
exec waybar
|
||||
|
||||
for_window [app_id="xpad"] floating enable
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import os, json, subprocess
|
||||
from warehouse import http_get, Vpn_cache
|
||||
|
||||
if "wg" in subprocess.run(["ip","link"], capture_output=True, text=True).stdout:
|
||||
if not os.path.exists(Vpn_cache) or os.path.getsize(Vpn_cache) == 0:
|
||||
try:
|
||||
ip = http_get("https://icanhazip.com").strip()
|
||||
res = json.loads(http_get(f"https://iplookup.stab.ing/api/v1/lookup?ip={ip}"))["country"]
|
||||
except:
|
||||
res = "NAY!"
|
||||
open(Vpn_cache, "w").write(res)
|
||||
print(f"VPN: {open(Vpn_cache).read()} / ", end="")
|
||||
else:
|
||||
try: os.remove(Vpn_cache)
|
||||
except: pass
|
||||
print("", end="")
|
||||
Reference in New Issue
Block a user