3

I'm using QGIS user profiles for different tasks and would like to choose the right one at QGIS startup - is that possible?

I know how to set the default profile by editing the profiles.ini in QGIS profile folder, but I would like to choose it on QGIS start.

I also found that solution by starting qgis in a specific profile via command line: Launching QGIS with specific user profile

6
  • So, a little batch file with a user prompt with your QGIS different profiles would meet the need? May 28, 2021 at 9:42
  • Sure, that would meet my need ;-) I'm running Linux (Mint)
    – MartinMap
    May 29, 2021 at 7:42
  • 2
    QGIS 3.32 will do this Jun 13, 2023 at 8:33
  • @bugmenot123 probably worth another answer as here in the comments, it risks to be overlooked.
    – Babel
    Jun 13, 2023 at 8:40
  • 1
    No time, just bumped into this question while searching for other things. Feel welcome to add it! Jun 13, 2023 at 8:51

1 Answer 1

3

Here is a small shell script that list your QGIS profiles and let the user choose the desired one.

Don't forget to do a chmod +x your_file.sh to execute it in a terminal.

#!/usr/bin/bash

echo ""
echo "MMMMMMMMMMMMMMMMMMMMMMMMMMMMMM"
echo "MMMMMMMMNOdlc::::clxONMMMMMMMM"
echo "MMMMMW0l'            'l0WMMMMM"
echo "MMMMXl.   'cxkOOOxl'   .oXMMMM"
echo "MMMXc   .dXMMMMMMMMXd.   cNMMM"
echo "MMMk.  .dWMMXkxxkKWMWd.  .kMMM"
echo "MMWd   .OMMWd.  .:kNMO.   dWMM"
echo "MMMk.  .dWMMK:..cxlokk;  .kMMM"
echo "MMMXc   .oXMMN0kKo   .cl;oXMMM"
echo "MMMMXl.   'lxO000x;.   .l0WMMM"
echo "MMMMMW0l.        .co;    ,0MMM"
echo "MMMMMMMWXOdl:;;;::o0Nk:..;0MMM"
echo "MMMMMMMMMMMMMWWWMMMMMMWNNNWMMM"
echo ""

QGIS_USER_DIR=~/.local/share/QGIS/QGIS3/profiles/
PROFILES=$(ls -l $QGIS_USER_DIR | grep ^d | awk '{print $9}')
OPTIONS=($PROFILES "Quit")
VALID_PROFILES=$(echo $PROFILES | sed -e "s/[ ]/|/g")

PS3="Choose your QGIS profile: "
select opt in "${OPTIONS[@]}"
do
    CHOICE=$opt
    if [[ $opt == "" ]]; then
        CHOICE="_invalid_profile_"
    elif [[ $VALID_PROFILES =~ $opt ]]; then
        CHOICE="_valid_profile_"
    fi
    case $CHOICE in
        "_valid_profile_" )
            qgis --profile $opt
            break
            ;;
        Quit)
            break
            ;;
        *) echo "invalid option $REPLY";;
    esac
done

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.