add weather widget to waybar

This commit is contained in:
2026-06-19 10:29:09 +02:00
parent 976d383968
commit 3eb2c829cd
4 changed files with 24 additions and 1 deletions
+8 -1
View File
@@ -11,7 +11,7 @@
"tooltip": false
},
"modules-center": ["clock"],
"modules-right": ["custom/network", "cpu", "battery"],
"modules-right": ["custom/weather", "custom/network", "cpu", "battery"],
"niri/workspaces": {
"disable-scroll": true
@@ -22,6 +22,13 @@
"interval": 60
},
"custom/weather": {
"exec": "~/.local/bin/waybar-weather.sh",
"interval": 1800,
"format": "{}",
"tooltip": false
},
"custom/network": {
"exec": "~/.local/bin/waybar-network.sh",
"interval": 2,
+5
View File
@@ -41,6 +41,11 @@ window#waybar {
color: #f3eeea;
}
#custom-weather {
color: #f3eeea;
padding: 0 8px;
}
#custom-network {
color: #f3eeea;
padding: 0 8px;
+7
View File
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
result=$(curl -sf --max-time 10 "wttr.in/?format=%c+%t")
if [ $? -eq 0 ] && [ -n "$result" ]; then
echo "$result"
else
echo "N/A"
fi
+4
View File
@@ -259,6 +259,10 @@
source = ./config/waybar/network.sh;
executable = true;
};
home.file.".local/bin/waybar-weather.sh" = {
source = ./config/waybar/weather.sh;
executable = true;
};
xdg.configFile."waybar".source = ./config/waybar;
xdg.configFile."foot".source = ./config/foot;
xdg.dataFile."applications/switch-wallpaper.desktop".source = ./config/applications/switch-wallpaper.desktop;