How can I set default arguments for apps I launch from the terminal?

0
0
Asked By CuriousExplorer42 On

Hey everyone! I'm using CachyOS with Hyprland and I usually open my apps via the terminal. The downside is that some of these apps need specific arguments to work, and I don't always want to keep the terminal open just for that. I know I could create a shell script that includes all the necessary arguments, but that would mean either cluttering my home directory or dealing with giving paths for those scripts. Is there a way to set basic commands like 'firefox' or 'discord' to open with the arguments I want without creating messy scripts? I've heard about .desktop files having an 'exec =' line where I can add arguments, but my applications folder is currently empty! Any advice?

2 Answers

Answered By TechieTommy89 On

You can actually use aliases to simplify this! Just add something like `alias firefox="firefox --foo --bar"` into your `.bashrc` file, or whatever configuration file your shell uses. This way, every time you type 'firefox', it will automatically include those arguments. Keep in mind you'll need to restart your terminal or source the file for the changes to take effect.

Answered By LinuxLover77 On

Just to clarify, when you say "default command", are you talking about launching apps from the terminal or when clicking on files? If you're looking to run a command directly in a terminal where it automatically has arguments, aliases are definitely your best bet. They make this whole process super easy!

CuriousExplorer42 -

Thanks for the clarification! I want to avoid typing arguments manually every time in the terminal, so aliases sound like a good solution.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.