()
| 420 | # a console terminal or an X display to run. |
| 421 | |
| 422 | def register_X_browsers(): |
| 423 | |
| 424 | # use xdg-open if around |
| 425 | if shutil.which("xdg-open"): |
| 426 | register("xdg-open", None, BackgroundBrowser("xdg-open")) |
| 427 | |
| 428 | # Opens an appropriate browser for the URL scheme according to |
| 429 | # freedesktop.org settings (GNOME, KDE, XFCE, etc.) |
| 430 | if shutil.which("gio"): |
| 431 | register("gio", None, BackgroundBrowser(["gio", "open", "--", "%s"])) |
| 432 | |
| 433 | xdg_desktop = os.getenv("XDG_CURRENT_DESKTOP", "").split(":") |
| 434 | |
| 435 | # The default GNOME3 browser |
| 436 | if (("GNOME" in xdg_desktop or |
| 437 | "GNOME_DESKTOP_SESSION_ID" in os.environ) and |
| 438 | shutil.which("gvfs-open")): |
| 439 | register("gvfs-open", None, BackgroundBrowser("gvfs-open")) |
| 440 | |
| 441 | # The default KDE browser |
| 442 | if (("KDE" in xdg_desktop or |
| 443 | "KDE_FULL_SESSION" in os.environ) and |
| 444 | shutil.which("kfmclient")): |
| 445 | register("kfmclient", Konqueror, Konqueror("kfmclient")) |
| 446 | |
| 447 | # Common symbolic link for the default X11 browser |
| 448 | if shutil.which("x-www-browser"): |
| 449 | register("x-www-browser", None, BackgroundBrowser("x-www-browser")) |
| 450 | |
| 451 | # The Mozilla browsers |
| 452 | for browser in ("firefox", "iceweasel", "seamonkey", "mozilla-firefox", |
| 453 | "mozilla"): |
| 454 | if shutil.which(browser): |
| 455 | register(browser, None, Mozilla(browser)) |
| 456 | |
| 457 | # Konqueror/kfm, the KDE browser. |
| 458 | if shutil.which("kfm"): |
| 459 | register("kfm", Konqueror, Konqueror("kfm")) |
| 460 | elif shutil.which("konqueror"): |
| 461 | register("konqueror", Konqueror, Konqueror("konqueror")) |
| 462 | |
| 463 | # Gnome's Epiphany |
| 464 | if shutil.which("epiphany"): |
| 465 | register("epiphany", None, Epiphany("epiphany")) |
| 466 | |
| 467 | # Google Chrome/Chromium browsers |
| 468 | for browser in ("google-chrome", "chrome", "chromium", "chromium-browser"): |
| 469 | if shutil.which(browser): |
| 470 | register(browser, None, Chrome(browser)) |
| 471 | |
| 472 | # Opera, quite popular |
| 473 | if shutil.which("opera"): |
| 474 | register("opera", None, Opera("opera")) |
| 475 | |
| 476 | if shutil.which("microsoft-edge"): |
| 477 | register("microsoft-edge", None, Edge("microsoft-edge")) |
| 478 | |
| 479 |
no test coverage detected