On my Linux (Manjaro KDE, QT version 5.14.2) machine with 1920 x 1080 screen resolution machine, if I launch Mathematica 12.1 from the terminal using the following commands, the notebook and window size look good to me.


How can I set these variables as default every time I launch Mathematica (from GUI or from the terminal by just typing mathematica)?

My init.m file looks like this

 "PredictiveInterface" -> {"ShowMinimized" -> False, "FirstUse" -> False}},
"LastRegistrationReminderDate"->{2020, 5, 4},
 "Autoload" -> True, "BaseURL" -> "Automatic", "SendMathematicaSessionInfo" -> 
  True, "AppID" -> Automatic}}

I tried adding the terminal command directly to the init.m file but that did not work.

  • $\begingroup$ I think this is operating system question. For example, you can define $\endgroup$
    – Acus
    May 5, 2020 at 6:24
  • 1
    $\begingroup$ alias Mathematica='QT_AUTO_SCREEN_SCALE_FACTOR=1 QT_SCALE_FACTOR=1.2 Mathematica &' in .bashrc. then typing Mathematica will call the above sequence. Or you can export the above variables, then the setting will be applied to all programs. In a similar way you can edit the script which is called by pressing gui button (this depends on graphical environment you use). $\endgroup$
    – Acus
    May 5, 2020 at 6:34
  • $\begingroup$ @user18792 Thanks. I tried adding `Mathematica='QT_AUTO_SCREEN_SCALE_FACTOR=1 QT_SCALE_FACTOR=1.2 Mathematica &' to the .bashrc file but that also doesn't work for some reason. $\endgroup$ May 5, 2020 at 7:16
  • 1
    $\begingroup$ You need to add word "alias" before the first Mathematica (which creates alias). Also to unlogin and login again from the user in order changes take place. Also you can test it before including first executing "alias Mathematica='QT_AUTO_SCREEN_SCALE_FACTOR=1 QT_SCALE_FACTOR=1.2 Mathematica &' " in terminal (remove outer quatation marks, however keep single quatation marks. Can read about creating aliases in many places, for example here askubuntu.com/questions/1414/how-to-create-a-permanent-alias $\endgroup$
    – Acus
    May 5, 2020 at 8:43
  • $\begingroup$ @user18792 That workaround worked for me. I also added it to the command executed when I open using GUI and that works as well. Can you post your comment as an answer so that I can accept it? $\endgroup$ May 5, 2020 at 9:01

1 Answer 1


You can create alias for the particular command as

alias Mathematica='QT_AUTO_SCREEN_SCALE_FACTOR=1 QT_SCALE_FACTOR=1.2 Mathematica &'

After testing it in terminal you can make the alias permanent by adding it, for example, in .bashrc file. If you want that QT_AUTO_SCREEN_SCALE_FACTOR=1 QT_SCALE_FACTOR=1.2 values to be applied to all other commands, your can add

export QT_SCALE_FACTOR=1.2 

in the same .bashrc


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.