Add files via upload

This commit is contained in:
FURK4NGG
2025-08-07 13:04:14 +03:00
committed by GitHub
parent 84a091deac
commit 57134d5770
10 changed files with 1037 additions and 0 deletions
+110
View File
@@ -0,0 +1,110 @@
{
"modules-left": ["hyprland/workspaces"],
"modules-center": ["clock","custom/weather"],
"modules-right": ["tray","custom/scratchpad-indicator","memory","cpu","pulseaudio","custom/power"],
"sway/mode": {
"format": "<span style=\"italic\">{}</span>"
},
"network": {
"format-wifi": "{essid} ({signalStrength}%) ",
"format-ethernet": "{ifname} ",
"format-disconnected": "",
"max-length": 50,
"on-click": "kitty -e 'nmtui'"
},
"battery": {
"interval": 10,
"states": {
"warning": 30,
"critical": 15
},
// Connected to AC
"format": " {icon} {capacity}%", // Icon: bolt
// Not connected to AC
"format-discharging": "{icon} {capacity}%",
"format-icons": [
"", // Icon: battery-full
"", // Icon: battery-three-quarters
"", // Icon: battery-half
"", // Icon: battery-quarter
"" // Icon: battery-empty
],
"tooltip": true
},
"tray": {
"icon-size": 15,
"spacing": 10
},
"clock": {
// "tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>",
// "format-alt": "{:%Y-%m-%d}"
"on-click": "gnome-calendar",
"tooltip-format": "{:%A %d.%m.%Y}",
"interval": 60
},
"hyprland/workspaces": {
"format": "{icon}",
"on-click": "activate",
"on-scroll-up": "hyprctl dispatch workspace -1",
"on-scroll-down": "hyprctl dispatch workspace +1",
"format-icons": {
"active": "",
"urgent": "",
"default": ""
},
"persistent-workspaces": {
"*": [ 1,2 ]
}
},
"custom/weather": {
"format": "{}",
"tooltip": true,
"interval": 1800,
"exec": "$HOME/.config/waybar/scripts/weather.py",
"return-type": "json"
},
"memory": {
"interval": 30,
"format": " {used:0.1f}GB",
"max-length": 10,
"tooltip": false
},
"cpu": {
"interval": 10,
"format": "{usage}%",
"max-length": 10,
"tooltip": false
},
"temperature": {
"thermal-zone": 1,
"format": "",
"format-alt-click": "click-right",
"format-alt": " {temperatureC}°C",
"critical-threshold": 70,
"format-critical": " {temperatureC}°C",
},
"pulseaudio": {
"format": "{volume}% {icon} ",
"format-bluetooth": "{volume}% {icon} {format_source}",
"format-bluetooth-muted": " {icon} {format_source}",
"format-muted": "0% {icon} ",
"format-source": "{volume}% ",
"format-source-muted": "",
"format-icons": {
"headphone": "",
"hands-free": "",
"headset": "",
"phone": "",
"portable": "",
"car": "",
"default": ["", "", ""]
},
"on-click": "pavucontrol"
},
"custom/power": {
"format": " ",
"on-click": "wlogout",
"tooltip": false
}
}
+115
View File
@@ -0,0 +1,115 @@
#!/usr/bin/env python3
import json
import requests
from datetime import datetime
WEATHER_CODES = {
'113': '☀️',
'116': '⛅️',
'119': '☁️',
'122': '☁️',
'143': '🌫',
'176': '🌦',
'179': '🌧',
'182': '🌧',
'185': '🌧',
'200': '',
'227': '🌨',
'230': '❄️',
'248': '🌫',
'260': '🌫',
'263': '🌦',
'266': '🌦',
'281': '🌧',
'284': '🌧',
'293': '🌦',
'296': '🌦',
'299': '🌧',
'302': '🌧',
'305': '🌧',
'308': '🌧',
'311': '🌧',
'314': '🌧',
'317': '🌧',
'320': '🌨',
'323': '🌨',
'326': '🌨',
'329': '❄️',
'332': '❄️',
'335': '❄️',
'338': '❄️',
'350': '🌧',
'353': '🌦',
'356': '🌧',
'359': '🌧',
'362': '🌧',
'365': '🌧',
'368': '🌨',
'371': '❄️',
'374': '🌧',
'377': '🌧',
'386': '',
'389': '🌩',
'392': '',
'395': '❄️'
}
data = {}
weather = requests.get("https://wttr.in/Istanbul, Manitoba?format=j1").json()
def format_time(time):
return time.replace("00", "").zfill(2)
def format_temp(temp):
return (hour['FeelsLikeC']+"°").ljust(3)
def format_chances(hour):
chances = {
"chanceoffog": "Fog",
"chanceoffrost": "Frost",
"chanceofovercast": "Overcast",
"chanceofrain": "Rain",
"chanceofsnow": "Snow",
"chanceofsunshine": "Sunshine",
"chanceofthunder": "Thunder",
"chanceofwindy": "Wind"
}
conditions = []
for event in chances.keys():
if int(hour[event]) > 0:
conditions.append(chances[event]+" "+hour[event]+"%")
return ", ".join(conditions)
data['text'] = WEATHER_CODES[weather['current_condition'][0]['weatherCode']] + \
" " + weather['current_condition'][0]['FeelsLikeC']+ "°"
#data['text'] = weather['current_condition'][0]['FeelsLikeC']+"°"
data['tooltip'] = f"<b>{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}°</b>\n"
data['tooltip'] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}°\n"
data['tooltip'] += f"Wind: {weather['current_condition'][0]['windspeedKmph']}Km/h\n"
data['tooltip'] += f"Humidity: {weather['current_condition'][0]['humidity']}%\n"
for i, day in enumerate(weather['weather']):
data['tooltip'] += f"\n<b>"
if i == 0:
data['tooltip'] += "Today, "
if i == 1:
data['tooltip'] += "Tomorrow, "
data['tooltip'] += f"{day['date']}</b>\n"
data['tooltip'] += f"⬆️ {day['maxtempC']}° ⬇️ {day['mintempC']}° "
data['tooltip'] += f"{day['astronomy'][0]['sunrise']}{day['astronomy'][0]['sunset']}\n"
for hour in day['hourly']:
if i == 0:
if int(format_time(hour['time'])) < datetime.now().hour-2:
continue
data['tooltip'] += f"{format_time(hour['time'])} {WEATHER_CODES[hour['weatherCode']]} {format_temp(hour['FeelsLikeC'])} {hour['weatherDesc'][0]['value']}, {format_chances(hour)}\n"
print(json.dumps(data))
+137
View File
@@ -0,0 +1,137 @@
* {
border: none;
font-family: Font Awesome, Roboto, Arial, sans-serif;
font-size: 13px;
color: #ffffff;
border-radius: 20px;
}
window#waybar{
all:unset;
}
window {
/*font-weight: bold;*/
}
window#waybar {
color: #a5adcb;
}
/*-----module groups----*/
.modules-right {
background-color: #a5adcb;
margin: 2px 10px 0 0;
}
.modules-center {
background-color: transparent;
font-weight: bold;
margin: 2px 0 0 0;
}
.modules-left {
margin: 2px 0 0 7px;
}
/*-----modules indv----*/
#workspaces {
background-color: #a5adcb;
padding: 0px 5px;
}
#workspaces button {
margin: 0 2px;
color: #5b6078;
background: none;
padding: 0;
}
#workspaces button:hover {
color: #a6da95;
}
#workspaces button.active {
color: #f5bde6;
}
#clock,
#battery,
#cpu,
#memory,
#temperature,
#network,
#pulseaudio,
#custom-weather,
#custom-media,
#tray,
#mode,
#custom-power,
#custom-menu,
#idle_inhibitor {
padding: 0 10px;
}
#mode {
color: #cc3436;
font-weight: bold;
}
#memory{
font-weight: 300;
}
#battery {
animation-timing-function: linear;
animation-iteration-count: infinite;
animation-direction: alternate;
}
#battery.warning {
color: orange;
}
#battery.critical {
color: red;
}
#battery.warning.discharging {
animation-name: blink-warning;
animation-duration: 3s;
}
#battery.critical.discharging {
animation-name: blink-critical;
animation-duration: 2s;
}
#custom-power {
background-color: #a5adcb;
border-radius: 100px;
margin: 5px 5px;
padding: 1px 1px 1px 6px;
}
/*-----Indicators----*/
#idle_inhibitor.activated {
color: #ffffff;
}
#pulseaudio.muted {
color: #cc3436;
}
#battery.charging {
color: #2dcc36;
}
#custom-weather {
padding-right: 16px;
border-radius: 0px 10px 10px 0px;
transition: none;
color: #ffffff;
background-color: transparent;
}
#battery.warning:not(.charging) {
color: #e6e600;
}
#battery.critical:not(.charging) {
color: #cc3436;
}
#temperature.critical {
background-color: @critical;
}
#disk.warning,
#temperature.warning {
background-color: @warning;
}
/*-----Colors----*/
/*
*rgba(0,85,102,1),#005566 --> Indigo(dye)
*rgba(0,43,51,1),#002B33 --> Dark Green
*rgba(0,153,153,1),#009999 --> Persian Green
*
*/