Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions bin/omarchy-webapp-install
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

new names

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct profile names.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feature is exactly what i'm waiting for, thanks so much for your work

Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,26 @@ if [[ -z "$APP_NAME" || -z "$APP_URL" || -z "$ICON_URL" ]]; then
fi

PROFILE_DIR="$HOME/.config/chromium/"
declare -A PROFILE_MAP
PROFILES=()
for p in "$PROFILE_DIR"/Default "$PROFILE_DIR"/Profile*; do
if [ -d "$p" ]; then
PROFILES+=("$(basename "$p")")
fi
done

while IFS= read -r line; do
folder=$(echo "$line" | cut -d'|' -f1)
name=$(echo "$line" | cut -d'|' -f2)
PROFILES+=("$name")
PROFILE_MAP["$name"]="$folder"
done < <(
jq -r '.profile.info_cache | to_entries[] | "\(.key)|\(.value.name)"' "$PROFILE_DIR/Local State"
)

if [ ${#PROFILES[@]} -eq 1 ]; then
APP_PROFILES="${PROFILES[0]}"
APP_PROFILE_NAME="${PROFILES[0]}"
else
APP_PROFILES=$(gum choose --header "Select browser profile" "${PROFILES[@]}")
APP_PROFILE_NAME=$(gum choose --header "Select browser profile" "${PROFILES[@]}")
fi

APP_PROFILES="${PROFILE_MAP[$APP_PROFILE_NAME]}"

ICON_DIR="$HOME/.local/share/applications/icons"
DESKTOP_FILE="$HOME/.local/share/applications/$APP_NAME.desktop"
ICON_PATH="$ICON_DIR/$APP_NAME.png"
Expand Down