Giter Site home page Giter Site logo

m-gregoire / pywalfox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from frewacom/pywalfox

0.0 2.0 0.0 1.07 MB

Dynamic theming of Firefox using your pywal colors

Home Page: https://addons.mozilla.org/en-US/firefox/addon/pywalfox/

CSS 23.09% Shell 1.20% JavaScript 44.87% HTML 18.81% Python 12.03%

pywalfox's Introduction

Pywalfox

Pywalfox is an addon used to theme Firefox using your pywal colors.

  • Customizable colors
  • Uses the Firefox Theme API (no CSS required!)
  • Automatic theming for DuckDuckGo (Optional)
  • Custom CSS with bold text, styled dropdowns, etc. (Optional)
  • Update the browser theme using the addon and/or your terminal

You can download the Firefox add-on here: https://addons.mozilla.org/en-US/firefox/addon/pywalfox/

Warning

To use this add-on, you must install a script on your computer. The script fetches your pywal colors and will be run by Firefox upon launch. As of now, Pywalfox supports only Linux.

Requirements

  • Python (both 2.7.x and 3.x versions are supported)
  • pywal
  • Firefox
  • Linux

Installation

  1. git clone https://github.com/Frewacom/Pywalfox.git
  2. cd Pywalfox
  3. bash setup.sh

If the setup is successful, it should look something like this:

Creating 'native-messaging-hosts' folder in ~/.mozilla
Copying native messaging manifest to /home/<username>/.mozilla/native-messaging-hosts/pywalfox.json
Setting path to daemon/pywalfox.py in the manifest
Setting execution permissions on daemon/pywalfox.py
Finished.

Restart Firefox and you should be able to fetch the colors using the Settings page. If not, take a look in the Troubleshooting section below.

Updating the theme using the terminal

If you are using some script for theming your system and do not want to manually refetch your pywal colors using the settings page, you can trigger an update of the browser theme by running ./daemon/pywalfox.py update in your terminal (the script is not in your PATH by default).

Using the included userChrome.css and userContent.css

Pywalfox comes with custom CSS that you can enable if you want to. It applies your pywal colors to context menus and other elements of the browser that are not available using the Firefox Theme API. If you want to use this feature, you must do the following:

  1. Navigate to about:config in Firefox
  2. Set toolkit.legacyUserProfileCustomizations.stylesheets to true
  3. Enable the Custom CSS option in the Settings page of the addon

Troubleshooting

  • If you updated Pywalfox and have issues, try re-running the setup script as described above.
  • If you do not have permission to copy files to .mozilla/native-messaging-hosts, you can either run
    chown <username> ~/.mozilla/native-messaging-host or (if the folder is empty) simply remove it and the setup script will recreate it with the correct permissions.
  • Take a look at the Debugging output in the Settings page of the addon
  • Make sure that path in ~/.mozilla/native-messaging-hosts/pywalfox.json points to the location of daemon/pywalfox.py
  • Make sure that pywalfox.py is executable (chmod +x pywalfox.py)
  • Make sure that the file ~/.cache/wal/colors exists and contains the colors generated by pywal
  • Take a look at the Browser console (Tools > Web developer > Browser console) for errors

Errors in browser console

  • ExtensionError: No such native application pywalfox

    The manifest is not installed properly. Follow the instructions here: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_manifests. The manifest is located at daemon/assets/pywalfox-manifest.json.

    If you still can not get it to work, you could try reinstalling Firefox: #14

  • Unchecked lastError value: Error: Could not establish connection. Receiving end does not exist.

    The path to the script in the manifest is invalid or the script crashed on execution (try running it manually).

    The script runs in an infinite loop, so as long as the script does not crash when running it, we know that the issues lies somewhere else.

If you encounter any other errors: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging#Troubleshooting

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.