weather and update system script

This commit is contained in:
wt committed 2024-09-04 16:15:34 +07:00
1 parent 0de5a828a0
commit c713f2b119
6 files changed
+354 -3

No files matched your search

View File
Whitespace-only changes.
+261
View File
@@ -0,0 +1,261 @@
{
"lat": "56.49771N",
"lon": "84.97437E",
"elevation": 117,
"timezone": "Asia/Tomsk",
"units": "metric",
"current": {
"icon": "overcast",
"icon_num": 7,
"summary": "Overcast",
"temperature": 12.5,
"wind": { "speed": 3.8, "angle": 55, "dir": "NE" },
"precipitation": { "total": 0.0, "type": "none" },
"cloud_cover": 96
},
"hourly": {
"data": [
{
"date": "2024-09-04T15:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 12.5,
"wind": { "speed": 3.8, "dir": "NE", "angle": 55 },
"cloud_cover": { "total": 96 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-04T16:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 12.8,
"wind": { "speed": 3.6, "dir": "ENE", "angle": 58 },
"cloud_cover": { "total": 96 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-04T17:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 12.0,
"wind": { "speed": 3.3, "dir": "ENE", "angle": 57 },
"cloud_cover": { "total": 97 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-04T18:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 11.5,
"wind": { "speed": 3.1, "dir": "NE", "angle": 50 },
"cloud_cover": { "total": 93 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-04T19:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 11.2,
"wind": { "speed": 2.9, "dir": "NE", "angle": 42 },
"cloud_cover": { "total": 94 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-04T20:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 10.8,
"wind": { "speed": 2.5, "dir": "NE", "angle": 40 },
"cloud_cover": { "total": 95 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-04T21:00:00",
"weather": "cloudy",
"icon": 30,
"summary": "Cloudy",
"temperature": 10.0,
"wind": { "speed": 2.4, "dir": "NE", "angle": 34 },
"cloud_cover": { "total": 88 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-04T22:00:00",
"weather": "mostly_cloudy",
"icon": 29,
"summary": "Mostly cloudy",
"temperature": 9.5,
"wind": { "speed": 2.6, "dir": "NNE", "angle": 33 },
"cloud_cover": { "total": 75 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-04T23:00:00",
"weather": "mostly_cloudy",
"icon": 29,
"summary": "Mostly cloudy",
"temperature": 9.0,
"wind": { "speed": 2.9, "dir": "NE", "angle": 39 },
"cloud_cover": { "total": 73 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T00:00:00",
"weather": "mostly_cloudy",
"icon": 29,
"summary": "Mostly cloudy",
"temperature": 8.5,
"wind": { "speed": 2.8, "dir": "NE", "angle": 46 },
"cloud_cover": { "total": 76 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T01:00:00",
"weather": "mostly_cloudy",
"icon": 29,
"summary": "Mostly cloudy",
"temperature": 8.2,
"wind": { "speed": 3.1, "dir": "NE", "angle": 48 },
"cloud_cover": { "total": 80 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T02:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 7.8,
"wind": { "speed": 2.8, "dir": "NE", "angle": 45 },
"cloud_cover": { "total": 91 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T03:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 7.5,
"wind": { "speed": 2.9, "dir": "NE", "angle": 43 },
"cloud_cover": { "total": 94 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T04:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 7.2,
"wind": { "speed": 2.9, "dir": "NE", "angle": 39 },
"cloud_cover": { "total": 94 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T05:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 7.0,
"wind": { "speed": 2.8, "dir": "NE", "angle": 37 },
"cloud_cover": { "total": 95 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T06:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 7.0,
"wind": { "speed": 3.1, "dir": "NE", "angle": 47 },
"cloud_cover": { "total": 99 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T07:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 7.0,
"wind": { "speed": 3.4, "dir": "NE", "angle": 42 },
"cloud_cover": { "total": 95 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T08:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 7.5,
"wind": { "speed": 3.8, "dir": "NE", "angle": 43 },
"cloud_cover": { "total": 93 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T09:00:00",
"weather": "cloudy",
"icon": 6,
"summary": "Cloudy",
"temperature": 8.5,
"wind": { "speed": 3.8, "dir": "NE", "angle": 49 },
"cloud_cover": { "total": 90 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T10:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 9.8,
"wind": { "speed": 4.0, "dir": "NE", "angle": 55 },
"cloud_cover": { "total": 91 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T11:00:00",
"weather": "cloudy",
"icon": 6,
"summary": "Cloudy",
"temperature": 11.2,
"wind": { "speed": 4.5, "dir": "ENE", "angle": 58 },
"cloud_cover": { "total": 86 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T12:00:00",
"weather": "cloudy",
"icon": 6,
"summary": "Cloudy",
"temperature": 11.2,
"wind": { "speed": 4.4, "dir": "NE", "angle": 54 },
"cloud_cover": { "total": 83 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T13:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 12.2,
"wind": { "speed": 4.4, "dir": "NE", "angle": 51 },
"cloud_cover": { "total": 93 },
"precipitation": { "total": 0.0, "type": "none" }
},
{
"date": "2024-09-05T14:00:00",
"weather": "overcast",
"icon": 7,
"summary": "Overcast",
"temperature": 13.0,
"wind": { "speed": 4.1, "dir": "NE", "angle": 53 },
"cloud_cover": { "total": 100 },
"precipitation": { "total": 0.0, "type": "none" }
}
]
},
"daily": null
}
+82
View File
@@ -0,0 +1,82 @@
#!/bin/sh
#--- reset colors ---
RESET="\033[0m"
#--------------------
#--------- regularcolrs ---------
GREEN="\033[0;32m" #GREEN
BLUE="\033[0;34m" #BLUE
YELLOW="\033[1;33m" #YELLOW
RED="\033[0;31m" #RED
BLACK="\033[0;30m" #BLACK
PURPLE="\033[0;35m" #PURPLE
CYAN="\033[0;36m" #CYAN
WHITE="\033[0;37m" #WHITE
#--------------------------------
#-------- bold ------------------
BBLACK="\033[1;30m" #BLACK
BRED="\033[1;31m" #RED
BGREEN="\033[1;32m" #GREEN
BYELLOW="\033[1;33m" #YELLOW
BBLUE="\033[1;34m" #BLUE
BPURPLE="\033[1;35m" #PURPLE
BCYAN="\033[1;36m" #CYAN
BWHITE="\033[1;37m" #WHITE
#--------------------------------
#-------- Underline -------------
UBLACK="\033[4;30m" #BLACK
URED="\033[4;31m" #RED
UGREEN="\033[4;32m" #GREEN
UYELLOW="\033[4;33m" #YELLOW
UBLUE="\033[4;34m" #BLUE
UPURPLE="\033[4;35m" #PURPLE
UCYAN="\033[4;36m" #CYAN
UWHITE="\033[4;37m" #WHITE
#--------------------------------
#--------- Background -----------
ON_BLACK="\033[40m" #BLACK
ON_RED="\033[41m" #RED
ON_GREEN="\033[42m" #GREEN
ON_YELLOW="\033[43m" #YELLOW
ON_BLUE="\033[44m" #BLUE
ON_PURPLE="\033[45m" #PURPLE
ON_CYAN="\033[46m" #CYAN
ON_WHITE="\033[47m" #WHITE
#--------------------------------
#------ HighIntensity -----------
IBLACK="\033[0;90m" #BLACK
IRED="\033[0;91m" #RED
IGREEN="\033[0;92m" #GREEN
IYELLOW="\033[0;93m" #YELLOW
IBLUE="\033[0;94m" #BLUE
IPURPLE="\033[0;95m" #PURPLE
ICYAN="\033[0;96m" #CYAN
IWHITE="\033[0;97m" #WHITE
#--------------------------------
#------ BoldHighIntensity -------
BIBLACK="\033[1;90m" #BLACK
BIRED="\033[1;91m" #RED
BIGREEN="\033[1;92m" #GREEN
BIYELLOW="\033[1;93m" #YELLOW
BIBLUE="\033[1;94m" #BLUE
BIPURPLE="\033[1;95m" #PURPLE
BICYAN="\033[1;96m" #CYAN
BIWHITE="\033[1;97m" #WHITE
#--------------------------------
#--- HighIntensitybackgrounds ---
ON_IBLACK="\033[0;100m" #BLACK
ON_IRED="\033[0;101m" #RED
ON_IGREEN="\033[0;102m" #GREEN
ON_IYELLOW="\033[0;103m" #YELLOW
ON_IBLUE="\033[0;104m" #BLUE
ON_IPURPLE="\033[0;105m" #PURPLE
ON_ICYAN="\033[0;106m" #CYAN
ON_IWHITE="\033[0;107m" #WHITE
#--------------------------------
+5
View File
@@ -0,0 +1,5 @@
#!/bin/sh
. ~/dotfiles/hypr/bin/colors.sh
kitty -e /bin/sh -c "printf '$BLUE==>$UGREEN Starting update system packages $BLUE<==$RESET\n'; sudo pacman -Syu; printf '$BLUE==>$UGREEN Successfull $BLUE<==$RESET\n';sleep 10;"
+1
View File
@@ -22,6 +22,7 @@ bind = $mainMod, E, exec, $emojipicker
bind = $mainMod, M, exec, ~/dotfiles/ags/media/toggle_media
bind = $mainMod, Z, exec, swaync-client -t
bind = $mainMod SHIFT, R, exec, swaync-client -R
bind = $mainMod, U, exec, ~/dotfiles/hypr/bin/startupdate.sh
#---------------------------------------------------
#-------------- windows --------------------------
+5 -3
View File
@@ -137,14 +137,15 @@
"tooltip": true,
"interval": 900,
"exec": "wttrbar --location tomsk",
"return-type": "json"
"return-type": "json",
"on-click": "ags -c ~/dotfiles/ags/weather/config.js"
},
"custom/pacman": {
"format": "{} ",
"interval": 3600, // every hour
"exec": "checkupdates | wc -l", // # of updates
"exec-if": "exit 0", // always run; consider advanced run conditions
"on-click": "termite -e 'sudo pacman -Syu'; pkill -SIGRTMIN+8 waybar", // update system
"on-click": "echo click", // update system
"signal": 8
},
"custom/updates": {
@@ -154,12 +155,13 @@
"has-updates": "󱍷",
"updated": "󰂪"
},
"on-click": "~/dotfiles/hypr/bin/startupdate.sh",
"exec-if": "which waybar-module-pacman-updates",
"exec": "waybar-module-pacman-updates --interval-seconds 5 --network-interval-seconds 300"
},
"custom/onscreenkeyboard": {
"format": " ",
"on-click": "~/dotfiles/toggle_keyboard.sh"
"on-click": "~/dotfiles/hypr/bin/toggle_keyboard.sh"
},
"bluetooth": {
"format": " {status}",