I want to open the chosen link in private mode in Firefox, but I can't find any way to do this in the current version. The BROWSER environment variable is only for browser commands and not for theirs options/flags.
As I was writing this, I came up with a very simple workaround — using a script wrapper such as firefox-private:
#!/bin/sh
set -e
if ! command -v firefox > /dev/null 2>&1; then
echo 'firefox: command not found' >&2
exit 1
fi
exec firefox --private-window "$@"
And then can be used as:
alias ddgr='BROWSER=firefox-private ddgr'
But this approach requires to add/modify 2 files only for 1 browser. If one would want to make aliases for ddgr to open in different browsers, the number of files that are needed to be modified will increase.
I want to open the chosen link in private mode in Firefox, but I can't find any way to do this in the current version. The
BROWSER
environment variable is only for browser commands and not for theirs options/flags.As I was writing this, I came up with a very simple workaround — using a script wrapper such as
firefox-private
:And then can be used as:
But this approach requires to add/modify 2 files only for 1 browser. If one would want to make aliases for
ddgr
to open in different browsers, the number of files that are needed to be modified will increase.