mirror of
https://github.com/Nexoniarz/nexoniarz-config-nixos.git
synced 2026-11-03 04:24:27 +00:00
Display Settings: drag-to-arrange multi-monitor canvas with edge snapping (locked when only one screen is connected), 8/10-bit depth, color management presets (sRGB/Wide/EDID/HDR+EDID), SDR brightness/saturation, ICC profile path, VRR toggle. display-set now takes a single pre-built descriptor instead of a fixed positional arg list, since Hyprland's monitor keyword grew well past that. Wallpapers: fixed the current-wallpaper highlight never loading on open, added real first-frame thumbnails for animated wallpapers (wallpaper-thumbs + ffmpeg), bigger 2-column grid, filename filter. Booru: separate downloads folder from Wallpapers so browsing doesn't clutter the wallpaper picker, bigger grid, Safe/Moderate/Explicit rating tiers replacing the old binary toggle, sort order (Newest/ Score/Random). Fixed pagination being completely broken (a Flow anchor violation was silently disabling the whole layout) and Danbooru's Random sort (order:random tag times out server-side -- switched to their random=true endpoint for that case). Wi-Fi panel: added a "Scanning.../No networks found" state and a manual rescan button -- previously showed nothing either way, making "still scanning" indistinguishable from a real failure. Bluetooth: auto-scans on open like Wi-Fi now, instead of requiring a manual click every time. New: System Monitor panel (CPU/RAM/GPU/VRAM/disk usage, NVIDIA or AMD detected automatically) and Weather panel (IP-geolocated or a typed city, current + hourly forecast, Open-Meteo, no API key) with a compact taskbar badge.
32 lines
1.4 KiB
Shell
Executable file
32 lines
1.4 KiB
Shell
Executable file
#!/usr/bin/env bash
|
|
# Fetches current weather + a short hourly forecast from Open-Meteo (free,
|
|
# no API key/account needed) for either the machine's IP-geolocated
|
|
# position (default, via ip-api.com — also free/keyless) or an explicitly
|
|
# named city, and prints one combined JSON object.
|
|
set -euo pipefail
|
|
|
|
city="${1:-}"
|
|
|
|
if [ -n "$city" ]; then
|
|
encoded="$(jq -sRr @uri <<< "$city")"
|
|
geo="$(curl -s "https://geocoding-api.open-meteo.com/v1/search?count=1&name=$encoded")"
|
|
lat="$(jq -r '.results[0].latitude // empty' <<< "$geo")"
|
|
lon="$(jq -r '.results[0].longitude // empty' <<< "$geo")"
|
|
place="$(jq -r '.results[0].name // empty' <<< "$geo")"
|
|
country="$(jq -r '.results[0].country // empty' <<< "$geo")"
|
|
else
|
|
ipgeo="$(curl -s "http://ip-api.com/json/")"
|
|
lat="$(jq -r '.lat // empty' <<< "$ipgeo")"
|
|
lon="$(jq -r '.lon // empty' <<< "$ipgeo")"
|
|
place="$(jq -r '.city // empty' <<< "$ipgeo")"
|
|
country="$(jq -r '.country // empty' <<< "$ipgeo")"
|
|
fi
|
|
|
|
if [ -z "$lat" ] || [ -z "$lon" ]; then
|
|
echo '{"error":"location lookup failed"}'
|
|
exit 0
|
|
fi
|
|
|
|
weather="$(curl -s "https://api.open-meteo.com/v1/forecast?latitude=$lat&longitude=$lon¤t=temperature_2m,weather_code,wind_speed_10m,precipitation&hourly=temperature_2m,weather_code,precipitation_probability&timezone=auto&forecast_days=2")"
|
|
|
|
jq --arg place "$place" --arg country "$country" '. + {place: $place, country: $country}' <<< "$weather"
|