Move folder
This commit is contained in:
80
home/config/waybar/config.jsonc
Normal file
80
home/config/waybar/config.jsonc
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"layer": "top",
|
||||
"position": "top",
|
||||
"mod": "dock",
|
||||
"exclusice": true,
|
||||
"passthrough": false,
|
||||
"gtk-layer-shell": true,
|
||||
"height": 0,
|
||||
"modules-left": [
|
||||
"hyprland/workspaces"
|
||||
],
|
||||
"modules-center": ["hyprland/window"],
|
||||
"modules-right": [
|
||||
"tray",
|
||||
"custom/updates",
|
||||
"hyprland/language",
|
||||
"pulseaudio",
|
||||
"pulseaudio#microphone",
|
||||
"clock",
|
||||
"custom/weather"
|
||||
],
|
||||
"hyprland/window": {
|
||||
"format": {}
|
||||
},
|
||||
"hyprland/workspaces": {
|
||||
"disable-scroll": true,
|
||||
"all-outputs": true,
|
||||
"on-click": "activate",
|
||||
"persisten_workspaces": {
|
||||
"1": []
|
||||
}
|
||||
},
|
||||
"hyprland/language": {
|
||||
"format": "{}",
|
||||
"format-en": "EN",
|
||||
"format-ro": "RO"
|
||||
},
|
||||
"custom/weather": {
|
||||
"tooltip": true,
|
||||
"format": "{}",
|
||||
"interval": 30,
|
||||
"exec": "~/.config/waybar/scripts/waybar-wttr.py",
|
||||
"return-type": "json"
|
||||
},
|
||||
"tray": {
|
||||
"icon-size": 16,
|
||||
"spacing": 10
|
||||
},
|
||||
"clock": {
|
||||
"format": "{:%R %d%M}",
|
||||
"tooltip-format": "<big>{:%Y %B}</big>\n<tt><small>{calendar}</small></tt>"
|
||||
},
|
||||
"pulseaudio": {
|
||||
"format": "{icon} {volume}%",
|
||||
"tooltip": false,
|
||||
"format-muted": "Muted",
|
||||
"on-click": "pamixer -t",
|
||||
"on-scroll-up": "pamixer -i 5",
|
||||
"on-scroll-down": "pamixer -d 5",
|
||||
"scroll-step": 5
|
||||
// "format-icons": {
|
||||
// "headphones": "",
|
||||
// "hands-free": "",
|
||||
// "headset": "",
|
||||
// "phone": "",
|
||||
// "portable": "",
|
||||
// "car": "",
|
||||
// "default": ["", "", ""]
|
||||
// }
|
||||
},
|
||||
"pulseaudio#microphone": {
|
||||
"format": "{format_source}",
|
||||
"format-source": "{volume}%",
|
||||
"format-source-muted": "Muted",
|
||||
"on-click": "pamixer --default-source -t",
|
||||
"on-scroll-up": "pamixer --default-source -i 5",
|
||||
"on-scroll-down": "pamixer --default-source -d 5",
|
||||
"scroll-step": 5
|
||||
}
|
||||
}
|
||||
124
home/config/waybar/scripts/waybar-wttr.py
Normal file
124
home/config/waybar/scripts/waybar-wttr.py
Normal file
@@ -0,0 +1,124 @@
|
||||
#!/run/current-system/sw/bin/python
|
||||
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
import requests
|
||||
|
||||
WEATHER_CODES = {
|
||||
"113": "Sunny",
|
||||
"116": "Patchy",
|
||||
"119": "Cloudy",
|
||||
"122": "Cloudy",
|
||||
"143": "Cloudy",
|
||||
"176": "Rain",
|
||||
"179": "Rain",
|
||||
"182": "Rain",
|
||||
"185": "Rain",
|
||||
"200": "Storm",
|
||||
"227": "Rain",
|
||||
"230": "Rain",
|
||||
"248": "Cloudy",
|
||||
"260": "Cloudy",
|
||||
"263": "Rain",
|
||||
"266": "Rain",
|
||||
"281": "Rain",
|
||||
"284": "Rain",
|
||||
"293": "Rain",
|
||||
"296": "Rain",
|
||||
"299": "Rain",
|
||||
"302": "Rain",
|
||||
"305": "Rain",
|
||||
"308": "Rain",
|
||||
"311": "Rain",
|
||||
"314": "Rain",
|
||||
"317": "Rain",
|
||||
"320": "Rain",
|
||||
"323": "Rain",
|
||||
"326": "Rain",
|
||||
"329": "Snow",
|
||||
"332": "Snow",
|
||||
"335": "Snow",
|
||||
"338": "Snow",
|
||||
"350": "Rain",
|
||||
"353": "Rain",
|
||||
"356": "Rain",
|
||||
"359": "Rain",
|
||||
"362": "Rain",
|
||||
"365": "Rain",
|
||||
"368": "Rain",
|
||||
"371": "Snow",
|
||||
"374": "Rain",
|
||||
"377": "Rain",
|
||||
"386": "Rain",
|
||||
"389": "Rain",
|
||||
"392": "Rain",
|
||||
"395": "Snow",
|
||||
}
|
||||
|
||||
data = {}
|
||||
|
||||
weather = request.get("https://wttr.in/?format=j1").json()
|
||||
|
||||
def format_time(time):
|
||||
return time.replace("00", "").zfill(2)
|
||||
|
||||
def format_temp(temp):
|
||||
return(temp["FeelsLikeC"] + "o").ljust(3)
|
||||
|
||||
def format_chances(hour):
|
||||
chances = {
|
||||
"chancesoffog": "Fog",
|
||||
"chancesoffrost": "Frost",
|
||||
"chancesofovercast": "Overcast",
|
||||
"chancesofrain": "Rain",
|
||||
"chancesofsnow": "Snow",
|
||||
"chancesofsunshine": "Sunshine",
|
||||
"chancesofthunder": "Thunder",
|
||||
"chancesofwindy": "Wind",
|
||||
}
|
||||
|
||||
conditions = []
|
||||
for event in chances.keys():
|
||||
if int(hour[event]) > 0:
|
||||
conditions.append(chances[event] + "" + hour[event] + "%")
|
||||
return ", ".join(conditions)
|
||||
|
||||
tempint = int(weather["current_condition"][0]["FeelsLikeC"])
|
||||
extrachar = ""
|
||||
if tempint > 0 and tempint < 10:
|
||||
extrachar = "+"
|
||||
|
||||
data["text"] = (
|
||||
" "
|
||||
+ WEATHER_CODES[weather["current_condition"][0]["weatherCode"]]
|
||||
+ " "
|
||||
+ extrachar
|
||||
+ weather["current_condition"][0]["FeelsLikeC"]
|
||||
+ "o"
|
||||
)
|
||||
|
||||
data["tooltip"] = (
|
||||
f"<b>{weather['current_condition'][0]['weatherDesc'][0]['value']} {weather['current_condition'][0]['temp_C']}o</b>\n"
|
||||
)
|
||||
data["tooltip"] += f"Feels like: {weather['current_condition'][0]['FeelsLikeC']}o\n"
|
||||
data["tooltip"] += f"Wind: {weather['current_condition'][0]['WindspeedKmph']}Km/h\n"
|
||||
data["tooltip"] += f"Humidity: {weather['current_condition'][0]['FeelsLikeC']}%\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"Up {day['maxtempC']}o Down {day['mintempC']}o "
|
||||
data["tooltip"] += f"Sunrise {day['astronomy'][0]['sunrise']} Sunset {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))
|
||||
149
home/config/waybar/style.css
Normal file
149
home/config/waybar/style.css
Normal file
@@ -0,0 +1,149 @@
|
||||
* {
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
font-family:
|
||||
JetBrains Mono Nerd Font,
|
||||
monospace;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
window#waybar {
|
||||
background: rgba(21, 18, 27, 0);
|
||||
color: #cdd6f4;
|
||||
}
|
||||
|
||||
tooltip {
|
||||
background: #1e1e2e;
|
||||
border-radius: 10px;
|
||||
border-width: 2px;
|
||||
border-style: solid;
|
||||
border-color: #11111b;
|
||||
}
|
||||
|
||||
#workspaces button {
|
||||
padding: 5px;
|
||||
color: #313244;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color: #a6adc8;
|
||||
}
|
||||
|
||||
#workspaces button.focused {
|
||||
color: #a6adc8;
|
||||
background: #eba0ac;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#workspaces button.urgent {
|
||||
color: #11111b;
|
||||
background: #a6e3a1;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#workspaces button.active {
|
||||
color: #11111b;
|
||||
background: #cdd6f4;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
#language,
|
||||
#custom-updates,
|
||||
#custom-caffeine,
|
||||
#custom-weather,
|
||||
#window,
|
||||
#clock,
|
||||
#battery,
|
||||
#pulseaudio,
|
||||
#network,
|
||||
#workspaces,
|
||||
#tray,
|
||||
#backlight {
|
||||
background: #1e1e2e;
|
||||
padding: 0px 10px;
|
||||
margin: 3px 0px;
|
||||
margin-top: 10px;
|
||||
border: 1px solid #181825;
|
||||
}
|
||||
|
||||
#tray {
|
||||
border-radius: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
#workspaces {
|
||||
background: #1e1e2e;
|
||||
border-radius: 10px;
|
||||
margin-left: 10px;
|
||||
padding-right: 0px;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
#custom-caffeine {
|
||||
color: #89dceb;
|
||||
border-radius: 10px 0 0 10px;
|
||||
border-right: 0;
|
||||
margin-left: 10px;
|
||||
}
|
||||
|
||||
#custom-language {
|
||||
color: #f38ba8;
|
||||
border-right: 0;
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
#custom-updates {
|
||||
color: #f5c2e7;
|
||||
border-radius: 10px 0 0 10px;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
#window {
|
||||
border-radius: 10px;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
#clock {
|
||||
color: #fab387;
|
||||
border-radius: 10px 0 0 10px;
|
||||
margin-left: 5px;
|
||||
border-right: 0px;
|
||||
}
|
||||
|
||||
#network {
|
||||
color: #f9e2af;
|
||||
border-left: 0px;
|
||||
border-right: 0px;
|
||||
}
|
||||
|
||||
#pulseaudio {
|
||||
color: #89b4fa;
|
||||
border-left: 0px;
|
||||
border-right: 0px;
|
||||
}
|
||||
|
||||
#pulseaudio.microphone {
|
||||
color: #cba6f7;
|
||||
border-radius: 0 10px 10px 0;
|
||||
border-left: 0;
|
||||
border-right: 0;
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#battery {
|
||||
color: #a6e3a1;
|
||||
border-radius: 0 10px 10px 0;
|
||||
margin-right: 10px;
|
||||
border-left: 0px;
|
||||
}
|
||||
|
||||
#custom-weather {
|
||||
border-radius: 0 10px 10px 0;
|
||||
border-right: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
Reference in New Issue
Block a user