Custom Weather Script for Waybar with IP Geolocation, Custom Locations, Default Locations and many more things.
It got out of the original scope the more I worked on it xd.
> wayweather [-h/--help] [OPTIONS]
Weather script for Waybar with IP Geolocation
HELP:
-h, --help Print main help information
-v, --version Prints the version
<OPTION> -h, --help Print help information about
an option
Example: > wayweather --get --help
OPTIONS:
-g, --get [--no-icon] Pring waybar json input
-s, --set <ARGS> Set custom location and
print waybar json input
-r, --reset [--units] Reset custom location to
IP geolocation
-p, --print [--no-icon] Print waybar result to stdout
-l, --load [OPTIONS] Select locations from saved ones
--list List saved locations
-sd, --set-default Set default location for faster
loading
-d, --delete [OPTIONS] Delete locations from saved ones
-w, --daemon [OPTIONS] Runs a loop for checking config
changes prints waybar json when
a change occurs
For more information, go over to the Wiki
Required Packages:
- bash
- curl
- awk
- jq
- tombl
- font from nerdfonts or a patched font
- Cloning
- Clone the repo via
git clone https://github.com/TheElevatedOne/wayweather.git - Use the script in that directory
- Clone the repo via
- AUR
- wayweather
yay -S wayweather,paru -S wayweather, etc.
-
Using static loading
-
-
Using wayweather Daemon
-
"custom/wayweather": { "format": "{text}", "exec": "path/to/wayweather --daemon", "return-type": "json", "restart-interval": 5 },
-
The configuration file is at $HOME/.config/wayweather/config.toml
and will be created on first run.
# WayWeather config
# ip_loc enables/disables autolocation through ip address
# latitide, longitude, city and country must be set when ip_loc is false
# units can be either "imp" or "met" (imperial and metric)
[wayweather]
ip_loc = false
latitude = 40.71
longitude = -74.01
city = "New York"
country = "USA"
units = "met"
- ip_loc - can be
trueorfalse, when setting location with--setit auto-disables itself - latitide & longitude - numbers in decimal coordinate format rounded to two digits
- get them from https://www.gps-coordinates.net/ (ex.)
- city - city name
- country - country name
- units - either
metorimpfor metric and imperialmet- °C, mm, km/himp- °F, inch, mph
The saved locations are at $HOME/.config/wayweather/locations.json
and will be created when saving locations.
{
"0": {
"latitude": 40.71,
"longitude": -74.01,
"city": "New York",
"country": "USA",
"units": "imp",
"default": false
},
"1": {
...
},
...
}- has a similar structure to the config but supports saviing multiple locations
- also supports setting a default location