Dynamic theming of Firefox (and Thunderbird) using your Pywal colors
- Tired of Firefox and Thunderbird not respecting your gorgeous Pywal colors like the rest of your system?
- Looking to rack up some karma :arrow_up: on /r/unixporn?
With Pywalfox you can:
- Customize the colors of almost every UI element
- Automatically theme DuckDuckGo :duck: searches in Firefox (optional)
- Have bold text, styled dropdowns and much more (optional)
- Easily update the theme using the add-on GUI and/or the command line
- Automatically switch between a dark and a light theme based on the time of day
- Firefox and/or Thunderbird
- Python (version 2.7.x or 3.x)
Pywalfox is supported on GNU/Linux, MacOS and Windows.
pip install pywalfox
- Get the Pywalfox add-on for
- Restart Firefox and/or Thunderbird
- Click the Pywalfox icon in the Firefox/Thunderbird UI to access the theme settings and click "Fetch Pywal colors". A theme matching your Pywal colors should now be applied.
Please review the Troubleshooting section if something is not working correctly.
Updating the theme using the terminal
pywalfox update in your terminal to trigger an update of the browser theme.
This command allows integration of Pywalfox into e.g. system theming scripts and is functionally equivalent to clicking "Fetch Pywal colors" in the add-on settings GUI.
Pywalfox comes with extensive customization options divided into the "Palette", "Palette template" and "Theme template" sections in the add-on settings GUI.
The palette in the "Palette" section is used to temporarily customize one or more colors from the Pywal palette.
You can use one of the generated colors, or choose any color from a colorwheel. Changes to the palette will be reset when clicking "Fetch Pywal colors" or when running
If you want your palette customizations to be persistent (unlike the regular palette) you must save your current palette as a so-called palette template.
Saving a palette template is quite simple:
- Click "Fetch Pywal colors" (or run
pywalfox update) in the add-on settings GUI.
- Use the regular "Palette" at the top of the page to customize the colors to your liking.
- Colors from outside the Pywal palette (i.e. from the colorwheel) cannot be used in a template.
- Click "Load from current" in the "Palette template" section below.
- The colors can also be set directly in the "Palette template" section using Pywal color indices.
- Click "Save palette" to save the palette template.
Your custom palette will now be applied whenever you update the browser theme.
The theme template assigns colors (from your palette template) to different browser elements.
Every element of the browser that is currently supported by the Theme API can be customized.
To create a palette template, go through the items in the "Theme template" section and assign a color to each item. The colors are identified by their names as seen in the "Palette template" section.
There are three different theme modes, Dark, Light and Auto. Selecting Auto will automatically switch between the dark and light modes based on a selected time interval in the "General" section of the extension.
Note that the dark and light modes have separate theme and palette templates. When modifying a template, you are always modifiying the template for the currently selected mode.
Further theming with the included userChrome.css and userContent.css in Firefox
Pywalfox includes custom CSS sheets that you can enable for Firefox. The custom CSS sheets applies your Pywal colors to the context menus and other elements of the browser that are not available using the Theme API. The scrollbar can also be hidden for a cleaner look.
To enable the custom CSS sheets:
- Navigate to
- Under "General" in the Pywalfox settings:
- Enable "Use included userChrome.css" to theme context menus and other details
- Enable "Use included userContent.css" to hide the scrollbar
pywalfox uninstall # Removes the manifest from native-messaging-hosts pip uninstall pywalfox # Removes the pywalfox executable
If you updated Pywalfox and have issues, try re-running the setup script as described in Installation above.
Check the log in the Debugging section at the bottom of the Pywalfox settings page
If you have a permission error when running
pywalfox setup, you can (probably) fix it by doing one of the following:
chown <username> ~/.mozilla/native-messaging-hosts
rm -r ~/.mozilla/native-messaging-hosts; the setup script will then recreate it with the correct permissions.
Make sure to use the path from the setup output!
If you get
Received unhandled message action: invalidMessage, you are using an outdated daemon version. Install the newest one using
pipby following the instructions in the Installation.
~/.cache/wal/colorsexists and contains the colors generated by Pywal
~/<native-messaging-hosts-folder>/pywalfox.jsonis a valid path
Check the Firefox browser console for errors (
Tools > Web developer > Browser console)
Errors in the browser console
ExtensionError: No such native application pywalfox:
The manifest is not installed properly. Try installing the manifest manually by following the instructions here.
The manifest is located at
After you have copied over the manifest to the correct path, make sure to also update the
pathproperty in the copied manifest. The
pathshould point to
win.batif you are on Windows).
If it still does not work, try reinstalling Firefox, see #14.
stderr output from native app pywalfox: <installation-path>/main.sh: line 3: pywalfox: command not foundPywalfox assumes that the
pywalfoxexecutable is in your
If you can not run
pywalfoxfrom the command line (without specifying an absolute path), you must either add the path to the execuatable to your
PATHvariable, or move the executable to a path that already is in your
If you encounter any other errors this troubleshooting guide from Mozilla may be of use.
Note that the errors in the
Browser Console is not limited to just Pywalfox.
git clone [email protected]/frewacom/pywalfox.git cd pywalfox yarn install # or npm if you do not have yarn installed yarn run debug
To build the extension into a zip:
yarn run build