Skip to main content

Simple script that launches browser with the selected profile.

Project description

Profile Launcher: A Python Script for Effortless Browser Profile Management

⭐ About

This Python script allows you to quickly launch browser profiles without having to manually navigate through the browser's settings. It reads the profile information from each browser's config directory and presents them as options for launch. This can save you time and improve your workflow if you frequently switch between multiple profiles.

The script currently supports all Chromium and Gecko-based browsers that use XDG config and ~/.mozilla directories.

📦 Installation

> Using pipx (recommended)

$ pipx install pybrowsers-profiles

pipx Homepage

> Using pip install

# Just clone repository
$ git clone "https://github.com/haaag/PyBrowsers-Profiles"
$ cd PyBrowsers-Profiles

# Create virtual environment & source
$ python -m venv .venv
$ source .venv/bin/activate
$ pip install .

🚀 Usage

$ pybrowsers --help

[-h] [-b BROWSER] [-v] [-r] [-f] [-t]

usage: Simple script that launches browser with the selected profile. 

options:
  -h, --help            show this help message and exit
  -b, --browser         Browser to launch (default: firefox)
  -r, --rofi            Use Rofi (default: dmenu)
  -f, --found           Select from browsers found in your system.
  -v, --verbose

> Use the -b or --browser option to specify the browser you want to launch

# Open menu with profiles list on Dmenu (This script defaults to Dmenu as Menu)
$ (.venv) pybrowsers -b firefox
# or
$ (.venv) pybrowsers --browser firefox


> Use the -r or --rofi option to specify the launcher you want to use

$ (.venv) pybrowsers -b firefox --rofi

> Open all browsers found with Dmenu or Rofi with the argument --found

# Dmenu
$ (.venv) pybrowsers --found

# Rofi
$ (.venv) pybrowsers --found --rofi

➕ Add Browser

You can add a new configuration by modifying the src/database.py file accordingly.

Example

"ungoogled-chromium": {
    "name": "ungoogled-chromium",
    "command": "ungoogled-chromium",
    "profile_command": "--profile-directory='{profile}' --no-default-browser-check",
    "profile_file": "~/.config/chromium/Local State",
    "incognito": "--incognito",
    "type": JSON,
}

🌐 Browsers

⚡️ Requirements

🧰 TODO

  • Better way to add a new browser
    • Go back to JSON file?
    • Use sqlite3?
  • Find a better way to get Menu object (maybe factory mode)
  • Please, use pathlib.Path

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pybrowsers_profiles-0.0.2.tar.gz (8.4 kB view hashes)

Uploaded Source

Built Distribution

pybrowsers_profiles-0.0.2-py3-none-any.whl (10.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page