grafana / grafana-kiosk

Kiosk Utility for Grafana
Apache License 2.0
374 stars 60 forks source link

Support for Firefox #13

Open Bruce17 opened 5 years ago

Bruce17 commented 5 years ago

Hi,

I'm using openSUSE/SLES as OS on top of RPI 3b+. It is impossible to get Chromium up and running due to all its dependencies.

Firefox is installed by default. Can you provide for Firefox as well?

GeertJohan commented 5 years ago

I think this is highly unlikely to happen as this tool uses chromedp, the chromium devtools protocol. It allows grafana-kiosk to control chromium via an API. chromedp doesn't support firefox (or: firefox doesn't support the chromium devtools protocol) See https://github.com/chromedp/chromedp/issues/470

briangann commented 4 years ago

If there's an equivalent sdk for firefox I'd be happy to implement.

briangann commented 4 years ago

this may be an option: https://agouti.org/#reference

briangann commented 1 year ago

would like to explore this a bit more, there could be equivalent sdk/api calls now for firefox

JayceeZ commented 1 month ago

You could use Cypress to get Firefox control

Or you open multiple Firefox instances and shift like I did between the grafana dashboard and my chromium

Here is my .xinitrc if it could help

#!/usr/bin/env sh

# Log file location (you can customize the file path)
LOGFILE="$HOME/.xinitrc.log"

# Redirect both stdout and stderr to the log file
exec > "$LOGFILE" 2>&1

xset -dpms
xset s off
xset s noblank

xdotool mousemove 0 0

unclutter &
/usr/bin/grafana-kiosk \
  -URL="$GRAFANA_DASHBOARD_URL?autofitpanels&_dash.hideTimePicker&_dash.hideVariables&_dash.hideLinks&from=now-6h&to=now&var-Cluster=$__all" \
  -login-method=gcom \
  -username=$GRAFANA_USER -password=$GRAFANA_PASSWORD \
  -kiosk-mode=full -autofit \
  -window-size=1920,1080 &

# Allow Grafana Kiosk Login
sleep 30

chromium-browser $KIOSKED_WEBSITE \
  --enable-features=OverlayScrollbar,OverlayScrollbarFlashAfterAnyScrollUpdate,OverlayScrollbarFlashWhenMouseEnter \
  --window-size=1920,1080 \
  --window-position=0,0 \
  --start-fullscreen \
  --kiosk \
  --noerrdialogs \
  --disable-translate \
  --no-first-run \
  --fast \
  --fast-start \
  --disable-infobars \
  --disable-features=TranslateUI \
  --disk-cache-dir=/dev/null \
  --overscroll-history-navigation=0 \
  --check-for-update-interval=31536000 \
  --disable-pinch --force-dark-mode &

# Allow some time for programs to start
sleep 10

# Get the window ID of the Chromium window (adjust the search term if necessary)
WINDOWS=$(xdotool search --onlyvisible --name .)

echo $WINDOWS
xdotool key Return

# Loop through the windows and raise each one every 15 seconds
while true; do
  for WINDOW in $WINDOWS; do
    # Raise the window
    xdotool windowraise $WINDOW

    # Optionally, simulate an ENTER key press in the window (uncomment if needed)
    # xdotool key --window $WINDOW Return

    # Wait before switching to the next window
    sleep 15
  done
done