Created
October 15, 2019 12:51
-
-
Save vcaen/d1dc737981ba50cb65e2ad6faf6912f5 to your computer and use it in GitHub Desktop.
Shell function to open a given url as a standalone window.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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