Add enable-scroll-now.sh

This commit is contained in:
2025-12-31 04:26:42 -08:00
parent ba6e102d9d
commit 8da7f25cec

30
enable-scroll-now.sh Normal file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
# Quick script to inject auto-scroll into running Firefox
# This uses xdotool to send keyboard commands
echo "Enabling auto-scroll on dashboard..."
echo ""
echo "This will try to open Firefox console and inject the scroll script."
echo ""
# Check if Firefox is running
if ! pgrep -u kyle firefox > /dev/null; then
echo "Firefox is not running. Starting dashboard..."
~/scripts/launch-dashboard.sh
sleep 5
fi
# The JavaScript to inject
JS_CODE='let c=Array.from(document.querySelectorAll("ha-card"));c.forEach(card=>card.style.minHeight=window.innerHeight+"px");let i=0;setInterval(()=>{i=(i+1)%c.length;c[i].scrollIntoView({behavior:"smooth",block:"start"})},5000);window.scrollTo({top:0,behavior:"smooth"});console.log("Auto-scroll enabled: "+c.length+" cards");'
echo "JavaScript code ready to inject:"
echo "$JS_CODE"
echo ""
echo "To inject manually:"
echo "1. If you have keyboard access, press F12 in Firefox"
echo "2. Go to Console tab"
echo "3. Paste the code above"
echo ""
echo "Or, if you can access the display, you can:"
echo " - Right-click > Inspect Element > Console"
echo " - Or use Alt key to show menu > Tools > Web Developer > Console"