More formatting changes
This commit is contained in:
parent
5a65bbd4bc
commit
78ee5c087f
|
@ -202,12 +202,26 @@
|
|||
on-click = "makotoggle";
|
||||
};
|
||||
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=$(fastfetch -c all -s weather -l none | sed -E 's/Weather: ([^ ]+) - ([^ ]+ [^ ]+) (\(.*\))/\1\n\2\n\3/' | sed 's/^\+//')
|
||||
temp=$(echo "$fetch" | sed -n '1p')
|
||||
condition=$(echo "$fetch" | sed -n '2p')
|
||||
location=$(echo "$fetch" | sed -n '3p' | sed 's/[()]//g')
|
||||
fetch=$(fastfetch -c ${weatherConf})
|
||||
temp=$(echo "$fetch" | sed -n '2s/^\+//p')
|
||||
condition=$(echo "$fetch" | sed -n '3p')
|
||||
location=$(echo "$fetch" | sed -n '4p')
|
||||
|
||||
# Map weather conditions to emojis
|
||||
case "$condition" in
|
||||
|
|
|
@ -16,7 +16,7 @@ in {
|
|||
interfaces = {
|
||||
# Wireguard interface name can be arbitrary
|
||||
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" ];
|
||||
listenPort = 51820;
|
||||
privateKey = outputs.secrets.wireguardPriv;
|
||||
|
|
Loading…
Reference in a new issue