Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brofi

Browser tab switcher using rofi. Reads browser session data and presents all open tabs in rofi for fuzzy-search selection with favicon icons. Selecting a tab raises the correct browser window and switches to that tab.

Supports Firefox, LibreWolf, Waterfox, Zen, and Floorp.

How it works

  1. Discovers active browser profiles by scanning known session file paths and checking for profile lock files
  2. Reads recovery.jsonlz4 (mozlz4 format) to extract all open tabs with titles, URLs, favicons, and last-accessed timestamps
  3. Presents tabs in rofi sorted by most-recently-used order, with website favicons as row icons
  4. On selection, raises the correct browser window via wmctrl and navigates to the target tab via xdotool keyboard shortcuts

Requirements

  • Python 3 with lz4 module (pip install lz4 or dnf install python3-lz4)
  • rofi (v2.0+)
  • wmctrl
  • xdotool
  • X11 (Wayland is not supported)

Usage

Run directly:

./brofi

List tabs without rofi:

./brofi --list

Options:

  -l, --list       List tabs to stdout instead of launching rofi
  --no-icons       Disable favicon icons in rofi

Installation

sudo make install

Or copy brofi to somewhere in your $PATH.

Window manager integration

Bind brofi to a keyboard shortcut in your window manager. For example, in Marco (MATE):

gsettings set org.mate.Marco.keybinding-commands command-1 brofi
gsettings set org.mate.Marco.global-keybindings run-command-1 '<Mod4>space'

Theming

brofi ships with a dark semi-transparent rofi theme. The theme is loaded automatically from these locations (first match wins):

  1. $XDG_CONFIG_HOME/brofi/brofi.rasi (user override)
  2. Next to the brofi script (for running from the source directory)
  3. $PREFIX/share/brofi/brofi.rasi (installed by make install)

To customize, copy the bundled brofi.rasi to ~/.config/brofi/brofi.rasi and edit it.

Supported browsers

Browser Native paths Flatpak paths
Firefox ~/.mozilla/firefox/*/, ~/.config/mozilla/firefox/*/ ~/.var/app/org.mozilla.firefox/
LibreWolf ~/.librewolf/*/ ~/.var/app/io.gitlab.librewolf-community/
Waterfox ~/.waterfox/*/ ~/.var/app/net.waterfox.waterfox/
Zen ~/.zen/*/ ~/.var/app/app.zen_browser.zen/
Floorp ~/.floorp/*/ ~/.var/app/one.ablaze.floorp/

Only profiles with an active lock file are read, so stale profiles from non-running browsers are ignored.

Limitations

  • Tab data may be up to ~15 seconds stale (controlled by browser.sessionstore.interval in about:config)
  • X11 only (uses wmctrl and xdotool)
  • Cannot activate tabs in browsers that are completely unresponsive

License

MIT

About

Browser tab switcher using rofi. Reads Firefox-family session data and presents tabs with favicons for fuzzy-search selection.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages