Skip to content

Instantly share code, notes, and snippets.

@vcaen
Created October 15, 2019 12:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vcaen/d1dc737981ba50cb65e2ad6faf6912f5 to your computer and use it in GitHub Desktop.
Save vcaen/d1dc737981ba50cb65e2ad6faf6912f5 to your computer and use it in GitHub Desktop.
Shell function to open a given url as a standalone window.
#!/bin/sh
# Open the url given as a parameter as a standalone window of Google Chrome
function app () {
local profile=""
local protocol=""
if [[ $1 != *"://"* ]]; then
protocol="https://"
fi
if [ -n "$2" ] ; then
echo "Opening profile $2"
profile="--profile-directory=$2"
fi
google-chrome --app=$(echo "$protocol$1") "$profile";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment