From 350c50558bd6fa6025562b5524d55d0f025a4aa3 Mon Sep 17 00:00:00 2001 From: Florent Destremau Date: Thu, 13 Nov 2025 11:34:03 +0100 Subject: [PATCH] Add default Profile for web apps When using multiple google chrome accounts (work, personal for instance), you usually have a default one for some webapps (like youtube or chat gpt). This allows you to force it. --- defaults/bash/functions | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/defaults/bash/functions b/defaults/bash/functions index a3bf5ee2b..ae67fffb7 100644 --- a/defaults/bash/functions +++ b/defaults/bash/functions @@ -24,14 +24,15 @@ iso2sd() { # Create a desktop launcher for a web app web2app() { - if [ "$#" -ne 3 ]; then - echo "Usage: web2app (IconURL must be in PNG -- use https://dashboardicons.com)" + if [ "$#" -lt 3 ] || [ "$#" -gt 4 ]; then + echo "Usage: web2app (IconURL must be in PNG -- use https://dashboardicons.com) (Profile should be one of Default, Profile 1, Profile 2, etc.)" return 1 fi local APP_NAME="$1" local APP_URL="$2" local ICON_URL="$3" + local PROFILE="$4" local ICON_DIR="$HOME/.local/share/applications/icons" local DESKTOP_FILE="$HOME/.local/share/applications/${APP_NAME}.desktop" local ICON_PATH="${ICON_DIR}/${APP_NAME}.png" @@ -43,12 +44,17 @@ web2app() { return 1 fi + local CHROME_CMD="google-chrome --app=\"$APP_URL\" --name=\"$APP_NAME\" --class=\"$APP_NAME\" --window-size=800,600" + if [ -n "$PROFILE" ]; then + CHROME_CMD="$CHROME_CMD --profile-directory=\"$PROFILE\"" + fi + cat > "$DESKTOP_FILE" <