More formatting changes

This commit is contained in:
Jimbo 2024-09-13 21:31:17 -04:00
parent 5a65bbd4bc
commit 78ee5c087f
2 changed files with 20 additions and 6 deletions

View file

@ -202,12 +202,26 @@
on-click = "makotoggle"; on-click = "makotoggle";
}; };
weatherModule = { weatherModule = {
exec = pkgs.writeScript "weatherScript" '' exec = let
weatherConf = pkgs.writeText "weather.jsonc" ''
{
"logo": {
"source": "none"
},
"modules": [
{
"type": "weather",
"outputFormat": "%0A%t%0A%C%0A%l"
}
]
}
'';
in pkgs.writeScript "weatherScript" ''
# Fetch weather data # Fetch weather data
fetch=$(fastfetch -c all -s weather -l none | sed -E 's/Weather: ([^ ]+) - ([^ ]+ [^ ]+) (\(.*\))/\1\n\2\n\3/' | sed 's/^\+//') fetch=$(fastfetch -c ${weatherConf})
temp=$(echo "$fetch" | sed -n '1p') temp=$(echo "$fetch" | sed -n '2s/^\+//p')
condition=$(echo "$fetch" | sed -n '2p') condition=$(echo "$fetch" | sed -n '3p')
location=$(echo "$fetch" | sed -n '3p' | sed 's/[()]//g') location=$(echo "$fetch" | sed -n '4p')
# Map weather conditions to emojis # Map weather conditions to emojis
case "$condition" in case "$condition" in

View file

@ -16,7 +16,7 @@ in {
interfaces = { interfaces = {
# Wireguard interface name can be arbitrary # Wireguard interface name can be arbitrary
wg0 = { wg0 = {
# Determines the IP address and subnet of the server's end of the tunnel interface. # Determines the IP and subnet of the tunnel interface
ips = [ "${ips.wgSpan}.1/24" ]; ips = [ "${ips.wgSpan}.1/24" ];
listenPort = 51820; listenPort = 51820;
privateKey = outputs.secrets.wireguardPriv; privateKey = outputs.secrets.wireguardPriv;