Skip to content

Instantly share code, notes, and snippets.

@snehesht
Created April 10, 2026 04:13
Show Gist options
  • Select an option

  • Save snehesht/78282ecd64f2e0cac653a690229e6de5 to your computer and use it in GitHub Desktop.

Select an option

Save snehesht/78282ecd64f2e0cac653a690229e6de5 to your computer and use it in GitHub Desktop.
#!/bin/bash
if ! command -v librewolf &> /dev/null
then
echo "librewolf could not be found. Please install librewolf to use this script."
exit 1
fi
if [ ! -d "/tmp/firefox/" ]; then
mkdir -p "/tmp/firefox/"
fi
temp_dir="/tmp/firefox/$(date +%s)"
firefox_profile_name=ff$(date +%s)
firefox_profile_dir=$temp_dir
mkdir -p "$firefox_profile_dir"
echo "\"$firefox_profile_name $firefox_profile_dir\""
librewolf -no-remote -createprofile "$firefox_profile_name $firefox_profile_dir"
# Create preferences
echo 'user_pref("browser.startup.homepage", "https://duck.com");' >> $firefox_profile_dir/user.js
librewolf -profile $firefox_profile_dir >/dev/null 2>&1 &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment