commit a93516c1a9685b76e3280df10df6be76e04f6f28
parent ed722d2ad4a6fdfcfbaf26e62312ba1dc8eb67e2
Author: regexghost <dev@regexghost.com>
Date: Sun, 21 Jun 2026 14:39:16 +0100
added check for waiting streams in stream-check.sh, metoffice.sh fixes
Diffstat:
4 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/panel-scripts/lemonbar-bar.sh b/panel-scripts/lemonbar-bar.sh
@@ -88,6 +88,8 @@ stream_live () {
live="$(stream-check -yn "$streamer_name")"
if [ "$live" = "y" ]; then
echo "${first_char} ${stream_live_colour} ${COLOUR_RESET}"
+ elif [ "$live" = "w" ]; then
+ echo "${first_char} ${stream_not_live_colour} ${COLOUR_RESET}"
elif [ "$live" = "n" ]; then
echo "${first_char} ${stream_not_live_colour} ${COLOUR_RESET}"
else
@@ -134,6 +136,7 @@ update_music () {
#
#
#
+#
#
#
#
diff --git a/panel-scripts/metoffice.sh b/panel-scripts/metoffice.sh
@@ -16,8 +16,8 @@ second_day_string="$(date -d $(($(date +%s)+86400+86400)) "+%Y-%m-%d")"
curl --connect-timeout 5 -s -L "https://weather.metoffice.gov.uk/forecast/$geohash" > "/tmp/panel_i3_data/metoffice.html"
# awk instead of grep -A/-B - https://superuser.com/questions/298123/how-to-grep-and-print-the-next-n-lines-after-the-hit/298127#298127
icon_name_today=$(awk -v var="$today_string" '$0 ~ "datetime=\"" var "\"" {p = 5} p > 0 {print $0; p--}' "/tmp/panel_i3_data/metoffice.html" | grep "class=\"tab-icon\"" | sed 's/;" class.*//g' | sed 's/.*alt="//g')
-icon_name_tomorrow=$(awk -v var="$today_string" '$0 ~ "datetime=\"" var "\"" {p = 5} p > 0 {print $0; p--}' "/tmp/panel_i3_data/metoffice.html" | grep "class=\"tab-icon\"" | sed 's/;" class.*//g' | sed 's/.*alt="//g')
-icon_name_second_day=$(awk -v var="$today_string" '$0 ~ "datetime=\"" var "\"" {p = 5} p > 0 {print $0; p--}' "/tmp/panel_i3_data/metoffice.html" | grep "class=\"tab-icon\"" | sed 's/;" class.*//g' | sed 's/.*alt="//g')
+icon_name_tomorrow=$(awk -v var="$tomorrow_string" '$0 ~ "datetime=\"" var "\"" {p = 5} p > 0 {print $0; p--}' "/tmp/panel_i3_data/metoffice.html" | grep "class=\"tab-icon\"" | sed 's/;" class.*//g' | sed 's/.*alt="//g')
+icon_name_second_day=$(awk -v var="$second_day_string" '$0 ~ "datetime=\"" var "\"" {p = 5} p > 0 {print $0; p--}' "/tmp/panel_i3_data/metoffice.html" | grep "class=\"tab-icon\"" | sed 's/;" class.*//g' | sed 's/.*alt="//g')
echo "$icon_name_today"
echo "$icon_name_tomorrow"
diff --git a/terminal-scripts/stream-check.sh b/terminal-scripts/stream-check.sh
@@ -25,8 +25,15 @@ if ! [ "$twitch_at" = "NONE" ]; then
fi
fi
if ! [ "$youtube_at" = "NONE" ]; then
- curl --connect-timeout 5 -s "https://www.youtube.com/${youtube_at}/live" > /tmp/live_youtube.html
- if grep -q "isLive\":true" /tmp/live_youtube.html; then
+ curl --connect-timeout 5 -s "https://www.youtube.com/${youtube_at}/live" > /tmp/live_youtube.html
+ if grep -q "isUpcoming\":true" /tmp/live_youtube.html; then
+ if [ "$format" = "pretty" ]; then
+ echo "${name} is about to go live on YouTube: https://www.youtube.com/${youtube_at}/live"
+ elif [ "$format" = "yn" ]; then
+ echo "w"
+ exit
+ fi
+ elif grep -q "isLive\":true" /tmp/live_youtube.html; then
if [ "$format" = "pretty" ]; then
echo "${name} is live on YouTube: https://www.youtube.com/${youtube_at}/live"
elif [ "$format" = "yn" ]; then
diff --git a/wm-scripts/jwm-scratchpad.sh b/wm-scripts/jwm-scratchpad.sh
@@ -13,13 +13,13 @@ launch_window () {
hide_window () {
xdotool windowmove "$scratchpad" -1000 -1000
- xdotool windowactivate "$old_focus"
+# xdotool windowactivate "$old_focus"
# xdotool set_desktop_for_window "$scratchpad" 5
-# xdotool windowminimize "$scratchpad"
+ xdotool windowminimize "$scratchpad"
}
show_window () {
- xdotool getactivewindow > ~/.cache/old_window
+# xdotool getactivewindow > ~/.cache/old_window
desktop="$(xdotool get_desktop)"
xdotool set_desktop_for_window "$scratchpad" "$desktop"
xdotool windowactivate "$scratchpad"