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