Skip to content

Instantly share code, notes, and snippets.

@AntonFriberg
Last active May 22, 2023 21:36
Show Gist options
  • Save AntonFriberg/02f528299fd7591e87eb92236c4dfd3e to your computer and use it in GitHub Desktop.
Save AntonFriberg/02f528299fd7591e87eb92236c4dfd3e to your computer and use it in GitHub Desktop.
Two Chrome Kiosk Screens Autodeployed on Debian Gnome
#!/bin/bash
APP1=https://google.com
APP1NAME=Google
APP2=https://bing.com
APP2NAME=Bing
# Set correct display to launch the windows over ssh connection
export DISPLAY=:0
# Fixes autologin errors under gnome
export $(dbus-launch)
# Start the first window
google-chrome --window-size=1920,1080 --kiosk --user-data-dir=/home/$USER/.chrome1 --password-store=basic --no-default-browser-check --incognito --noerrdialogs --disable --disable-suggestions-ui --no-first-run --disable-popup-blocking --disable-infobars $APP1 &
sleep 5
# Start the second window
google-chrome --window-size=1920,1080 --kiosk --user-data-dir=/home/$USER/.chrome2 --password-store=basic --no-default-browser-check --incognito --noerrdialogs --disable --disable-suggestions-ui --no-first-run --disable-popup-blocking --disable-infobars $APP2 &
sleep 5
# Wait until the google website has loaded
until wmctrl -l | grep -i $APP1NAME > /dev/null;
do
sleep 1
done
# Move the google window to correct possition on screen
wmctrl -r '$APP1NAME' -e '0,3840,0,1920,1080'
# Wait until the bing website has loaded
until wmctrl -l | grep -i $APP2NAME > /dev/null;
do
sleep 1
done
# Move the
wmctrl -r '$APP2NAME' -e '0,0,0,1920,1080'
# Focus the windows
wmctrl -a $APP1NAME
wmctrl -a $APP2NAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment