DEV Community

Suhail
Suhail

Posted on • Edited on

Some useful Linux command-line launch arguments

Command-line arguments can be added before you call a program in Linux. They can be used to pass parameters to the program, set or unset environment variables, or even run "wrapper programs" before launching your program.

How to use

If you're calling the program from the terminal, you can add an alias like

alias [program]=[args] [program]
Enter fullscreen mode Exit fullscreen mode

If you're calling from an app launcher, you can modify the .desktop file. The file will probably be present at /usr/share/applications/. Copy it to ~/.local/share/applications/ so you can edit it without root.

Now, modify the Exec parameter to be

Exec=env [args] [program]
Enter fullscreen mode Exit fullscreen mode

Below are a few arguments that I use.

Prevent internet access

firejail --noprofile --net=none
Enter fullscreen mode Exit fullscreen mode

Prevents the program from having internet access. Requires firejail to be installed.

Use GTK file picker

QT_QPA_PLATFORMTHEME=gtk3
Enter fullscreen mode Exit fullscreen mode

Use the standard GTK file picker instead of the one that came with the program. Useful if the file picker can't adapt to the color scheme resulting in incorrect symbolic icon colors.

Scale program fractionally

QT_SCREEN_SCALE_FACTORS=""
Enter fullscreen mode Exit fullscreen mode

Make the program scale properly if fractional scaling is used. Otherwise, the fonts and images would look blurry.

Touchpad on Firefox

MOZ_USE_XINPUT2=1
Enter fullscreen mode Exit fullscreen mode

Use kinetic scrolling and touchpad gestures in Firefox on Xorg. Last I checked, this did not work on Fedora though (issue was caused by an environment variable I couldn't figure out how to unset).

Pre/Post-launch game scripts

gamemoderun
Enter fullscreen mode Exit fullscreen mode

Activates GameMode with your configuration when you run a game (use it as a start/stop script if activing GameMode when starting the game does not work in your game launcher). Useful if you want to disable/enable the compositor when the game launches/closes, or something similar.

Hide Steam pop-up

STEAMOS=1
Enter fullscreen mode Exit fullscreen mode

Prevents Steam from showing a window asking to download non-essential dependencies (that are too new to be in the repos for older distros) when it launches every time.

Conclusion

We've covered how to use command-line launch arguments on Linux along with a few useful examples.

Top comments (0)