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.
4 Answers
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!
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.
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.
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.
Related Questions
How To Get Your Domain Unblocked From Facebook
How To Find A String In a Directory of Files Using Linux