How can I set default command arguments for apps in CachyOS?
Asked by
MellowMoon123
I'm using CachyOS with Hyprland and prefer launching applications directly from the terminal. However, some applications require additional arguments to run correctly. While I could create a shell script for each app with the necessary arguments, that would clutter my home directory or require me to navigate to their paths each time. Is there a way to customize commands like 'firefox' or 'discord' to always include these arguments by default? I've heard that .desktop files can specify 'exec = ' to include arguments, but my applications folder is empty, so I'm not sure how to implement that.
Answers
Just to clarify, when you mention 'default command,' are you referring to launching an app through a file manager or just running commands in the terminal? If it's in the terminal, setting up aliases is the way to go.
Reply to this answer
Really, using shell aliases should do the trick without any need for complex scripts. If you're considering a more permanent fix, make sure to save these in either your `.bashrc` or a separate `.bash_aliases` file. That way, they can load up every time you open a new terminal.
Reply to this answer
You can easily set this up using aliases! Just add a line like `alias firefox="firefox --foo --bar"` to your `.bashrc` or the equivalent for your shell, and it will always include those arguments when you run the command.
Reply to this answer
To clarify about the .desktop files: those are mainly for GUI launchers and won't affect what happens when you type commands in the shell itself, like `firefox`. But if you just want to add some custom parameters, stick to aliasesโthey're much simpler!
Reply to this answer
Add your answer
Answers are reviewed before publication.
Related Discussions