[Qgis-user] Have QGIS prompt for profile to use everytime ?

Charles Dixon-Paver charles at kartoza.com
Wed Oct 21 05:18:09 PDT 2020


If you don't want to bother with a full blown python app, on windows you
could pretty easily make a "custom-profile-qgis.cmd" batchfile with
something like the following:

------------------------------------------------------------

@echo off
@setlocal enableextensions
@cd /d "%~dp0"

Set "MYPROFILE=default"
ECHO Please type the name of your user profile:
Set /P "MYPROFILE="

%COMSPEC% /C "CALL C:\OSGeo4W64\bin\qgis.bat --profile %MYPROFILE% %*"

------------------------------------------------------------

Changing the QGIS startup batch location of course. You could also probably
extend it easily with https://ss64.com/nt/choice.html

Then your "shortcut" will prompt you for the profile you want to use.

I reckon pulling off the same in bash is also pretty trivial...

Regards

On Wed, 21 Oct 2020 at 14:00, Raymond Nijssen <r.nijssen at terglobo.nl> wrote:

> Hi Lars,
>
> I don't think you can. You can make a startup.py script that runs every
> time you start QGIS, but it sits in your profile folder. So when QGIS
> runs it, QGIS must already be aware of the profile that is being used.
> Also, changing the profile needs a QGIS restart, so it seems QGIS cannot
> change profile anymore while running.
>
> Maybe you can make a small python (pyqt?) script that displays a dialog
> with profile name picker and does a "qgis --profile NAME" for you?
>
> Regards,
> Raymond
>
>
> On 21-10-2020 13:21, Lars I. Nielsen, LIFA A/S wrote:
> > Hi list.
> >
> > If I have multiple profiles defined, is it possible to have QGIS prompt
> > me everytime for which profile to use ?
> >
> > I know that I can add “--profile NAME” to the command line, but is
> > looking for a way to avoid having multiple start icons.
> >
> > Med venlig hilsen
> >
> > Lars I. Nielsen, LIFA A/S
> > GIS-kons., FME+Python Certified Professional
> > Geoinformatik
> >
> > *T*
> >
> >
> >
> > 6313 6800
> >
> >
> >
> > *@*
> >
> >
> >
> > lin at lifa.dk
> >
> > *D*
> >
> >
> >
> > 6313 6849
> >
> >
> >
> > *W*
> >
> >
> >
> > www.lifa.dk <http://www.lifa.dk>
> >
> > *M*
> >
> >
> >
> > *CVR*
> >
> >
> >
> > 20937289
> >
> >
> > <https://www.linkedin.com/company/lifa-a-s/>
> > Følg os på LinkedIn og læs de seneste nyheder fra LIFA A/S
> >
> >
> > _______________________________________________
> > Qgis-user mailing list
> > Qgis-user at lists.osgeo.org
> > List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> > Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
> >
> _______________________________________________
> Qgis-user mailing list
> Qgis-user at lists.osgeo.org
> List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
> Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20201021/d7995c00/attachment.html>


More information about the Qgis-user mailing list