add weather widget to waybar
This commit is contained in:
@@ -11,7 +11,7 @@
|
|||||||
"tooltip": false
|
"tooltip": false
|
||||||
},
|
},
|
||||||
"modules-center": ["clock"],
|
"modules-center": ["clock"],
|
||||||
"modules-right": ["custom/network", "cpu", "battery"],
|
"modules-right": ["custom/weather", "custom/network", "cpu", "battery"],
|
||||||
|
|
||||||
"niri/workspaces": {
|
"niri/workspaces": {
|
||||||
"disable-scroll": true
|
"disable-scroll": true
|
||||||
@@ -22,6 +22,13 @@
|
|||||||
"interval": 60
|
"interval": 60
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"custom/weather": {
|
||||||
|
"exec": "~/.local/bin/waybar-weather.sh",
|
||||||
|
"interval": 1800,
|
||||||
|
"format": "{}",
|
||||||
|
"tooltip": false
|
||||||
|
},
|
||||||
|
|
||||||
"custom/network": {
|
"custom/network": {
|
||||||
"exec": "~/.local/bin/waybar-network.sh",
|
"exec": "~/.local/bin/waybar-network.sh",
|
||||||
"interval": 2,
|
"interval": 2,
|
||||||
|
|||||||
@@ -41,6 +41,11 @@ window#waybar {
|
|||||||
color: #f3eeea;
|
color: #f3eeea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#custom-weather {
|
||||||
|
color: #f3eeea;
|
||||||
|
padding: 0 8px;
|
||||||
|
}
|
||||||
|
|
||||||
#custom-network {
|
#custom-network {
|
||||||
color: #f3eeea;
|
color: #f3eeea;
|
||||||
padding: 0 8px;
|
padding: 0 8px;
|
||||||
|
|||||||
Executable
+7
@@ -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
|
||||||
@@ -259,6 +259,10 @@
|
|||||||
source = ./config/waybar/network.sh;
|
source = ./config/waybar/network.sh;
|
||||||
executable = true;
|
executable = true;
|
||||||
};
|
};
|
||||||
|
home.file.".local/bin/waybar-weather.sh" = {
|
||||||
|
source = ./config/waybar/weather.sh;
|
||||||
|
executable = true;
|
||||||
|
};
|
||||||
xdg.configFile."waybar".source = ./config/waybar;
|
xdg.configFile."waybar".source = ./config/waybar;
|
||||||
xdg.configFile."foot".source = ./config/foot;
|
xdg.configFile."foot".source = ./config/foot;
|
||||||
xdg.dataFile."applications/switch-wallpaper.desktop".source = ./config/applications/switch-wallpaper.desktop;
|
xdg.dataFile."applications/switch-wallpaper.desktop".source = ./config/applications/switch-wallpaper.desktop;
|
||||||
|
|||||||
Reference in New Issue
Block a user