Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jackbdu/80efebe1b4e4fd10286baece2ca6a61f to your computer and use it in GitHub Desktop.

Select an option

Save jackbdu/80efebe1b4e4fd10286baece2ca6a61f to your computer and use it in GitHub Desktop.
Shell script launching Google Chrome with a specified URL
  1. Create a plain text file named click_me_to_start (make sure not to include any extension, as it may cause issue in starting up the script in macOS) and paste below text (remember modify your url accordingly):
#!/bin/bash

# Specify the URL you want to open in kiosk mode
url="https://example.com"

# Check if Google Chrome is installed
if [ -e "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" ]; then
  # Start Chrome in kiosk mode with the specified URL
  "/Applications/Google Chrome.app/Contents/MacOS/Google Chrome" --kiosk "$url"
else
  echo "Google Chrome is not installed. Please install Chrome and try again."
fi
  1. Make sure to run below script in terminal to make your script executable
chmod +x click_me_to_start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment