#!/bin/sh profiles=$(ls ~/.config/BraveSoftware/Brave-Browser/ | grep Profile) choices="" IFS=" " for profile in $profiles; do name_of_profile=$(cat ~/.config/BraveSoftware/Brave-Browser/$profile/Preferences | jq .profile.name -r) choices=$(printf "%s:%s|%s" "$name_of_profile" "$profile" "$choices") done choice=$(echo $choices | sed 's/|/\n/g' | tmenu) profile_name=$(echo $choice | awk -F':' '{print $2}') brave --profile-directory="$profile_name" & disown