Hyprland dotfiles
| 1 | #!/usr/bin/env python3 |
| 2 | # /* ---- ๐ซ https://github.com/JaKooLit ๐ซ ---- */ # |
| 3 | # original code https://gist.github.com/Surendrajat/ff3876fd2166dd86fb71180f4e9342d7 |
| 4 | # weather using python |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | # install using `pip install pyquery` |
| 10 | |
| 11 | # weather icons |
| 12 | = |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | |
| 25 | |
| 26 | # Get current location based on IP address |
| 27 | |
| 28 | = |
| 29 | = |
| 30 | = |
| 31 | return , |
| 32 | |
| 33 | |
| 34 | # Get latitude and longitude |
| 35 | , = |
| 36 | |
| 37 | # Open-Meteo API endpoint |
| 38 | = f |
| 39 | |
| 40 | # manual location_id |
| 41 | # NOTE: if you want to add manually, make sure you disable def get_location above |
| 42 | # to get your own location_id, go to https://weather.com & search your location. |
| 43 | # once you choose your location, you can see the location_id in the URL(64 chars long hex string) |
| 44 | # like this: https://weather.com/en-PH/weather/today/l/bca47d1099e762a012b9a139c36f30a0b1e647f69c0c4ac28b537e7ae9c1c200 |
| 45 | # location_id = "bca47d1099e762a012b9a139c36f30a0b1e647f69c0c4ac28b537e7ae9c1c200" # TODO |
| 46 | |
| 47 | # NOTE to change to deg F, change the URL to your preffered location after weather.com |
| 48 | # Default is English-Philippines with Busan, South Korea as location_id |
| 49 | # get html page |
| 50 | # url = "https://weather.com/en-PH/weather/today/l/" + location_id |
| 51 | |
| 52 | = |
| 53 | |
| 54 | # current temperature |
| 55 | = |
| 56 | |
| 57 | # current status phrase |
| 58 | = |
| 59 | = f |
| 60 | |
| 61 | # status code |
| 62 | = |
| 63 | |
| 64 | # status icon |
| 65 | = |
| 66 | |
| 67 | |
| 68 | |
| 69 | |
| 70 | |
| 71 | # temperature feels like |
| 72 | = |
| 73 | |
| 74 | |
| 75 | = f |
| 76 | |
| 77 | # min-max temperature |
| 78 | = |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | = |
| 84 | |
| 85 | |
| 86 | |
| 87 | |
| 88 | = f |
| 89 | |
| 90 | # wind speed |
| 91 | = |
| 92 | = f |
| 93 | |
| 94 | # humidity |
| 95 | = |
| 96 | = f |
| 97 | |
| 98 | # visibility |
| 99 | = |
| 100 | = f |
| 101 | |
| 102 | # air quality index |
| 103 | = |
| 104 | |
| 105 | # hourly rain prediction |
| 106 | = |
| 107 | |
| 108 | |
| 109 | = |
| 110 | = f |
| 111 | |
| 112 | # tooltip text |
| 113 | = |
| 114 | |
| 115 | |
| 116 | |
| 117 | |
| 118 | |
| 119 | |
| 120 | |
| 121 | |
| 122 | |
| 123 | |
| 124 | |
| 125 | # print waybar module data |
| 126 | = |
| 127 | |
| 128 | |
| 129 | |
| 130 | |
| 131 | |
| 132 | |
| 133 | |
| 134 | = |
| 135 | |
| 136 | |
| 137 | |
| 138 | |
| 139 | |
| 140 | |
| 141 | |
| 142 | |
| 143 | |
| 144 | |
| 145 | |
| 146 |